mirror of
https://github.com/reactos/reactos.git
synced 2025-01-10 16:18:16 +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;
|
PWINSTATION_OBJECT WinStaObject;
|
||||||
HANDLE Handle;
|
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,
|
KernelMode,
|
||||||
0,
|
0,
|
||||||
&WinStaObject);
|
&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",
|
IntCreateMenu(&Handle, !PopupMenu);
|
||||||
PsGetCurrentProcess()->Win32WindowStation);
|
|
||||||
SetLastNtError(Status);
|
|
||||||
return (HMENU)0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
IntCreateMenu(&Handle, !PopupMenu);
|
|
||||||
|
|
||||||
ObDereferenceObject(WinStaObject);
|
|
||||||
return (HMENU)Handle;
|
return (HMENU)Handle;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
HMENU STDCALL
|
HMENU STDCALL
|
||||||
NtUserCreateMenu(BOOL PopupMenu)
|
NtUserCreateMenu(BOOL PopupMenu)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue