From 85b71880fa000b24f2b2bc88b15d36cb039f00db Mon Sep 17 00:00:00 2001 From: Eric Kohl Date: Sat, 10 Feb 2018 17:02:23 +0100 Subject: [PATCH] [SERVICES] Update the service status after unloading a driver Update the service status after unloading the driver and pass the new status to the caller. CORE-14269 --- base/system/services/driver.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/base/system/services/driver.c b/base/system/services/driver.c index 4248ac95c92..de8bfc1aa3e 100644 --- a/base/system/services/driver.c +++ b/base/system/services/driver.c @@ -306,8 +306,16 @@ ScmControlDriver(PSERVICE lpService, dwError = ScmUnloadDriver(lpService); if (dwError == ERROR_SUCCESS) { - lpService->Status.dwControlsAccepted = 0; lpService->Status.dwCurrentState = SERVICE_STOPPED; + lpService->Status.dwControlsAccepted = 0; + lpService->Status.dwWin32ExitCode = ERROR_SUCCESS; + + if (lpServiceStatus != NULL) + { + RtlCopyMemory(lpServiceStatus, + &lpService->Status, + sizeof(SERVICE_STATUS)); + } } break;