[UMPNPMGR] PNP_ReportLogOn must not fail on a LiveCD

Fixes CORE-19050
This commit is contained in:
Eric Kohl
2025-08-24 13:30:32 +02:00
parent 3f6639031c
commit da720b864e
3 changed files with 17 additions and 1 deletions

View File

@@ -105,6 +105,7 @@ extern HKEY hEnumKey;
extern HKEY hClassKey;
extern BOOL g_IsUISuppressed;
extern BOOL g_ShuttingDown;
extern BOOL g_IsLiveMedium;
BOOL
GetSuppressNewUIValue(VOID);

View File

@@ -791,7 +791,7 @@ PNP_ReportLogOn(
hBinding, Admin, ProcessId);
/* Fail, if the caller is not an interactive user */
if (!IsCallerInteractive(hBinding))
if ((g_IsLiveMedium == FALSE) && (IsCallerInteractive(hBinding) == FALSE))
goto cleanup;
/* Get the users token */

View File

@@ -45,6 +45,7 @@ HKEY hEnumKey = NULL;
HKEY hClassKey = NULL;
BOOL g_IsUISuppressed = FALSE;
BOOL g_ShuttingDown = FALSE;
BOOL g_IsLiveMedium = FALSE;
/* FUNCTIONS *****************************************************************/
@@ -200,6 +201,18 @@ GetSuppressNewUIValue(VOID)
return bSuppressNewHWUI;
}
BOOL
RunningOnLiveMedium(VOID)
{
WCHAR LogPath[MAX_PATH];
GetSystemWindowsDirectoryW(LogPath, ARRAYSIZE(LogPath));
if (GetDriveTypeW(LogPath) == DRIVE_FIXED)
return FALSE;
return TRUE;
}
VOID WINAPI
ServiceMain(DWORD argc, LPTSTR *argv)
{
@@ -211,6 +224,8 @@ ServiceMain(DWORD argc, LPTSTR *argv)
DPRINT("ServiceMain() called\n");
g_IsLiveMedium = RunningOnLiveMedium();
ServiceStatusHandle = RegisterServiceCtrlHandlerExW(ServiceName,
ServiceControlHandler,
NULL);