[USERSRV]: Stubplement all the APIs needed for Windows kernel32.
[reactos.git] / reactos / win32ss / user / winsrv / usersrv / init.c
index 0cf5288..7749d74 100644 (file)
@@ -26,15 +26,15 @@ HANDLE UserServerHeap = NULL;   // Our own heap.
 PCSR_API_ROUTINE UserServerApiDispatchTable[UserpMaxApiNumber - USERSRV_FIRST_API_NUMBER] =
 {
     SrvExitWindowsEx,
-    // SrvEndTask,
-    // SrvLogon,
+    SrvEndTask,
+    SrvLogon,
     SrvRegisterServicesProcess, // Not present in Win7
-    // SrvActivateDebugger,
-    // SrvGetThreadConsoleDesktop, // Not present in Win7
-    // SrvDeviceEvent,
+    SrvActivateDebugger,
+    SrvGetThreadConsoleDesktop, // Not present in Win7
+    SrvDeviceEvent,
     SrvRegisterLogonProcess,    // Not present in Win7
-    // SrvCreateSystemThreads,
-    // SrvRecordShutdownReason,
+    SrvCreateSystemThreads,
+    SrvRecordShutdownReason,
     // SrvCancelShutdown,              // Added in Vista
     // SrvConsoleHandleOperation,      // Added in Win7
     // SrvGetSetShutdownBlockReason,   // Added in Vista
@@ -43,15 +43,15 @@ PCSR_API_ROUTINE UserServerApiDispatchTable[UserpMaxApiNumber - USERSRV_FIRST_AP
 BOOLEAN UserServerApiServerValidTable[UserpMaxApiNumber - USERSRV_FIRST_API_NUMBER] =
 {
     FALSE,   // SrvExitWindowsEx
-    // FALSE,   // SrvEndTask
-    // FALSE,   // SrvLogon
+    FALSE,   // SrvEndTask
+    FALSE,   // SrvLogon
     FALSE,   // SrvRegisterServicesProcess
-    // FALSE,   // SrvActivateDebugger
-    // TRUE,    // SrvGetThreadConsoleDesktop
-    // FALSE,   // SrvDeviceEvent
+    FALSE,   // SrvActivateDebugger
+    TRUE,    // SrvGetThreadConsoleDesktop
+    FALSE,   // SrvDeviceEvent
     FALSE,   // SrvRegisterLogonProcess
-    // FALSE,   // SrvCreateSystemThreads
-    // FALSE,   // SrvRecordShutdownReason
+    FALSE,   // SrvCreateSystemThreads
+    FALSE,   // SrvRecordShutdownReason
     // FALSE,   // SrvCancelShutdown
     // FALSE,   // SrvConsoleHandleOperation
     // FALSE,   // SrvGetSetShutdownBlockReason
@@ -60,15 +60,15 @@ BOOLEAN UserServerApiServerValidTable[UserpMaxApiNumber - USERSRV_FIRST_API_NUMB
 PCHAR UserServerApiNameTable[UserpMaxApiNumber - USERSRV_FIRST_API_NUMBER] =
 {
     "SrvExitWindowsEx",
-    // "SrvEndTask",
-    // "SrvLogon",
+    "SrvEndTask",
+    "SrvLogon",
     "SrvRegisterServicesProcess",
-    // "SrvActivateDebugger",
-    // "SrvGetThreadConsoleDesktop",
-    // "SrvDeviceEvent",
+    "SrvActivateDebugger",
+    "SrvGetThreadConsoleDesktop",
+    "SrvDeviceEvent",
     "SrvRegisterLogonProcess",
-    // "SrvCreateSystemThreads",
-    // "SrvRecordShutdownReason",
+    "SrvCreateSystemThreads",
+    "SrvRecordShutdownReason",
     // "SrvCancelShutdown",
     // "SrvConsoleHandleOperation",
     // "SrvGetSetShutdownBlockReason",
@@ -236,8 +236,8 @@ PrivateCsrssManualGuiCheck(LONG Check)
     NtUserCallOneParam(Check, ONEPARAM_ROUTINE_CSRSS_GUICHECK);
 }
 
-DWORD
-WINAPI
+ULONG
+NTAPI
 CreateSystemThreads(PVOID pParam)
 {
     NtUserCallOneParam((DWORD)pParam, ONEPARAM_ROUTINE_CREATESYSTEMTHREADS);
@@ -245,6 +245,30 @@ CreateSystemThreads(PVOID pParam)
     return 0;
 }
 
+CSR_API(SrvCreateSystemThreads)
+{
+    DPRINT1("%s not yet implemented\n", __FUNCTION__);
+    return STATUS_NOT_IMPLEMENTED;
+}
+
+CSR_API(SrvActivateDebugger)
+{
+    DPRINT1("%s not yet implemented\n", __FUNCTION__);
+    return STATUS_NOT_IMPLEMENTED;
+}
+
+CSR_API(SrvGetThreadConsoleDesktop)
+{
+    DPRINT1("%s not yet implemented\n", __FUNCTION__);
+    return STATUS_NOT_IMPLEMENTED;
+}
+
+CSR_API(SrvDeviceEvent)
+{
+    DPRINT1("%s not yet implemented\n", __FUNCTION__);
+    return STATUS_NOT_IMPLEMENTED;
+}
+
 CSR_SERVER_DLL_INIT(UserServerDllInitialization)
 {
 /*** From win32csr... ***/
@@ -280,7 +304,10 @@ CSR_SERVER_DLL_INIT(UserServerDllInitialization)
     /* Start the Raw Input Thread and the Desktop Thread */
     for (i = 0; i < 2; ++i)
     {
-        Status = RtlCreateUserThread(NtCurrentProcess(), NULL, TRUE, 0, 0, 0, (PTHREAD_START_ROUTINE)CreateSystemThreads, (PVOID)i, &ServerThread, &ClientId);
+        Status = RtlCreateUserThread(NtCurrentProcess(),
+                                     NULL, TRUE, 0, 0, 0,
+                                     CreateSystemThreads,
+                                     (PVOID)i, &ServerThread, &ClientId);
         if (NT_SUCCESS(Status))
         {
             NtResumeThread(ServerThread, NULL);