[SRVSVC][WKSSVC] Set the stop pending status before stopping the services and stop the RPC listener on shutdown as well.

This commit is contained in:
Eric Kohl 2019-07-21 18:56:02 +02:00
parent 1f082ecc68
commit e0c97c9eca
2 changed files with 8 additions and 0 deletions

View file

@ -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;

View file

@ -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;