CreateSystemThreads(PVOID pParam)
{
NtUserCallOneParam((DWORD)pParam, ONEPARAM_ROUTINE_CREATESYSTEMTHREADS);
- DPRINT1("This thread should not terminate!\n");
+ RtlExitUserThread(0);
return 0;
}
return STATUS_NOT_IMPLEMENTED;
}
+CSR_API(SrvLogon)
+{
+ PUSER_LOGON LogonRequest = &((PUSER_API_MESSAGE)ApiMessage)->Data.LogonRequest;
+
+ DPRINT1("We are logged %s\n", LogonRequest->IsLogon ? "on" : "off");
+
+ /* Impersonate the caller in order to retrieve settings in its context */
+ if (!CsrImpersonateClient(NULL))
+ return STATUS_UNSUCCESSFUL;
+
+ GetTimeouts(&ShutdownSettings);
+
+ /* We are done */
+ CsrRevertToSelf();
+ return STATUS_SUCCESS;
+}
+
NTSTATUS
NTAPI
UserClientConnect(IN PCSR_PROCESS CsrProcess,
// PUSERCONNECT
PUSERSRV_API_CONNECTINFO ConnectInfo = (PUSERSRV_API_CONNECTINFO)ConnectionInfo;
- DPRINT1("UserClientConnect\n");
+ DPRINT("UserClientConnect\n");
/* Check if we don't have an API port yet */
if (CsrApiPort == NULL)
CSR_SERVER_DLL_INIT(UserServerDllInitialization)
{
-/*** From win32csr... ***/
- HANDLE ServerThread;
- CLIENT_ID ClientId;
NTSTATUS Status;
- UINT i;
-/*** END - From win32csr... ***/
/* Initialize the memory */
UserServerHeap = RtlGetProcessHeap();
UserServerDllInstance = LoadedServerDll->ServerHandle;
-/*** From win32csr... See r54125 ***/
- /* Start the Raw Input Thread and the Desktop Thread */
- for (i = 0; i < 2; ++i)
- {
- Status = RtlCreateUserThread(NtCurrentProcess(),
- NULL, TRUE, 0, 0, 0,
- CreateSystemThreads,
- (PVOID)i, &ServerThread, &ClientId);
- if (NT_SUCCESS(Status))
- {
- NtResumeThread(ServerThread, NULL);
- NtClose(ServerThread);
- }
- else
- {
- DPRINT1("Cannot start Raw Input Thread!\n");
- }
- }
-/*** END - From win32csr... ***/
-
/* Create the power request event */
Status = NtCreateEvent(&ghPowerRequestEvent,
EVENT_ALL_ACCESS,
return Status;
}
+ /* Set the process creation notify routine for BASE */
+ BaseSetProcessCreateNotify(NtUserNotifyProcessCreate);
+
/* Initialize the kernel mode subsystem */
Status = NtUserInitialize(USER_VERSION,
ghPowerRequestEvent,
return Status;
}
+/*** From win32csr... See r54125 ***/
+ {
+ HANDLE ServerThread;
+ CLIENT_ID ClientId;
+ UINT i;
+
+ /* Start the Raw Input Thread and the Desktop Thread */
+ for (i = 0; i < 2; ++i)
+ {
+ Status = RtlCreateUserThread(NtCurrentProcess(),
+ NULL, TRUE, 0, 0, 0,
+ CreateSystemThreads,
+ (PVOID)i, &ServerThread, &ClientId);
+ if (NT_SUCCESS(Status))
+ {
+ NtResumeThread(ServerThread, NULL);
+ NtClose(ServerThread);
+ }
+ else
+ {
+ DPRINT1("Cannot start Raw Input Thread!\n");
+ }
+ }
+ }
+/*** END - From win32csr... ***/
+
/* All done */
return STATUS_SUCCESS;
}