mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 13:35:47 +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,
|
||||
IN BOOL FreeOnFailure)
|
||||
{
|
||||
PDESKTOP DesktopObject, OldDesktop;
|
||||
PDESKTOP DesktopObject = NULL, OldDesktop;
|
||||
HDESK hOldDesktop;
|
||||
PTHREADINFO W32Thread;
|
||||
NTSTATUS Status;
|
||||
|
@ -1809,24 +1809,28 @@ IntSetThreadDesktop(IN HDESK hDesktop,
|
|||
MapHeap = (PsGetCurrentProcess() != PsInitialSystemProcess);
|
||||
W32Thread = PsGetCurrentThreadWin32Thread();
|
||||
|
||||
/* Validate the new desktop. */
|
||||
Status = IntValidateDesktopHandle(
|
||||
hDesktop,
|
||||
UserMode,
|
||||
0,
|
||||
&DesktopObject);
|
||||
|
||||
if (!NT_SUCCESS(Status))
|
||||
if(hDesktop != NULL)
|
||||
{
|
||||
DPRINT("Validation of desktop handle (0x%X) failed\n", hDesktop);
|
||||
return FALSE;
|
||||
}
|
||||
/* Validate the new desktop. */
|
||||
Status = IntValidateDesktopHandle(
|
||||
hDesktop,
|
||||
UserMode,
|
||||
0,
|
||||
&DesktopObject);
|
||||
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
DPRINT1("Validation of desktop handle (0x%X) failed\n", hDesktop);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (W32Thread->rpdesk == DesktopObject)
|
||||
{
|
||||
/* Nothing to do */
|
||||
ObDereferenceObject(DesktopObject);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if (W32Thread->rpdesk == DesktopObject)
|
||||
{
|
||||
/* Nothing to do */
|
||||
ObDereferenceObject(DesktopObject);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if (!IsListEmpty(&W32Thread->WindowListHead))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue