Author: janderwald
Date: Mon Jul 3 23:25:48 2006
New Revision: 22801
URL:
http://svn.reactos.org/svn/reactos?rev=22801&view=rev
Log:
* 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
Modified:
trunk/reactos/subsystems/win32/win32k/ntuser/menu.c
Modified: trunk/reactos/subsystems/win32/win32k/ntuser/menu.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/ntuser/menu.c (original)
+++ trunk/reactos/subsystems/win32/win32k/ntuser/menu.c Mon Jul 3 23:25:48 2006
@@ -1397,27 +1397,38 @@
{
PWINSTATION_OBJECT WinStaObject;
HANDLE Handle;
-
- NTSTATUS Status =
IntValidateWindowStationHandle(PsGetCurrentProcess()->Win32WindowStation,
+ NTSTATUS Status;
+ PEPROCESS CurrentProcess = PsGetCurrentProcess();
+
+ if (CsrProcess != CurrentProcess)
+ {
+ /*
+ * CsrProcess does not have a Win32WindowStation
+ *
+ */
+
+ Status =
IntValidateWindowStationHandle(PsGetCurrentProcess()->Win32WindowStation,
KernelMode,
0,
&WinStaObject);
- if (!NT_SUCCESS(Status))
- {
- DPRINT("Validation of window station handle (0x%X) failed\n",
- PsGetCurrentProcess()->Win32WindowStation);
- SetLastNtError(Status);
- return (HMENU)0;
- }
-
- IntCreateMenu(&Handle, !PopupMenu);
-
- ObDereferenceObject(WinStaObject);
+ 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
+ {
+ IntCreateMenu(&Handle, !PopupMenu);
+ }
+
return (HMENU)Handle;
}
-
-
HMENU STDCALL
NtUserCreateMenu(BOOL PopupMenu)