[ros-diffs] [jimtabor] 56676: [Win32k] - Users are not allowed to set null desktops. Fixes bug 6759.

jimtabor at svn.reactos.org jimtabor at svn.reactos.org
Tue May 29 21:34:06 UTC 2012


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/desktop.c?rev=56676&r1=56675&r2=56676&view=diff
==============================================================================
--- 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();
 




More information about the Ros-diffs mailing list