[SERVICES] Do not delete running services.
authorEric Kohl <eric.kohl@reactos.org>
Sat, 27 Jan 2018 23:57:58 +0000 (00:57 +0100)
committerEric Kohl <eric.kohl@reactos.org>
Sat, 27 Jan 2018 23:57:58 +0000 (00:57 +0100)
CORE-14260

base/system/services/rpcserver.c

index d2f032c..f1ce146 100644 (file)
@@ -992,7 +992,8 @@ RCloseServiceHandle(
         if (lpService->dwRefCount == 0)
         {
             /* If this service has been marked for deletion */
-            if (lpService->bDeleted)
+            if (lpService->bDeleted &&
+                lpService->Status.dwCurrentState == SERVICE_STOPPED)
             {
                 /* Open the Services Reg key */
                 dwError = RegOpenKeyExW(HKEY_LOCAL_MACHINE,