https://git.reactos.org/?p=reactos.git;a=commitdiff;h=2d69520595e001f039a43…
commit 2d69520595e001f039a4322c06edcbda89e30ae0
Author: Eric Kohl <eric.kohl(a)reactos.org>
AuthorDate: Sun Jan 28 00:57:58 2018 +0100
Commit: Eric Kohl <eric.kohl(a)reactos.org>
CommitDate: Sun Jan 28 00:57:58 2018 +0100
[SERVICES] Do not delete running services.
CORE-14260
---
base/system/services/rpcserver.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/base/system/services/rpcserver.c b/base/system/services/rpcserver.c
index d2f032cfe0..f1ce146a92 100644
--- a/base/system/services/rpcserver.c
+++ b/base/system/services/rpcserver.c
@@ -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,