diff --git a/base/services/srvsvc/srvsvc.c b/base/services/srvsvc/srvsvc.c index a4e77f2c8f8..32d73ea89b4 100644 --- a/base/services/srvsvc/srvsvc.c +++ b/base/services/srvsvc/srvsvc.c @@ -79,6 +79,7 @@ ServiceControlHandler(DWORD dwControl, { case SERVICE_CONTROL_STOP: TRACE(" SERVICE_CONTROL_STOP received\n"); + UpdateServiceStatus(SERVICE_STOP_PENDING); /* Stop listening to incoming RPC messages */ RpcMgmtStopServerListening(NULL); UpdateServiceStatus(SERVICE_STOPPED); @@ -102,6 +103,9 @@ ServiceControlHandler(DWORD dwControl, case SERVICE_CONTROL_SHUTDOWN: TRACE(" SERVICE_CONTROL_SHUTDOWN received\n"); + UpdateServiceStatus(SERVICE_STOP_PENDING); + /* Stop listening to incoming RPC messages */ + RpcMgmtStopServerListening(NULL); UpdateServiceStatus(SERVICE_STOPPED); return ERROR_SUCCESS; diff --git a/base/services/wkssvc/wkssvc.c b/base/services/wkssvc/wkssvc.c index eba9053e5e0..9feb7bb50e2 100644 --- a/base/services/wkssvc/wkssvc.c +++ b/base/services/wkssvc/wkssvc.c @@ -76,6 +76,7 @@ ServiceControlHandler(DWORD dwControl, { case SERVICE_CONTROL_STOP: TRACE(" SERVICE_CONTROL_STOP received\n"); + UpdateServiceStatus(SERVICE_STOP_PENDING); /* Stop listening to incoming RPC messages */ RpcMgmtStopServerListening(NULL); UpdateServiceStatus(SERVICE_STOPPED); @@ -99,6 +100,9 @@ ServiceControlHandler(DWORD dwControl, case SERVICE_CONTROL_SHUTDOWN: TRACE(" SERVICE_CONTROL_SHUTDOWN received\n"); + UpdateServiceStatus(SERVICE_STOP_PENDING); + /* Stop listening to incoming RPC messages */ + RpcMgmtStopServerListening(NULL); UpdateServiceStatus(SERVICE_STOPPED); return ERROR_SUCCESS;