mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 21:53:06 +00:00
[win32k]
- Fix disconnecting from a desktop when IntSetThreadDesktop gets NULL parameter svn path=/trunk/; revision=51101
This commit is contained in:
parent
5177b0a967
commit
508ce4d9f8
1 changed files with 21 additions and 17 deletions
|
@ -1798,7 +1798,7 @@ BOOL
|
||||||
IntSetThreadDesktop(IN HDESK hDesktop,
|
IntSetThreadDesktop(IN HDESK hDesktop,
|
||||||
IN BOOL FreeOnFailure)
|
IN BOOL FreeOnFailure)
|
||||||
{
|
{
|
||||||
PDESKTOP DesktopObject, OldDesktop;
|
PDESKTOP DesktopObject = NULL, OldDesktop;
|
||||||
HDESK hOldDesktop;
|
HDESK hOldDesktop;
|
||||||
PTHREADINFO W32Thread;
|
PTHREADINFO W32Thread;
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
|
@ -1809,6 +1809,8 @@ IntSetThreadDesktop(IN HDESK hDesktop,
|
||||||
MapHeap = (PsGetCurrentProcess() != PsInitialSystemProcess);
|
MapHeap = (PsGetCurrentProcess() != PsInitialSystemProcess);
|
||||||
W32Thread = PsGetCurrentThreadWin32Thread();
|
W32Thread = PsGetCurrentThreadWin32Thread();
|
||||||
|
|
||||||
|
if(hDesktop != NULL)
|
||||||
|
{
|
||||||
/* Validate the new desktop. */
|
/* Validate the new desktop. */
|
||||||
Status = IntValidateDesktopHandle(
|
Status = IntValidateDesktopHandle(
|
||||||
hDesktop,
|
hDesktop,
|
||||||
|
@ -1818,7 +1820,7 @@ IntSetThreadDesktop(IN HDESK hDesktop,
|
||||||
|
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
DPRINT("Validation of desktop handle (0x%X) failed\n", hDesktop);
|
DPRINT1("Validation of desktop handle (0x%X) failed\n", hDesktop);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1829,6 +1831,8 @@ IntSetThreadDesktop(IN HDESK hDesktop,
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
if (!IsListEmpty(&W32Thread->WindowListHead))
|
if (!IsListEmpty(&W32Thread->WindowListHead))
|
||||||
{
|
{
|
||||||
DPRINT1("Attempted to change thread desktop although the thread has windows!\n");
|
DPRINT1("Attempted to change thread desktop although the thread has windows!\n");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue