mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 10:04:49 +00:00
implemented LockWindowStation() and UnlockWindowStation() (forgot to commit these changes in my previous commit)
svn path=/trunk/; revision=9268
This commit is contained in:
parent
56ee4446f0
commit
9e1f523308
1 changed files with 67 additions and 7 deletions
|
@ -16,7 +16,7 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*
|
*
|
||||||
* $Id: winsta.c,v 1.57 2004/04/09 20:03:19 navaraf Exp $
|
* $Id: winsta.c,v 1.58 2004/05/01 17:06:55 weiden Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
|
@ -740,31 +740,91 @@ NtUserSetProcessWindowStation(HWINSTA hWindowStation)
|
||||||
/*
|
/*
|
||||||
* NtUserLockWindowStation
|
* NtUserLockWindowStation
|
||||||
*
|
*
|
||||||
|
* Locks switching desktops. Only the logon application is allowed to call this function.
|
||||||
|
*
|
||||||
* Status
|
* Status
|
||||||
* @unimplemented
|
* @implemented
|
||||||
*/
|
*/
|
||||||
|
|
||||||
BOOL STDCALL
|
BOOL STDCALL
|
||||||
NtUserLockWindowStation(HWINSTA hWindowStation)
|
NtUserLockWindowStation(HWINSTA hWindowStation)
|
||||||
{
|
{
|
||||||
UNIMPLEMENTED
|
PWINSTATION_OBJECT Object;
|
||||||
|
NTSTATUS Status;
|
||||||
|
|
||||||
return 0;
|
DPRINT("About to set process window station with handle (0x%X)\n",
|
||||||
|
hWindowStation);
|
||||||
|
|
||||||
|
if(PsGetWin32Process() != LogonProcess)
|
||||||
|
{
|
||||||
|
DPRINT1("Unauthorized process attempted to lock the window station!\n");
|
||||||
|
SetLastWin32Error(ERROR_ACCESS_DENIED);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
Status = IntValidateWindowStationHandle(
|
||||||
|
hWindowStation,
|
||||||
|
KernelMode,
|
||||||
|
0,
|
||||||
|
&Object);
|
||||||
|
if (!NT_SUCCESS(Status))
|
||||||
|
{
|
||||||
|
DPRINT("Validation of window station handle (0x%X) failed\n",
|
||||||
|
hWindowStation);
|
||||||
|
SetLastNtError(Status);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
Object->Flags |= WSS_LOCKED;
|
||||||
|
|
||||||
|
ObDereferenceObject(Object);
|
||||||
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* NtUserUnlockWindowStation
|
* NtUserUnlockWindowStation
|
||||||
*
|
*
|
||||||
|
* Unlocks switching desktops. Only the logon application is allowed to call this function.
|
||||||
|
*
|
||||||
* Status
|
* Status
|
||||||
* @unimplemented
|
* @implemented
|
||||||
*/
|
*/
|
||||||
|
|
||||||
BOOL STDCALL
|
BOOL STDCALL
|
||||||
NtUserUnlockWindowStation(HWINSTA hWindowStation)
|
NtUserUnlockWindowStation(HWINSTA hWindowStation)
|
||||||
{
|
{
|
||||||
UNIMPLEMENTED
|
PWINSTATION_OBJECT Object;
|
||||||
|
NTSTATUS Status;
|
||||||
|
BOOL Ret;
|
||||||
|
|
||||||
return FALSE;
|
DPRINT("About to set process window station with handle (0x%X)\n",
|
||||||
|
hWindowStation);
|
||||||
|
|
||||||
|
if(PsGetWin32Process() != LogonProcess)
|
||||||
|
{
|
||||||
|
DPRINT1("Unauthorized process attempted to unlock the window station!\n");
|
||||||
|
SetLastWin32Error(ERROR_ACCESS_DENIED);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
Status = IntValidateWindowStationHandle(
|
||||||
|
hWindowStation,
|
||||||
|
KernelMode,
|
||||||
|
0,
|
||||||
|
&Object);
|
||||||
|
if (!NT_SUCCESS(Status))
|
||||||
|
{
|
||||||
|
DPRINT("Validation of window station handle (0x%X) failed\n",
|
||||||
|
hWindowStation);
|
||||||
|
SetLastNtError(Status);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
Ret = (Object->Flags & WSS_LOCKED) == WSS_LOCKED;
|
||||||
|
Object->Flags &= ~WSS_LOCKED;
|
||||||
|
|
||||||
|
ObDereferenceObject(Object);
|
||||||
|
return Ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Reference in a new issue