[CSRSRV]
authorHermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
Tue, 20 Nov 2012 19:34:03 +0000 (19:34 +0000)
committerHermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
Tue, 20 Nov 2012 19:34:03 +0000 (19:34 +0000)
- Remove unused functions CallHardError and CsrHandleHardError (in fact calling the hard error callback is already done in the listening thread).
- Add an annotation and correct a typographical error; remove old comments.
- Remove the now unneeded csrplugin.h header (a relic of the old callback system of the old csrss/csrsrv).

svn path=/branches/ros-csrss/; revision=57741

subsystems/win32/csrsrv/api.c
subsystems/win32/csrsrv/include/csrplugin.h [deleted file]
subsystems/win32/csrsrv/init.c
subsystems/win32/csrsrv/procsup.c
subsystems/win32/csrsrv/wait.c

index 854a26e..0f4c60c 100644 (file)
@@ -24,24 +24,6 @@ extern ULONG CsrMaxApiRequestThreads;
 
 /* FUNCTIONS ******************************************************************/
 
 
 /* FUNCTIONS ******************************************************************/
 
-VOID
-CallHardError(IN PCSR_THREAD ThreadData,
-              IN PHARDERROR_MSG HardErrorMessage);
-
-#if 0
-static
-VOID
-NTAPI
-CsrHandleHardError(IN PCSR_THREAD ThreadData,
-                   IN OUT PHARDERROR_MSG Message)
-{
-    DPRINT1("CSR: received hard error %lx\n", Message->Status);
-
-    /* Call the hard error handler in win32csr */
-    CallHardError(ThreadData, Message);
-}
-#endif
-
 /*++
  * @name CsrCallServerFromServer
  * @implemented NT4
 /*++
  * @name CsrCallServerFromServer
  * @implemented NT4
@@ -626,7 +608,7 @@ CsrApiRequestThread(IN PVOID Parameter)
                         if ((ServerDll) && (ServerDll->HardErrorCallback))
                         {
                             /* Call it */
                         if ((ServerDll) && (ServerDll->HardErrorCallback))
                         {
                             /* Call it */
-                            ServerDll->HardErrorCallback(NULL /* CsrThread */, HardErrorMsg);
+                            ServerDll->HardErrorCallback(NULL /* CsrThread == NULL */, HardErrorMsg);
 
                             /* If it's handled, get out of here */
                             if (HardErrorMsg->Response != ResponseNotHandled) break;
 
                             /* If it's handled, get out of here */
                             if (HardErrorMsg->Response != ResponseNotHandled) break;
@@ -1141,7 +1123,7 @@ CsrConnectToUser(VOID)
                                  &hUser32);
         RtlFreeUnicodeString(&TempName);
 
                                  &hUser32);
         RtlFreeUnicodeString(&TempName);
 
-        /* If we got teh handle, get the Client Thread Startup Entrypoint */
+        /* If we got the handle, get the Client Thread Startup Entrypoint */
         if (NT_SUCCESS(Status))
         {
             RtlInitAnsiString(&StartupName,"ClientThreadSetup");
         if (NT_SUCCESS(Status))
         {
             RtlInitAnsiString(&StartupName,"ClientThreadSetup");
diff --git a/subsystems/win32/csrsrv/include/csrplugin.h b/subsystems/win32/csrsrv/include/csrplugin.h
deleted file mode 100644 (file)
index 6b0ed95..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * COPYRIGHT:       See COPYING in the top level directory
- * PROJECT:         ReactOS system libraries
- * FILE:            subsys/csrss/include/csrplugin.h
- * PURPOSE:         CSRSS plugin interface
- */
-
-/*
- * CSRSS is a native application and can only implicitly link against native
- * DLLs. Since e.g. user32.dll and gdi32.dll are win32 DLLs and not native
- * DLLs it is not possible to call functions in those DLLs directly from
- * CSRSS.
- * However, it is possible to explicitly load a non-native DLL. Such a DLL
- * can then in turn be implicitly linked against other DLLs in its own
- * subsystem.
- */
-
-#pragma once
-
-#include <windows.h>
-
-#include <csr/csr.h>
-//#include "api.h"
-
-/*
-typedef NTSTATUS (WINAPI *CSRSS_ENUM_PROCESSES_PROC)(CSRSS_ENUM_PROCESS_PROC EnumProc,
-                                                     PVOID Context);
-typedef NTSTATUS (WINAPI *CSRSS_ENUM_PROCESS_PROC)(PCSR_PROCESS ProcessData,
-                                                   PVOID Context);
-
-typedef struct tagCSRSS_EXPORTED_FUNCS
-{
-    CSRSS_ENUM_PROCESSES_PROC CsrEnumProcessesProc;
-} CSRSS_EXPORTED_FUNCS, *PCSRSS_EXPORTED_FUNCS;
-*/
-
-typedef BOOL (WINAPI *CSRPLUGIN_INIT_COMPLETE_PROC)(void);
-
-typedef VOID (WINAPI *CSRPLUGIN_HARDERROR_PROC)(IN PCSR_THREAD ThreadData,
-                                                IN PHARDERROR_MSG HardErrorMessage);
-
-typedef NTSTATUS (WINAPI *CSRPLUGIN_PROCESS_INHERIT_PROC)(IN PCSR_PROCESS SourceProcessData,
-                                                          IN PCSR_PROCESS TargetProcessData);
-
-typedef ULONG (WINAPI *CSRPLUGIN_PROCESS_DELETED_PROC)(IN PCSR_PROCESS ProcessData, IN ULONG Unused, IN BOOLEAN Flag);
-
-typedef struct tagCSRSS_SERVER_PROCS
-{
-    CSRPLUGIN_INIT_COMPLETE_PROC InitCompleteProc;
-    CSRPLUGIN_HARDERROR_PROC HardErrorProc;
-    CSRPLUGIN_PROCESS_INHERIT_PROC ProcessInheritProc;
-    CSRPLUGIN_PROCESS_DELETED_PROC ProcessDeletedProc;
-} CSRPLUGIN_SERVER_PROCS, *PCSRPLUGIN_SERVER_PROCS;
-
-typedef BOOL (WINAPI *CSRPLUGIN_INITIALIZE_PROC)(PCSRSS_API_DEFINITION *ApiDefinitions,
-                                                 PCSRPLUGIN_SERVER_PROCS ServerProcs);
-
-/* EOF */
index 6bda6ba..fa87898 100644 (file)
@@ -38,29 +38,6 @@ SYSTEM_BASIC_INFORMATION CsrNtSysInfo;
 
 /* PRIVATE FUNCTIONS **********************************************************/
 
 
 /* PRIVATE FUNCTIONS **********************************************************/
 
-VOID
-CallHardError(IN PCSR_THREAD ThreadData,
-              IN PHARDERROR_MSG HardErrorMessage)
-{
-    ULONG i;
-    PCSR_SERVER_DLL ServerDll;
-
-    DPRINT("CSR: %s called\n", __FUNCTION__);
-
-    /* Notify the Server DLLs */
-    for (i = 0; i < CSR_SERVER_DLL_MAX; i++)
-    {
-        /* Get the current Server DLL */
-        ServerDll = CsrLoadedServerDll[i];
-
-        /* Make sure it's valid and that it has callback */
-        if (ServerDll && ServerDll->HardErrorCallback)
-        {
-            ServerDll->HardErrorCallback(ThreadData, HardErrorMessage);
-        }
-    }
-}
-
 /* === INIT ROUTINES === */
 
 /*++
 /* === INIT ROUTINES === */
 
 /*++
index 052b79c..08c806a 100644 (file)
@@ -32,9 +32,9 @@ extern ULONG CsrTotalPerProcessDataLength;
 /* PRIVATE FUNCTIONS **********************************************************/
 
 /*++
 /* PRIVATE FUNCTIONS **********************************************************/
 
 /*++
- * @name CsrpSetToNormalPriority
+ * @name CsrSetToNormalPriority
  *
  *
- * The CsrpSetToNormalPriority routine sets the current NT Process'
+ * The CsrSetToNormalPriority routine sets the current NT Process'
  * priority to the normal priority for CSR Processes.
  *
  * @param None.
  * priority to the normal priority for CSR Processes.
  *
  * @param None.
@@ -47,7 +47,7 @@ extern ULONG CsrTotalPerProcessDataLength;
  *--*/
 VOID
 NTAPI
  *--*/
 VOID
 NTAPI
-CsrSetToNormalPriority(VOID) // CsrpSetToNormalPriority
+CsrSetToNormalPriority(VOID)
 {
     KPRIORITY BasePriority = (8 + 1) + 4;
 
 {
     KPRIORITY BasePriority = (8 + 1) + 4;
 
@@ -59,9 +59,9 @@ CsrSetToNormalPriority(VOID) // CsrpSetToNormalPriority
 }
 
 /*++
 }
 
 /*++
- * @name CsrpSetToShutdownPriority
+ * @name CsrSetToShutdownPriority
  *
  *
- * The CsrpSetToShutdownPriority routine sets the current NT Process'
+ * The CsrSetToShutdownPriority routine sets the current NT Process'
  * priority to the boosted priority for CSR Processes doing shutdown.
  * Additonally, it acquires the Shutdown Privilege required for shutdown.
  *
  * priority to the boosted priority for CSR Processes doing shutdown.
  * Additonally, it acquires the Shutdown Privilege required for shutdown.
  *
@@ -75,7 +75,7 @@ CsrSetToNormalPriority(VOID) // CsrpSetToNormalPriority
  *--*/
 VOID
 NTAPI
  *--*/
 VOID
 NTAPI
-CsrSetToShutdownPriority(VOID) // CsrpSetToShutdownPriority
+CsrSetToShutdownPriority(VOID)
 {
     KPRIORITY SetBasePriority = (8 + 1) + 6;
     BOOLEAN Old;
 {
     KPRIORITY SetBasePriority = (8 + 1) + 6;
     BOOLEAN Old;
@@ -1288,7 +1288,6 @@ CsrShutdownProcesses(IN PLUID CallerLuid,
     }
 
     /* Set shudown Priority */
     }
 
     /* Set shudown Priority */
-    // CsrpSetToShutdownPriority();
     CsrSetToShutdownPriority();
 
     /* Start looping */
     CsrSetToShutdownPriority();
 
     /* Start looping */
@@ -1365,7 +1364,6 @@ CsrShutdownProcesses(IN PLUID CallerLuid,
 
 Quickie:
     /* Return to normal priority */
 
 Quickie:
     /* Return to normal priority */
-    // CsrpSetToNormalPriority();
     CsrSetToNormalPriority();
 
     return Status;
     CsrSetToNormalPriority();
 
     return Status;
index 571bc24..6aabc03 100644 (file)
@@ -163,7 +163,7 @@ CsrNotifyWaitBlock(IN PCSR_WAIT_BLOCK WaitBlock,
                 RemoveEntryList(&WaitBlock->UserWaitList);
             }
 
                 RemoveEntryList(&WaitBlock->UserWaitList);
             }
 
-            /* Dereference teh thread */
+            /* Dereference the thread */
             CsrDereferenceThread(WaitBlock->WaitThread);
 
             /* Free the wait block */
             CsrDereferenceThread(WaitBlock->WaitThread);
 
             /* Free the wait block */