- Users are not allowed to set null desktops. Fixes bug 6759.

svn path=/trunk/; revision=56676
This commit is contained in:
James Tabor 2012-05-29 21:34:06 +00:00
parent 4f76ca4995
commit 4b39ab3f4a

View file

@ -1889,11 +1889,15 @@ IntSetThreadDesktop(IN HDESK hDesktop,
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();