Author: jimtabor
Date: Tue May 29 21:34:06 2012
New Revision: 56676
URL:
http://svn.reactos.org/svn/reactos?rev=56676&view=rev
Log:
[Win32k]
- Users are not allowed to set null desktops. Fixes bug 6759.
Modified:
trunk/reactos/win32ss/user/ntuser/desktop.c
Modified: trunk/reactos/win32ss/user/ntuser/desktop.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/deskto…
==============================================================================
--- trunk/reactos/win32ss/user/ntuser/desktop.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/user/ntuser/desktop.c [iso-8859-1] Tue May 29 21:34:06 2012
@@ -1889,11 +1889,15 @@
BOOL APIENTRY
NtUserSetThreadDesktop(HDESK hDesktop)
{
- BOOL ret;
+ BOOL ret = FALSE;
UserEnterExclusive();
- ret = IntSetThreadDesktop(hDesktop, FALSE);
+ // FIXME: IntSetThreadDesktop validates the desktop handle, it should happen
+ // here too and set the NT error level. Q. Is it necessary to have the validation
+ // in IntSetThreadDesktop? Is it needed there too?
+ if (hDesktop || (!hDesktop && CsrProcess == PsGetCurrentProcess()))
+ ret = IntSetThreadDesktop(hDesktop, FALSE);
UserLeave();