diff --git a/reactos/win32ss/user/user32/CMakeLists.txt b/reactos/win32ss/user/user32/CMakeLists.txt index 7178a825639..872355cd0e9 100644 --- a/reactos/win32ss/user/user32/CMakeLists.txt +++ b/reactos/win32ss/user/user32/CMakeLists.txt @@ -25,6 +25,7 @@ list(APPEND SOURCE misc/exit.c misc/exticon.c misc/imm.c + misc/logon.c misc/misc.c misc/object.c misc/resources.c diff --git a/reactos/win32ss/user/user32/misc/exit.c b/reactos/win32ss/user/user32/misc/exit.c index fcc2f9ed6c6..d87d6f628f3 100644 --- a/reactos/win32ss/user/user32/misc/exit.c +++ b/reactos/win32ss/user/user32/misc/exit.c @@ -40,7 +40,7 @@ * - This ends the processing for the first ExitWindowsEx() call from WinLogon. * Execution continues in WinLogon, which calls ExitWindowsEx() again to * terminate COM processes in the interactive user's session. - * - WinLogon stops impersonating the interactive user (whos processes are + * - WinLogon stops impersonating the interactive user (whose processes are * all dead by now). and enters log-out state * - If the ExitWindowsEx() request was for a logoff, WinLogon sends a SAS * event (to display the "press ctrl+alt+del") to the GINA. WinLogon then @@ -86,29 +86,4 @@ ExitWindowsEx(UINT uFlags, return TRUE; } - -/* - * @implemented - */ -BOOL WINAPI -RegisterServicesProcess(DWORD ServicesProcessId) -{ - NTSTATUS Status; - USER_API_MESSAGE ApiMessage; - - ApiMessage.Data.RegisterServicesProcessRequest.ProcessId = ServicesProcessId; - - Status = CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage, - NULL, - CSR_CREATE_API_NUMBER(USERSRV_SERVERDLL_INDEX, UserpRegisterServicesProcess), - sizeof(USER_REGISTER_SERVICES_PROCESS)); - if (!NT_SUCCESS(Status)) - { - SetLastError(RtlNtStatusToDosError(Status)); - return FALSE; - } - - return TRUE; -} - /* EOF */ diff --git a/reactos/win32ss/user/user32/misc/logon.c b/reactos/win32ss/user/user32/misc/logon.c new file mode 100644 index 00000000000..7a9ab61b705 --- /dev/null +++ b/reactos/win32ss/user/user32/misc/logon.c @@ -0,0 +1,95 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS user32.dll + * FILE: lib/user32/misc/logon.c + * PURPOSE: Logon functions + * PROGRAMMER: Thomas Weidenmueller (w3seek@users.sourceforge.net) + */ + +/* INCLUDES ******************************************************************/ + +#include + +#include + +WINE_DEFAULT_DEBUG_CHANNEL(user32); + +/* FUNCTIONS *****************************************************************/ + +/* + * @implemented + */ +BOOL +WINAPI +RegisterServicesProcess(DWORD ServicesProcessId) +{ + USER_API_MESSAGE ApiMessage; + PUSER_REGISTER_SERVICES_PROCESS RegisterServicesProcessRequest = &ApiMessage.Data.RegisterServicesProcessRequest; + + RegisterServicesProcessRequest->ProcessId = ServicesProcessId; + + CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage, + NULL, + CSR_CREATE_API_NUMBER(USERSRV_SERVERDLL_INDEX, UserpRegisterServicesProcess), + sizeof(*RegisterServicesProcessRequest)); + if (!NT_SUCCESS(ApiMessage.Status)) + { + UserSetLastNTError(ApiMessage.Status); + return FALSE; + } + + return TRUE; +} + +/* + * @implemented + */ +BOOL +WINAPI +RegisterLogonProcess(DWORD dwProcessId, + BOOL bRegister) +{ + gfLogonProcess = NtUserxRegisterLogonProcess(dwProcessId, bRegister); + + if (gfLogonProcess) + { + USER_API_MESSAGE ApiMessage; + PUSER_REGISTER_LOGON_PROCESS RegisterLogonProcessRequest = &ApiMessage.Data.RegisterLogonProcessRequest; + + RegisterLogonProcessRequest->ProcessId = dwProcessId; + RegisterLogonProcessRequest->Register = bRegister; + + CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage, + NULL, + CSR_CREATE_API_NUMBER(USERSRV_SERVERDLL_INDEX, UserpRegisterLogonProcess), + sizeof(*RegisterLogonProcessRequest)); + if (!NT_SUCCESS(ApiMessage.Status)) + { + ERR("Failed to register logon process with CSRSS\n"); + UserSetLastNTError(ApiMessage.Status); + } + } + + return gfLogonProcess; +} + +/* + * @implemented + */ +BOOL +WINAPI +SetLogonNotifyWindow(HWND Wnd, HWINSTA WinSta) +{ + return NtUserSetLogonNotifyWindow(Wnd); +} + +/* + * @implemented + */ +BOOL +WINAPI +UpdatePerUserSystemParameters(DWORD dwReserved, + BOOL bEnable) +{ + return NtUserUpdatePerUserSystemParameters(dwReserved, bEnable); +} diff --git a/reactos/win32ss/user/user32/misc/misc.c b/reactos/win32ss/user/user32/misc/misc.c index db902eb0160..db9757b989c 100644 --- a/reactos/win32ss/user/user32/misc/misc.c +++ b/reactos/win32ss/user/user32/misc/misc.c @@ -40,59 +40,6 @@ UserSetLastNTError(IN NTSTATUS Status) } -/* - * @implemented - */ -BOOL -WINAPI -RegisterLogonProcess(DWORD dwProcessId, BOOL 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(USER_REGISTER_LOGON_PROCESS)); - if (!NT_SUCCESS(Status)) - { - ERR("Failed to register logon process with CSRSS\n"); - SetLastError(RtlNtStatusToDosError(Status)); - // return FALSE; - } - } - - return gfLogonProcess; -} - -/* - * @implemented - */ -BOOL -WINAPI -SetLogonNotifyWindow(HWND Wnd, HWINSTA WinSta) -{ - return NtUserSetLogonNotifyWindow(Wnd); -} - -/* - * @implemented - */ -BOOL WINAPI -UpdatePerUserSystemParameters( - DWORD dwReserved, - BOOL bEnable) -{ - return NtUserUpdatePerUserSystemParameters(dwReserved, bEnable); -} - PTHREADINFO GetW32ThreadInfo(VOID) {