[LSASS] Initialize SAM before starting the security services
authorEric Kohl <eric.kohl@reactos.org>
Sat, 10 Aug 2019 12:36:10 +0000 (14:36 +0200)
committerEric Kohl <eric.kohl@reactos.org>
Sat, 10 Aug 2019 12:36:10 +0000 (14:36 +0200)
We need to initialize SAM before the security services get started, otherwise we will have a running SamSs service although SAM is not initialized at that time. This is no good.

base/system/lsass/lsass.c

index 9fffd8e..408dca6 100644 (file)
@@ -50,7 +50,7 @@ wWinMain(IN HINSTANCE hInstance,
     /* Make us critical */
     RtlSetProcessIsCritical(TRUE, NULL, TRUE);
 
-    /* Initialize the LSA server DLL. */
+    /* Initialize the LSA server DLL */
     Status = LsapInitLsa();
     if (!NT_SUCCESS(Status))
     {
@@ -58,19 +58,19 @@ wWinMain(IN HINSTANCE hInstance,
         goto ByeBye;
     }
 
-    /* Start the Netlogon service. */
-    Status = ServiceInit();
+    /* Initialize the SAM server DLL */
+    Status = SamIInitialize();
     if (!NT_SUCCESS(Status))
     {
-        DPRINT1("ServiceInit() failed (Status 0x%08lX)\n", Status);
+        DPRINT1("SamIInitialize() failed (Status 0x%08lX)\n", Status);
         goto ByeBye;
     }
 
-    /* Initialize the SAM server DLL. */
-    Status = SamIInitialize();
+    /* Start the security services */
+    Status = ServiceInit();
     if (!NT_SUCCESS(Status))
     {
-        DPRINT1("SamIInitialize() failed (Status 0x%08lX)\n", Status);
+        DPRINT1("ServiceInit() failed (Status 0x%08lX)\n", Status);
         goto ByeBye;
     }