mirror of
https://github.com/reactos/reactos.git
synced 2025-02-28 19:32:59 +00:00
[UMPNPMGR] PNP_GetGlobalState returns CM_GLOBAL_STATE_SHUTTING_DOWN on service shutdown
This commit is contained in:
parent
978503cd46
commit
91bc5b5e94
3 changed files with 8 additions and 0 deletions
|
@ -88,6 +88,7 @@ RpcServerThread(
|
|||
extern HKEY hEnumKey;
|
||||
extern HKEY hClassKey;
|
||||
extern BOOL g_IsUISuppressed;
|
||||
extern BOOL g_ShuttingDown;
|
||||
|
||||
BOOL
|
||||
GetSuppressNewUIValue(VOID);
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue