/* * @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 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 */ HDESK WINAPI GetThreadDesktop( DWORD dwThreadId) { USER_API_MESSAGE ApiMessage; PUSER_GET_THREAD_CONSOLE_DESKTOP GetThreadConsoleDesktopRequest = &ApiMessage.Data.GetThreadConsoleDesktopRequest; GetThreadConsoleDesktopRequest->ThreadId = dwThreadId; CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage, NULL, CSR_CREATE_API_NUMBER(USERSRV_SERVERDLL_INDEX, UserpGetThreadConsoleDesktop), sizeof(*GetThreadConsoleDesktopRequest)); if (!NT_SUCCESS(ApiMessage.Status)) { UserSetLastNTError(ApiMessage.Status); return NULL; } return NtUserGetThreadDesktop(dwThreadId, (DWORD)GetThreadConsoleDesktopRequest->ConsoleDesktop); }