Author: hbelusca
Date: Fri Nov 2 11:23:26 2012
New Revision: 57664
URL:
http://svn.reactos.org/svn/reactos?rev=57664&view=rev
Log:
[WIN32K/USER32/WINSRV]
- 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.
Modified:
branches/ros-csrss/include/reactos/subsys/win/winmsg.h
branches/ros-csrss/win32ss/user/ntuser/csr.c
branches/ros-csrss/win32ss/user/ntuser/csr.h
branches/ros-csrss/win32ss/user/ntuser/simplecall.c
branches/ros-csrss/win32ss/user/user32/include/user32p.h
branches/ros-csrss/win32ss/user/user32/misc/dllmain.c
branches/ros-csrss/win32ss/user/user32/misc/exit.c
branches/ros-csrss/win32ss/user/user32/misc/misc.c
branches/ros-csrss/win32ss/user/winsrv/init.c
branches/ros-csrss/win32ss/user/winsrv/server.c
branches/ros-csrss/win32ss/user/winsrv/shutdown.c
Modified: branches/ros-csrss/include/reactos/subsys/win/winmsg.h
URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/include/reactos/subsy…
==============================================================================
--- branches/ros-csrss/include/reactos/subsys/win/winmsg.h [iso-8859-1] (original)
+++ branches/ros-csrss/include/reactos/subsys/win/winmsg.h [iso-8859-1] Fri Nov 2
11:23:26 2012
@@ -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
{
- 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;
Modified: branches/ros-csrss/win32ss/user/ntuser/csr.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/win32ss/user/ntuser/c…
==============================================================================
--- branches/ros-csrss/win32ss/user/ntuser/csr.c [iso-8859-1] (original)
+++ branches/ros-csrss/win32ss/user/ntuser/csr.c [iso-8859-1] Fri Nov 2 11:23:26 2012
@@ -7,6 +7,7 @@
*/
#include <win32k.h>
+DBG_DEFAULT_CHANNEL(UserMisc);
static HANDLE WindowsApiPort = NULL;
PEPROCESS CsrProcess = NULL;
@@ -19,12 +20,17 @@
ULONG ConnectInfoLength;
SECURITY_QUALITY_OF_SERVICE Qos;
+ ERR("CsrInit\n");
+
RtlInitUnicodeString(&PortName, L"\\Windows\\ApiPort");
ConnectInfoLength = 0;
Qos.Length = sizeof(Qos);
Qos.ImpersonationLevel = SecurityDelegation;
Qos.ContextTrackingMode = SECURITY_STATIC_TRACKING;
Qos.EffectiveOnly = FALSE;
+
+ CsrProcess = PsGetCurrentProcess();
+ ERR("CsrInit - CsrProcess = 0x%p\n", CsrProcess);
Status = ZwConnectPort(&WindowsApiPort,
&PortName,
@@ -36,61 +42,11 @@
&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 */
Modified: branches/ros-csrss/win32ss/user/ntuser/csr.h
URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/win32ss/user/ntuser/c…
==============================================================================
--- branches/ros-csrss/win32ss/user/ntuser/csr.h [iso-8859-1] (original)
+++ branches/ros-csrss/win32ss/user/ntuser/csr.h [iso-8859-1] Fri Nov 2 11:23:26 2012
@@ -12,11 +12,5 @@
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 */
Modified: branches/ros-csrss/win32ss/user/ntuser/simplecall.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/win32ss/user/ntuser/s…
==============================================================================
--- branches/ros-csrss/win32ss/user/ntuser/simplecall.c [iso-8859-1] (original)
+++ branches/ros-csrss/win32ss/user/ntuser/simplecall.c [iso-8859-1] Fri Nov 2 11:23:26
2012
@@ -15,9 +15,8 @@
BOOL FASTCALL
co_IntRegisterLogonProcess(HANDLE ProcessId, BOOL Register)
{
+ NTSTATUS Status;
PEPROCESS Process;
- NTSTATUS Status;
- USER_API_MESSAGE Request;
Status = PsLookupProcessByProcessId(ProcessId,
&Process);
@@ -51,18 +50,6 @@
}
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;
}
Modified: branches/ros-csrss/win32ss/user/user32/include/user32p.h
URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/win32ss/user/user32/i…
==============================================================================
--- branches/ros-csrss/win32ss/user/user32/include/user32p.h [iso-8859-1] (original)
+++ branches/ros-csrss/win32ss/user/user32/include/user32p.h [iso-8859-1] Fri Nov 2
11:23:26 2012
@@ -23,6 +23,7 @@
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;
Modified: branches/ros-csrss/win32ss/user/user32/misc/dllmain.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/win32ss/user/user32/m…
==============================================================================
--- branches/ros-csrss/win32ss/user/user32/misc/dllmain.c [iso-8859-1] (original)
+++ branches/ros-csrss/win32ss/user/user32/misc/dllmain.c [iso-8859-1] Fri Nov 2 11:23:26
2012
@@ -13,6 +13,7 @@
PUSER_HANDLE_ENTRY gHandleEntries = NULL;
PSERVERINFO gpsi = NULL;
ULONG_PTR g_ulSharedDelta;
+BOOLEAN gfLogonProcess = FALSE;
BOOLEAN gfServerProcess = FALSE;
WCHAR szAppInit[KEY_LENGTH];
Modified: branches/ros-csrss/win32ss/user/user32/misc/exit.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/win32ss/user/user32/m…
==============================================================================
--- branches/ros-csrss/win32ss/user/user32/misc/exit.c [iso-8859-1] (original)
+++ branches/ros-csrss/win32ss/user/user32/misc/exit.c [iso-8859-1] Fri Nov 2 11:23:26
2012
@@ -67,8 +67,8 @@
ExitWindowsEx(UINT uFlags,
DWORD dwReserved)
{
+ NTSTATUS Status;
USER_API_MESSAGE ApiMessage;
- NTSTATUS Status;
ApiMessage.Data.ExitReactosRequest.Flags = uFlags;
ApiMessage.Data.ExitReactosRequest.Reserved = dwReserved;
@@ -93,10 +93,10 @@
BOOL WINAPI
RegisterServicesProcess(DWORD ServicesProcessId)
{
+ NTSTATUS Status;
USER_API_MESSAGE ApiMessage;
- NTSTATUS Status;
- ApiMessage.Data.RegisterServicesProcessRequest.ProcessId =
UlongToHandle(ServicesProcessId);
+ ApiMessage.Data.RegisterServicesProcessRequest.ProcessId = ServicesProcessId;
Status = CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage,
NULL,
Modified: branches/ros-csrss/win32ss/user/user32/misc/misc.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/win32ss/user/user32/m…
==============================================================================
--- branches/ros-csrss/win32ss/user/user32/misc/misc.c [iso-8859-1] (original)
+++ branches/ros-csrss/win32ss/user/user32/misc/misc.c [iso-8859-1] Fri Nov 2 11:23:26
2012
@@ -42,7 +42,29 @@
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 @@
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 @@
}
return NtUserSetLogonNotifyWindow(Wnd);
+#endif
+ return TRUE;
}
/*
Modified: branches/ros-csrss/win32ss/user/winsrv/init.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/win32ss/user/winsrv/i…
==============================================================================
--- branches/ros-csrss/win32ss/user/winsrv/init.c [iso-8859-1] (original)
+++ branches/ros-csrss/win32ss/user/winsrv/init.c [iso-8859-1] Fri Nov 2 11:23:26 2012
@@ -79,105 +79,6 @@
// 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 @@
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 @@
// 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)
{
Modified: branches/ros-csrss/win32ss/user/winsrv/server.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/win32ss/user/winsrv/s…
==============================================================================
--- branches/ros-csrss/win32ss/user/winsrv/server.c [iso-8859-1] (original)
+++ branches/ros-csrss/win32ss/user/winsrv/server.c [iso-8859-1] Fri Nov 2 11:23:26 2012
@@ -18,7 +18,7 @@
/* GLOBALS *******************************************************************/
static BOOLEAN ServicesProcessIdValid = FALSE;
-static ULONG_PTR ServicesProcessId;
+static ULONG_PTR ServicesProcessId = 0;
/* FUNCTIONS *****************************************************************/
@@ -34,7 +34,7 @@
}
else
{
- ServicesProcessId = (ULONG_PTR)RegisterServicesProcessRequest->ProcessId;
+ ServicesProcessId = RegisterServicesProcessRequest->ProcessId;
ServicesProcessIdValid = TRUE;
return STATUS_SUCCESS;
}
Modified: branches/ros-csrss/win32ss/user/winsrv/shutdown.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/win32ss/user/winsrv/s…
==============================================================================
--- branches/ros-csrss/win32ss/user/winsrv/shutdown.c [iso-8859-1] (original)
+++ branches/ros-csrss/win32ss/user/winsrv/shutdown.c [iso-8859-1] Fri Nov 2 11:23:26
2012
@@ -16,7 +16,7 @@
static HWND LogonNotifyWindow = NULL;
-static HANDLE LogonProcess = NULL;
+static ULONG_PTR LogonProcessId = 0;
/* FUNCTIONS *****************************************************************/
@@ -36,21 +36,21 @@
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 @@
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 @@
}
/* TODO: Find another way to do it. */
+#if 0
VOID FASTCALL
ConioConsoleCtrlEventTimeout(DWORD Event, PCSR_PROCESS ProcessData, DWORD Timeout)
{
@@ -509,6 +510,7 @@
CloseHandle(Thread);
}
}
+#endif
/************************************************/
static BOOL FASTCALL
@@ -524,12 +526,15 @@
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 @@
/* 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 @@
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;