https://git.reactos.org/?p=reactos.git;a=commitdiff;h=b03d2b4d65477bce8d4123d15d2d750375e7f460

commit b03d2b4d65477bce8d4123d15d2d750375e7f460
Author:     Eric Kohl <[email protected]>
AuthorDate: Sun Aug 4 20:58:12 2019 +0200
Commit:     Eric Kohl <[email protected]>
CommitDate: Sun Aug 4 20:58:12 2019 +0200

    [SERVICES] Do not try to start lsass.exe as a service.
    
    Starting the security services (samss, netlogon, etc) requires special code 
in services.exe and lsasrv.dll.
---
 base/system/services/database.c | 32 ++++++++++++++++++++------------
 1 file changed, 20 insertions(+), 12 deletions(-)

diff --git a/base/system/services/database.c b/base/system/services/database.c
index 11e0d0d676b..460b74886a5 100644
--- a/base/system/services/database.c
+++ b/base/system/services/database.c
@@ -1852,18 +1852,26 @@ ScmStartUserModeService(PSERVICE Service,
             StartupInfo.lpDesktop = L"WinSta0\\Default";
         }
 
-        Result = CreateProcessW(NULL,
-                                Service->lpImage->pszImagePath,
-                                NULL,
-                                NULL,
-                                FALSE,
-                                CREATE_UNICODE_ENVIRONMENT | DETACHED_PROCESS 
| CREATE_SUSPENDED,
-                                lpEnvironment,
-                                NULL,
-                                &StartupInfo,
-                                &ProcessInformation);
-        if (!Result)
-            dwError = GetLastError();
+        if (wcsstr(Service->lpImage->pszImagePath, L"\\system32\\lsass.exe") 
== NULL)
+        {
+            Result = CreateProcessW(NULL,
+                                    Service->lpImage->pszImagePath,
+                                    NULL,
+                                    NULL,
+                                    FALSE,
+                                    CREATE_UNICODE_ENVIRONMENT | 
DETACHED_PROCESS | CREATE_SUSPENDED,
+                                    lpEnvironment,
+                                    NULL,
+                                    &StartupInfo,
+                                    &ProcessInformation);
+            if (!Result)
+                dwError = GetLastError();
+        }
+        else
+        {
+            Result = TRUE;
+            dwError = ERROR_SUCCESS;
+        }
     }
 
     if (lpEnvironment)

Reply via email to