14#include "../consrv/api.h"
39 SrvRegisterServicesProcess,
41 SrvGetThreadConsoleDesktop,
43 SrvRegisterLogonProcess,
44 SrvCreateSystemThreads,
45 SrvRecordShutdownReason,
78 "SrvRegisterServicesProcess",
79 "SrvActivateDebugger",
80 "SrvGetThreadConsoleDesktop",
82 "SrvRegisterLogonProcess",
83 "SrvCreateSystemThreads",
84 "SrvRecordShutdownReason",
128 DPRINT1(
"Cannot start system thread!\n");
151 DPRINT1(
"GetThreadConsoleDesktop(%lu) failed with Status 0x%08x\n",
171 DPRINT1(
"We are logged %s\n", LogonRequest->
IsLogon ?
"on" :
"off");
194 DPRINT(
"UserClientConnect\n");
214 if ( ConnectionInfo ==
NULL ||
215 ConnectionInfoLength ==
NULL ||
216 *ConnectionInfoLength !=
sizeof(*ConnectInfo) )
218 DPRINT1(
"USERSRV: Connection failed - ConnectionInfo = 0x%p ; ConnectionInfoLength = 0x%p (%lu), expected %lu\n",
220 ConnectionInfoLength,
221 ConnectionInfoLength ? *ConnectionInfoLength : (
ULONG)-1,
222 sizeof(*ConnectInfo));
228 ConnectInfo->dwDispatchCount = 0;
231 *ConnectionInfoLength);
249 LoadedServerDll->NameTable = UserServerApiNameTable;
251 LoadedServerDll->SizeOfProcessData = 0;
253 LoadedServerDll->DisconnectCallback =
NULL;
267 DPRINT1(
"Power request event creation failed with Status 0x%08x\n",
Status);
279 DPRINT1(
"Media request event creation failed with Status 0x%08x\n",
Status);
295 DPRINT1(
"NtUserInitialize failed with Status 0x%08x\n",
Status);
VOID NTAPI BaseSetProcessCreateNotify(IN BASE_PROCESS_CREATE_NOTIFY_ROUTINE ProcessCreateNotifyProc)
HANDLE NTAPI CsrQueryApiPort(VOID)
BOOLEAN NTAPI CsrImpersonateClient(IN PCSR_THREAD CsrThread)
BOOLEAN NTAPI CsrRevertToSelf(VOID)
NTSTATUS(NTAPI * PCSR_API_ROUTINE)(IN OUT PCSR_API_MESSAGE ApiMessage, IN OUT PCSR_REPLY_CODE ReplyCode OPTIONAL)
#define CSR_SERVER_DLL_INIT(n)
NTSTATUS NTAPI CsrExecServerThread(IN PVOID ThreadHandler, IN ULONG Flags)
#define STATUS_NOT_IMPLEMENTED
#define NT_SUCCESS(StatCode)
VOID UserInitHardErrorsCache(VOID)
DWORD_PTR NTAPI NtUserCallOneParam(DWORD_PTR Param, DWORD Routine)
BOOL NTAPI NtUserNotifyProcessCreate(HANDLE NewProcessId, HANDLE ParentThreadId, ULONG dwUnknown, ULONG CreateFlags)
NTSTATUS NTAPI NtUserSetInformationThread(IN HANDLE ThreadHandle, IN USERTHREADINFOCLASS ThreadInformationClass, IN PVOID ThreadInformation, IN ULONG ThreadInformationLength)
NTSTATUS NTAPI NtUserProcessConnect(IN HANDLE ProcessHandle, OUT PUSERCONNECT pUserConnect, IN ULONG Size)
NTSTATUS NTAPI NtUserInitialize(DWORD dwWinVersion, HANDLE hPowerRequestEvent, HANDLE hMediaRequestEvent)
NTSYSAPI VOID NTAPI RtlExitUserThread(_In_ NTSTATUS Status)
NTSTATUS NTAPI NtCreateEvent(OUT PHANDLE EventHandle, IN ACCESS_MASK DesiredAccess, IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL, IN EVENT_TYPE EventType, IN BOOLEAN InitialState)
static PUSER_SOUND_SENTRY _UserSoundSentry
#define STATUS_INVALID_PARAMETER
#define STATUS_UNSUCCESSFUL
NTSTATUS NTAPI GetThreadConsoleDesktop(IN ULONG_PTR ThreadId, OUT HDESK *ConsoleDesktop)
VOID FASTCALL GetTimeouts(IN PSHUTDOWN_SETTINGS ShutdownSettings)
SHUTDOWN_SETTINGS ShutdownSettings
VOID NTAPI UserServerHardError(IN PCSR_THREAD ThreadData, IN PHARDERROR_MSG Message)
ULONG NTAPI UserClientShutdown(IN PCSR_PROCESS CsrProcess, IN ULONG Flags, IN BOOLEAN FirstPhase)
HANDLE ghMediaRequestEvent
BOOL CALLBACK FindTopLevelWnd(IN HWND hWnd, IN LPARAM lParam)
NTSTATUS NTAPI UserClientConnect(IN PCSR_PROCESS CsrProcess, IN OUT PVOID ConnectionInfo, IN OUT PULONG ConnectionInfoLength)
HANDLE ghPowerRequestEvent
HINSTANCE UserServerDllInstance
PCSR_API_ROUTINE UserServerApiDispatchTable[UserpMaxApiNumber - USERSRV_FIRST_API_NUMBER]
BOOLEAN UserServerApiServerValidTable[UserpMaxApiNumber - USERSRV_FIRST_API_NUMBER]
ULONG NTAPI CreateSystemThreads(PVOID pParam)
#define USERSRV_FIRST_API_NUMBER
struct _USER_API_MESSAGE * PUSER_API_MESSAGE
#define PUSERSRV_API_CONNECTINFO
HWND WINAPI GetWindow(_In_ HWND, _In_ UINT)
#define NtCurrentThread()