mirror of
https://github.com/reactos/reactos.git
synced 2025-01-10 08:10:18 +00:00
* dont perform IntValidateWindowStationHandle in UserCreateMenu when current process is CsrProcess
* this makes system menu for cmd.exe display * patch reviewed by w3seek and tested by me svn path=/trunk/; revision=22801
This commit is contained in:
parent
65045dfa79
commit
7b888e6f12
1 changed files with 22 additions and 11 deletions
|
@ -1397,28 +1397,39 @@ HMENU FASTCALL UserCreateMenu(BOOL PopupMenu)
|
|||
{
|
||||
PWINSTATION_OBJECT WinStaObject;
|
||||
HANDLE Handle;
|
||||
NTSTATUS Status;
|
||||
PEPROCESS CurrentProcess = PsGetCurrentProcess();
|
||||
|
||||
NTSTATUS Status = IntValidateWindowStationHandle(PsGetCurrentProcess()->Win32WindowStation,
|
||||
if (CsrProcess != CurrentProcess)
|
||||
{
|
||||
/*
|
||||
* CsrProcess does not have a Win32WindowStation
|
||||
*
|
||||
*/
|
||||
|
||||
Status = IntValidateWindowStationHandle(PsGetCurrentProcess()->Win32WindowStation,
|
||||
KernelMode,
|
||||
0,
|
||||
&WinStaObject);
|
||||
|
||||
if (!NT_SUCCESS(Status))
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
DPRINT1("Validation of window station handle (0x%X) failed\n",
|
||||
CurrentProcess->Win32WindowStation);
|
||||
SetLastNtError(Status);
|
||||
return (HMENU)0;
|
||||
}
|
||||
IntCreateMenu(&Handle, !PopupMenu);
|
||||
ObDereferenceObject(WinStaObject);
|
||||
}
|
||||
else
|
||||
{
|
||||
DPRINT("Validation of window station handle (0x%X) failed\n",
|
||||
PsGetCurrentProcess()->Win32WindowStation);
|
||||
SetLastNtError(Status);
|
||||
return (HMENU)0;
|
||||
IntCreateMenu(&Handle, !PopupMenu);
|
||||
}
|
||||
|
||||
IntCreateMenu(&Handle, !PopupMenu);
|
||||
|
||||
ObDereferenceObject(WinStaObject);
|
||||
return (HMENU)Handle;
|
||||
}
|
||||
|
||||
|
||||
|
||||
HMENU STDCALL
|
||||
NtUserCreateMenu(BOOL PopupMenu)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue