diff --git a/base/services/umpnpmgr/precomp.h b/base/services/umpnpmgr/precomp.h index a9dabcc25c813..21c3622d92924 100644 --- a/base/services/umpnpmgr/precomp.h +++ b/base/services/umpnpmgr/precomp.h @@ -88,6 +88,7 @@ RpcServerThread( extern HKEY hEnumKey; extern HKEY hClassKey; extern BOOL g_IsUISuppressed; +extern BOOL g_ShuttingDown; BOOL GetSuppressNewUIValue(VOID); diff --git a/base/services/umpnpmgr/rpcserver.c b/base/services/umpnpmgr/rpcserver.c index db6a474a0f650..ff7a15ac0fbf5 100644 --- a/base/services/umpnpmgr/rpcserver.c +++ b/base/services/umpnpmgr/rpcserver.c @@ -687,6 +687,9 @@ PNP_GetGlobalState( *pulState = CM_GLOBAL_STATE_CAN_DO_UI | CM_GLOBAL_STATE_SERVICES_AVAILABLE; + if (g_ShuttingDown) + *pulState |= CM_GLOBAL_STATE_SHUTTING_DOWN; + return CR_SUCCESS; } diff --git a/base/services/umpnpmgr/umpnpmgr.c b/base/services/umpnpmgr/umpnpmgr.c index 14b7c1a9e6fc8..60194bd458d76 100644 --- a/base/services/umpnpmgr/umpnpmgr.c +++ b/base/services/umpnpmgr/umpnpmgr.c @@ -44,6 +44,7 @@ static SERVICE_STATUS ServiceStatus; HKEY hEnumKey = NULL; HKEY hClassKey = NULL; BOOL g_IsUISuppressed = FALSE; +BOOL g_ShuttingDown = FALSE; /* FUNCTIONS *****************************************************************/ @@ -52,6 +53,9 @@ UpdateServiceStatus( _In_ DWORD dwState, _In_ DWORD dwCheckPoint) { + if ((dwState == SERVICE_STOPPED) || (dwState == SERVICE_STOP_PENDING)) + g_ShuttingDown = TRUE; + ServiceStatus.dwServiceType = SERVICE_WIN32_OWN_PROCESS; ServiceStatus.dwCurrentState = dwState; ServiceStatus.dwWin32ExitCode = 0;