mirror of
https://github.com/reactos/reactos.git
synced 2026-05-29 21:19:51 +08:00
[UMPNPMGR] PNP_ReportLogOn must not fail on a LiveCD
Fixes CORE-19050
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user