[WIN32K/USER32/WINSRV]
authorHermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
Fri, 2 Nov 2012 11:23:26 +0000 (11:23 +0000)
committerHermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
Fri, 2 Nov 2012 11:23:26 +0000 (11:23 +0000)
- Correct an enumeration identificator initialization.
- Move the call of CSR for registering the logon application, from kernel-mode win32k to user-mode user32
  and therefore remove the unneeded co_CsrNotify function (plus some other unneeded defines).
- Comment some non-working code (#if 0) in user32/misc/misc.c and winsrv/shutdown.c.

svn path=/branches/ros-csrss/; revision=57664

include/reactos/subsys/win/winmsg.h
win32ss/user/ntuser/csr.c
win32ss/user/ntuser/csr.h
win32ss/user/ntuser/simplecall.c
win32ss/user/user32/include/user32p.h
win32ss/user/user32/misc/dllmain.c
win32ss/user/user32/misc/exit.c
win32ss/user/user32/misc/misc.c
win32ss/user/winsrv/init.c
win32ss/user/winsrv/server.c
win32ss/user/winsrv/shutdown.c

index f737256..94bc8eb 100644 (file)
@@ -19,7 +19,7 @@
 
 typedef enum _USERSRV_API_NUMBER
 {
-    UserpExitWindowsEx = USERSRV_SERVERDLL_INDEX,
+    UserpExitWindowsEx = USERSRV_FIRST_API_NUMBER,
     // UserpEndTask,
     // UserpLogon,
     UserpRegisterServicesProcess, // Not present in Win7
@@ -45,12 +45,12 @@ typedef struct
 
 typedef struct
 {
-    HANDLE ProcessId;
+    ULONG_PTR ProcessId;
 } CSRSS_REGISTER_SERVICES_PROCESS, *PCSRSS_REGISTER_SERVICES_PROCESS;
 
 typedef struct
 {
-    HANDLE ProcessId;
+    ULONG_PTR ProcessId;
     BOOL Register;
 } CSRSS_REGISTER_LOGON_PROCESS, *PCSRSS_REGISTER_LOGON_PROCESS;
 
index 5bb9cb7..0334f10 100644 (file)
@@ -7,6 +7,7 @@
  */
 
 #include <win32k.h>
+DBG_DEFAULT_CHANNEL(UserMisc);
 
 static HANDLE WindowsApiPort = NULL;
 PEPROCESS CsrProcess = NULL;
@@ -19,6 +20,8 @@ CsrInit(void)
    ULONG ConnectInfoLength;
    SECURITY_QUALITY_OF_SERVICE Qos;   
 
+   ERR("CsrInit\n");
+
    RtlInitUnicodeString(&PortName, L"\\Windows\\ApiPort");
    ConnectInfoLength = 0;
    Qos.Length = sizeof(Qos);
@@ -26,6 +29,9 @@ CsrInit(void)
    Qos.ContextTrackingMode = SECURITY_STATIC_TRACKING;
    Qos.EffectiveOnly = FALSE;
 
+   CsrProcess = PsGetCurrentProcess();
+   ERR("CsrInit - CsrProcess = 0x%p\n", CsrProcess);
+
    Status = ZwConnectPort(&WindowsApiPort,
                           &PortName,
                           &Qos,
@@ -36,61 +42,11 @@ CsrInit(void)
                           &ConnectInfoLength);
    if (!NT_SUCCESS(Status))
    {
+      ERR("CsrInit - Status = 0x%p\n", Status);
       return Status;
    }
 
-   CsrProcess = PsGetCurrentProcess();
-
    return STATUS_SUCCESS;
 }
 
-
-NTSTATUS FASTCALL
-co_CsrNotify(IN OUT PCSR_API_MESSAGE ApiMessage,
-             IN ULONG DataLength)
-{
-    NTSTATUS Status;
-    PEPROCESS OldProcess;
-
-    if (NULL == CsrProcess)
-    {
-        return STATUS_INVALID_PORT_HANDLE;
-    }
-
-    /* Fill out the Port Message Header */
-    ApiMessage->Header.u2.ZeroInit = 0;
-    ApiMessage->Header.u1.s1.TotalLength =
-        FIELD_OFFSET(CSR_API_MESSAGE, Data) + DataLength;
-        /* FIELD_OFFSET(CSR_API_MESSAGE, Data) <= sizeof(CSR_API_MESSAGE) - sizeof(ApiMessage->Data) */
-    ApiMessage->Header.u1.s1.DataLength =
-        ApiMessage->Header.u1.s1.TotalLength - sizeof(PORT_MESSAGE);
-
-    /* Switch to the process in which the WindowsApiPort handle is valid */
-    OldProcess = PsGetCurrentProcess();
-    if (CsrProcess != OldProcess)
-    {
-        KeAttachProcess(&CsrProcess->Pcb);
-    }
-
-    UserLeaveCo();
-
-    Status = ZwRequestWaitReplyPort(WindowsApiPort,
-                                    &ApiMessage->Header,
-                                    &ApiMessage->Header);
-
-    UserEnterCo();
-
-    if (CsrProcess != OldProcess)
-    {
-        KeDetachProcess();
-    }
-
-    if (NT_SUCCESS(Status))
-    {
-        Status = ApiMessage->Status;
-    }
-
-    return Status;
-}
-
 /* EOF */
index dd15f22..a5eb221 100644 (file)
 extern PEPROCESS CsrProcess;
 
 NTSTATUS FASTCALL CsrInit(void);
-NTSTATUS FASTCALL co_CsrNotify(IN OUT PCSR_API_MESSAGE ApiMessage,
-                               IN ULONG DataLength);
-NTSTATUS FASTCALL CsrCloseHandle(HANDLE Handle);
-NTSTATUS WINAPI CsrInsertObject(HANDLE ObjectHandle,
-                                 ACCESS_MASK DesiredAccess,
-                                 PHANDLE Handle);
 
 /* EOF */
index 79d21ce..b68bf06 100644 (file)
@@ -15,9 +15,8 @@ PPROCESSINFO LogonProcess = NULL;
 BOOL FASTCALL
 co_IntRegisterLogonProcess(HANDLE ProcessId, BOOL Register)
 {
-   PEPROCESS Process;
    NTSTATUS Status;
-   USER_API_MESSAGE Request;
+   PEPROCESS Process;
 
    Status = PsLookupProcessByProcessId(ProcessId,
                                        &Process);
@@ -52,18 +51,6 @@ co_IntRegisterLogonProcess(HANDLE ProcessId, BOOL Register)
 
    ObDereferenceObject(Process);
 
-   Request.ApiNumber = CSR_CREATE_API_NUMBER(USERSRV_SERVERDLL_INDEX, UserpRegisterLogonProcess);
-   Request.Data.RegisterLogonProcessRequest.ProcessId = ProcessId;
-   Request.Data.RegisterLogonProcessRequest.Register = Register;
-
-   Status = co_CsrNotify((PCSR_API_MESSAGE)&Request,
-                         sizeof(CSRSS_REGISTER_LOGON_PROCESS));
-   if (!NT_SUCCESS(Status))
-   {
-      ERR("Failed to register logon process with CSRSS\n");
-      return FALSE;
-   }
-
    return TRUE;
 }
 
index b4ec23d..98c4310 100644 (file)
@@ -23,6 +23,7 @@ extern HINSTANCE User32Instance;
 extern PPROCESSINFO g_ppi;
 extern ULONG_PTR g_ulSharedDelta;
 extern PSERVERINFO gpsi;
+extern BOOLEAN gfLogonProcess;
 extern BOOLEAN gfServerProcess;
 extern PUSER_HANDLE_TABLE gHandleTable;
 extern PUSER_HANDLE_ENTRY gHandleEntries;
index 6bba785..70cdded 100644 (file)
@@ -13,6 +13,7 @@ PUSER_HANDLE_TABLE gHandleTable = NULL;
 PUSER_HANDLE_ENTRY gHandleEntries = NULL;
 PSERVERINFO gpsi = NULL;
 ULONG_PTR g_ulSharedDelta;
+BOOLEAN gfLogonProcess  = FALSE;
 BOOLEAN gfServerProcess = FALSE;
 
 WCHAR szAppInit[KEY_LENGTH];
index 91ed9da..ddcce38 100644 (file)
@@ -67,8 +67,8 @@ BOOL WINAPI
 ExitWindowsEx(UINT uFlags,
               DWORD dwReserved)
 {
-    USER_API_MESSAGE ApiMessage;
     NTSTATUS Status;
+    USER_API_MESSAGE ApiMessage;
 
     ApiMessage.Data.ExitReactosRequest.Flags = uFlags;
     ApiMessage.Data.ExitReactosRequest.Reserved = dwReserved;
@@ -93,10 +93,10 @@ ExitWindowsEx(UINT uFlags,
 BOOL WINAPI
 RegisterServicesProcess(DWORD ServicesProcessId)
 {
-    USER_API_MESSAGE ApiMessage;
     NTSTATUS Status;
+    USER_API_MESSAGE ApiMessage;
 
-    ApiMessage.Data.RegisterServicesProcessRequest.ProcessId = UlongToHandle(ServicesProcessId);
+    ApiMessage.Data.RegisterServicesProcessRequest.ProcessId = ServicesProcessId;
 
     Status = CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage,
                                  NULL,
index 5e5230d..899c080 100644 (file)
@@ -42,7 +42,29 @@ BOOL
 WINAPI
 RegisterLogonProcess(DWORD dwProcessId, BOOL bRegister)
 {
-    return NtUserxRegisterLogonProcess(dwProcessId, bRegister);
+    gfLogonProcess = NtUserxRegisterLogonProcess(dwProcessId, bRegister);
+
+    if (gfLogonProcess)
+    {
+        NTSTATUS Status;
+        USER_API_MESSAGE ApiMessage;
+
+        ApiMessage.Data.RegisterLogonProcessRequest.ProcessId = dwProcessId;
+        ApiMessage.Data.RegisterLogonProcessRequest.Register = bRegister;
+
+        Status = CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage,
+                                     NULL,
+                                     CSR_CREATE_API_NUMBER(USERSRV_SERVERDLL_INDEX, UserpRegisterLogonProcess),
+                                     sizeof(CSRSS_REGISTER_LOGON_PROCESS));
+        if (!NT_SUCCESS(Status) || !NT_SUCCESS(Status = ApiMessage.Status))
+        {
+            SetLastError(RtlNtStatusToDosError(Status));
+            ERR("Failed to register logon process with CSRSS\n");
+            // return FALSE;
+        }
+    }
+
+    return gfLogonProcess;
 }
 
 /*
@@ -52,6 +74,7 @@ BOOL
 WINAPI
 SetLogonNotifyWindow(HWND Wnd, HWINSTA WinSta)
 {
+#if 0
     /* Maybe we should call NtUserSetLogonNotifyWindow and let that one inform CSRSS??? */
     CSR_API_MESSAGE Request;
     NTSTATUS Status;
@@ -69,6 +92,8 @@ SetLogonNotifyWindow(HWND Wnd, HWINSTA WinSta)
     }
 
     return NtUserSetLogonNotifyWindow(Wnd);
+#endif
+    return TRUE;
 }
 
 /*
index 7d0f3ae..d1f8429 100644 (file)
@@ -80,105 +80,6 @@ PCHAR UserServerApiNameTable[UserpMaxApiNumber] =
     // NULL
 };
 
-/*
-PCSR_API_ROUTINE Win32CsrApiDefinitions[] =
-{
-    CsrGetHandle,
-    CsrGetHandle,
-    CsrCloseHandle,
-    CsrVerifyHandle,
-    CsrDuplicateHandle,
-    CsrGetInputWaitHandle,
-    CsrFillOutputChar,
-    CsrReadInputEvent,
-    CsrWriteConsoleOutputChar,
-    CsrWriteConsoleOutputAttrib,
-    CsrFillOutputAttrib,
-    CsrSetTextAttrib,
-    CsrWriteConsoleOutput,
-    CsrFlushInputBuffer,
-    CsrReadConsoleOutputChar,
-    CsrReadConsoleOutputAttrib,
-    CsrExitReactos,
-    CsrHardwareStateProperty,
-    CsrCreateDesktop,
-    CsrShowDesktop,
-    CsrHideDesktop,
-    CsrSetLogonNotifyWindow,
-    CsrRegisterLogonProcess,
-    CsrGenerateCtrlEvent,
-};
-
-static CSRSS_API_DEFINITION Win32CsrApiDefinitions[] =
-{
-    CSRSS_DEFINE_API(GET_INPUT_HANDLE,             CsrGetHandle),
-    CSRSS_DEFINE_API(GET_OUTPUT_HANDLE,            CsrGetHandle),
-    CSRSS_DEFINE_API(CLOSE_HANDLE,                 CsrCloseHandle),
-    CSRSS_DEFINE_API(VERIFY_HANDLE,                CsrVerifyHandle),
-    CSRSS_DEFINE_API(DUPLICATE_HANDLE,             CsrDuplicateHandle),
-    CSRSS_DEFINE_API(GET_INPUT_WAIT_HANDLE,        CsrGetInputWaitHandle),
-    CSRSS_DEFINE_API(WRITE_CONSOLE,                CsrWriteConsole),
-    CSRSS_DEFINE_API(READ_CONSOLE,                 CsrReadConsole),
-    CSRSS_DEFINE_API(ALLOC_CONSOLE,                CsrAllocConsole),
-    CSRSS_DEFINE_API(FREE_CONSOLE,                 CsrFreeConsole),
-    CSRSS_DEFINE_API(SCREEN_BUFFER_INFO,           CsrGetScreenBufferInfo),
-    CSRSS_DEFINE_API(SET_CURSOR,                   CsrSetCursor),
-    CSRSS_DEFINE_API(FILL_OUTPUT,                  CsrFillOutputChar),
-    CSRSS_DEFINE_API(READ_INPUT,                   CsrReadInputEvent),
-    CSRSS_DEFINE_API(WRITE_CONSOLE_OUTPUT_CHAR,    CsrWriteConsoleOutputChar),
-    CSRSS_DEFINE_API(WRITE_CONSOLE_OUTPUT_ATTRIB,  CsrWriteConsoleOutputAttrib),
-    CSRSS_DEFINE_API(FILL_OUTPUT_ATTRIB,           CsrFillOutputAttrib),
-    CSRSS_DEFINE_API(GET_CURSOR_INFO,              CsrGetCursorInfo),
-    CSRSS_DEFINE_API(SET_CURSOR_INFO,              CsrSetCursorInfo),
-    CSRSS_DEFINE_API(SET_ATTRIB,                   CsrSetTextAttrib),
-    CSRSS_DEFINE_API(GET_CONSOLE_MODE,             CsrGetConsoleMode),
-    CSRSS_DEFINE_API(SET_CONSOLE_MODE,             CsrSetConsoleMode),
-    CSRSS_DEFINE_API(CREATE_SCREEN_BUFFER,         CsrCreateScreenBuffer),
-    CSRSS_DEFINE_API(SET_SCREEN_BUFFER,            CsrSetScreenBuffer),
-    CSRSS_DEFINE_API(SET_TITLE,                    CsrSetTitle),
-    CSRSS_DEFINE_API(GET_TITLE,                    CsrGetTitle),
-    CSRSS_DEFINE_API(WRITE_CONSOLE_OUTPUT,         CsrWriteConsoleOutput),
-    CSRSS_DEFINE_API(FLUSH_INPUT_BUFFER,           CsrFlushInputBuffer),
-    CSRSS_DEFINE_API(SCROLL_CONSOLE_SCREEN_BUFFER, CsrScrollConsoleScreenBuffer),
-    CSRSS_DEFINE_API(READ_CONSOLE_OUTPUT_CHAR,     CsrReadConsoleOutputChar),
-    CSRSS_DEFINE_API(READ_CONSOLE_OUTPUT_ATTRIB,   CsrReadConsoleOutputAttrib),
-    CSRSS_DEFINE_API(GET_NUM_INPUT_EVENTS,         CsrGetNumberOfConsoleInputEvents),
-    CSRSS_DEFINE_API(EXIT_REACTOS,                 CsrExitReactos),
-    CSRSS_DEFINE_API(PEEK_CONSOLE_INPUT,           CsrPeekConsoleInput),
-    CSRSS_DEFINE_API(READ_CONSOLE_OUTPUT,          CsrReadConsoleOutput),
-    CSRSS_DEFINE_API(WRITE_CONSOLE_INPUT,          CsrWriteConsoleInput),
-    CSRSS_DEFINE_API(SETGET_CONSOLE_HW_STATE,      CsrHardwareStateProperty),
-    CSRSS_DEFINE_API(GET_CONSOLE_WINDOW,           CsrGetConsoleWindow),
-    CSRSS_DEFINE_API(CREATE_DESKTOP,               CsrCreateDesktop),
-    CSRSS_DEFINE_API(SHOW_DESKTOP,                 CsrShowDesktop),
-    CSRSS_DEFINE_API(HIDE_DESKTOP,                 CsrHideDesktop),
-    CSRSS_DEFINE_API(SET_CONSOLE_ICON,             CsrSetConsoleIcon),
-    CSRSS_DEFINE_API(SET_LOGON_NOTIFY_WINDOW,      CsrSetLogonNotifyWindow),
-    CSRSS_DEFINE_API(REGISTER_LOGON_PROCESS,       CsrRegisterLogonProcess),
-    CSRSS_DEFINE_API(GET_CONSOLE_CP,               CsrGetConsoleCodePage),
-    CSRSS_DEFINE_API(SET_CONSOLE_CP,               CsrSetConsoleCodePage),
-    CSRSS_DEFINE_API(GET_CONSOLE_OUTPUT_CP,        CsrGetConsoleOutputCodePage),
-    CSRSS_DEFINE_API(SET_CONSOLE_OUTPUT_CP,        CsrSetConsoleOutputCodePage),
-    CSRSS_DEFINE_API(GET_PROCESS_LIST,             CsrGetProcessList),
-    CSRSS_DEFINE_API(ADD_CONSOLE_ALIAS,      CsrAddConsoleAlias),
-    CSRSS_DEFINE_API(GET_CONSOLE_ALIAS,      CsrGetConsoleAlias),
-    CSRSS_DEFINE_API(GET_ALL_CONSOLE_ALIASES,         CsrGetAllConsoleAliases),
-    CSRSS_DEFINE_API(GET_ALL_CONSOLE_ALIASES_LENGTH,  CsrGetAllConsoleAliasesLength),
-    CSRSS_DEFINE_API(GET_CONSOLE_ALIASES_EXES,        CsrGetConsoleAliasesExes),
-    CSRSS_DEFINE_API(GET_CONSOLE_ALIASES_EXES_LENGTH, CsrGetConsoleAliasesExesLength),
-    CSRSS_DEFINE_API(GENERATE_CTRL_EVENT,          CsrGenerateCtrlEvent),
-    CSRSS_DEFINE_API(SET_SCREEN_BUFFER_SIZE,       CsrSetScreenBufferSize),
-    CSRSS_DEFINE_API(GET_CONSOLE_SELECTION_INFO,   CsrGetConsoleSelectionInfo),
-    CSRSS_DEFINE_API(GET_COMMAND_HISTORY_LENGTH,   CsrGetCommandHistoryLength),
-    CSRSS_DEFINE_API(GET_COMMAND_HISTORY,          CsrGetCommandHistory),
-    CSRSS_DEFINE_API(EXPUNGE_COMMAND_HISTORY,      CsrExpungeCommandHistory),
-    CSRSS_DEFINE_API(SET_HISTORY_NUMBER_COMMANDS,  CsrSetHistoryNumberCommands),
-    CSRSS_DEFINE_API(GET_HISTORY_INFO,             CsrGetHistoryInfo),
-    CSRSS_DEFINE_API(SET_HISTORY_INFO,             CsrSetHistoryInfo),
-    { 0, 0, NULL }
-};
-*/
-
 
 /* FUNCTIONS ******************************************************************/
 
@@ -356,9 +257,9 @@ PrivateCsrssManualGuiCheck(LONG Check)
     NtUserCallOneParam(Check, ONEPARAM_ROUTINE_CSRSS_GUICHECK);
 }
 
+/*** HACK from win32csr... ***/
 static HHOOK hhk = NULL;
 
-/*** HACK from win32csr... ***/
 LRESULT
 CALLBACK
 KeyboardHookProc(int nCode,
@@ -428,7 +329,7 @@ CSR_SERVER_DLL_INIT(UserServerDllInitialization)
     // LoadedServerDll->NewProcessCallback = Win32CsrDuplicateHandleTable;
     LoadedServerDll->HardErrorCallback = Win32CsrHardError;
 
-/*** From win32csr... ***/
+/*** From win32csr... See r54125 ***/
     /* Start the Raw Input Thread and the Desktop Thread */
     for (i = 0; i < 2; ++i)
     {
index e536afd..2dca470 100644 (file)
@@ -18,7 +18,7 @@
 /* GLOBALS *******************************************************************/
 
 static BOOLEAN ServicesProcessIdValid = FALSE;
-static ULONG_PTR ServicesProcessId;
+static ULONG_PTR ServicesProcessId = 0;
 
 
 /* FUNCTIONS *****************************************************************/
@@ -34,7 +34,7 @@ CSR_API(SrvRegisterServicesProcess)
     }
     else
     {
-        ServicesProcessId = (ULONG_PTR)RegisterServicesProcessRequest->ProcessId;
+        ServicesProcessId = RegisterServicesProcessRequest->ProcessId;
         ServicesProcessIdValid = TRUE;
         return STATUS_SUCCESS;
     }
index 8416a78..a7934cd 100644 (file)
@@ -16,7 +16,7 @@
 
 
 static HWND LogonNotifyWindow = NULL;
-static HANDLE LogonProcess = NULL;
+static ULONG_PTR LogonProcessId = 0;
 
 
 /* FUNCTIONS *****************************************************************/
@@ -36,21 +36,21 @@ CSR_API(SrvRegisterLogonProcess)
 
     if (RegisterLogonProcessRequest->Register)
     {
-        if (0 != LogonProcess)
-        {
+        if (LogonProcessId != 0)
             return STATUS_LOGON_SESSION_EXISTS;
-        }
-        LogonProcess = RegisterLogonProcessRequest->ProcessId;
+
+        LogonProcessId = RegisterLogonProcessRequest->ProcessId;
     }
     else
     {
-        if (ApiMessage->Header.ClientId.UniqueProcess != LogonProcess)
+        if (ApiMessage->Header.ClientId.UniqueProcess != (HANDLE)LogonProcessId)
         {
             DPRINT1("Current logon process 0x%x, can't deregister from process 0x%x\n",
-                    LogonProcess, ApiMessage->Header.ClientId.UniqueProcess);
+                    LogonProcessId, ApiMessage->Header.ClientId.UniqueProcess);
             return STATUS_NOT_LOGON_PROCESS;
         }
-        LogonProcess = 0;
+
+        LogonProcessId = 0;
     }
 
     return STATUS_SUCCESS;
@@ -67,7 +67,7 @@ CSR_API(CsrSetLogonNotifyWindow)
         DPRINT1("Can't get window creator\n");
         return STATUS_INVALID_HANDLE;
     }
-    if (WindowCreator != (DWORD_PTR)LogonProcess)
+    if (WindowCreator != LogonProcessId)
     {
         DPRINT1("Trying to register window not created by winlogon as notify window\n");
         return STATUS_ACCESS_DENIED;
@@ -487,6 +487,7 @@ DtbgIsDesktopVisible(VOID)
 }
 
 /* TODO: Find another way to do it. */
+#if 0
 VOID FASTCALL
 ConioConsoleCtrlEventTimeout(DWORD Event, PCSR_PROCESS ProcessData, DWORD Timeout)
 {
@@ -509,6 +510,7 @@ ConioConsoleCtrlEventTimeout(DWORD Event, PCSR_PROCESS ProcessData, DWORD Timeou
         CloseHandle(Thread);
     }
 }
+#endif
 /************************************************/
 
 static BOOL FASTCALL
@@ -524,12 +526,15 @@ NotifyAndTerminateProcess(PCSR_PROCESS ProcessData,
 
     if (0 == (Flags & EWX_FORCE))
     {
+        // TODO: Find in an other way whether or not the process has a console.
+#if 0
         if (NULL != ProcessData->Console)
         {
             ConioConsoleCtrlEventTimeout(CTRL_LOGOFF_EVENT, ProcessData,
                                          ShutdownSettings->WaitToKillAppTimeout);
         }
         else
+#endif
         {
             Context.ProcessId = (DWORD_PTR) ProcessData->ClientId.UniqueProcess;
             Context.wParam = 0;
@@ -612,7 +617,7 @@ ExitReactosProcessEnum(PCSR_PROCESS ProcessData, PVOID Data)
 
     /* Do not kill winlogon or csrss */
     if ((DWORD_PTR) ProcessData->ClientId.UniqueProcess == Context->CsrssProcess ||
-            ProcessData->ClientId.UniqueProcess == LogonProcess)
+            ProcessData->ClientId.UniqueProcess == LogonProcessId)
     {
         return STATUS_SUCCESS;
     }
@@ -819,7 +824,7 @@ InternalExitReactos(DWORD ProcessId, DWORD ThreadId, UINT Flags)
     TOKEN_USER *UserInfo;
     SHUTDOWN_SETTINGS ShutdownSettings;
 
-    if (ProcessId != (DWORD_PTR) LogonProcess)
+    if (ProcessId != (DWORD_PTR) LogonProcessId)
     {
         DPRINT1("Internal ExitWindowsEx call not from winlogon\n");
         return STATUS_ACCESS_DENIED;