- Revert hack from 43061 and fix it properly
- Test results verified by Amine Khaldi
svn path=/trunk/; revision=43062
WinSta = UserGetProcessWindowStation();
- Status = IntValidateWindowStationHandle(WinSta, UserMode, 0 /*WINSTA_ACCESSCLIPBOARD*/, &WinStaObj);
+ Status = IntValidateWindowStationHandle(WinSta, KernelMode, WINSTA_ACCESSCLIPBOARD, &WinStaObj);
if (!NT_SUCCESS(Status))
{
InitializeObjectAttributes(
&ObjectAttributes,
&WindowStationName,
- 0,
+ OBJ_CASE_INSENSITIVE,
NULL,
NULL);
Status = ObOpenObjectByName(
&ObjectAttributes,
ExWindowStationObjectType,
- UserMode,
+ KernelMode,
NULL,
dwDesiredAccess,
NULL,
DPRINT("About to close window station handle (0x%X)\n", hWinSta);
+ if (hWinSta == UserGetProcessWindowStation())
+ {
+ return FALSE;
+ }
+
Status = IntValidateWindowStationHandle(
hWinSta,
KernelMode,