Reactos

[UMPNPMGR] PNP_ReportLogOn must not fail on a LiveCD

Fixes CORE-19050

Eric Kohl da720b86 3f663903

+17 -1
+1
base/services/umpnpmgr/precomp.h
··· 105 105 extern HKEY hClassKey; 106 106 extern BOOL g_IsUISuppressed; 107 107 extern BOOL g_ShuttingDown; 108 + extern BOOL g_IsLiveMedium; 108 109 109 110 BOOL 110 111 GetSuppressNewUIValue(VOID);
+1 -1
base/services/umpnpmgr/rpcserver.c
··· 791 791 hBinding, Admin, ProcessId); 792 792 793 793 /* Fail, if the caller is not an interactive user */ 794 - if (!IsCallerInteractive(hBinding)) 794 + if ((g_IsLiveMedium == FALSE) && (IsCallerInteractive(hBinding) == FALSE)) 795 795 goto cleanup; 796 796 797 797 /* Get the users token */
+15
base/services/umpnpmgr/umpnpmgr.c
··· 45 45 HKEY hClassKey = NULL; 46 46 BOOL g_IsUISuppressed = FALSE; 47 47 BOOL g_ShuttingDown = FALSE; 48 + BOOL g_IsLiveMedium = FALSE; 48 49 49 50 /* FUNCTIONS *****************************************************************/ 50 51 ··· 200 201 return bSuppressNewHWUI; 201 202 } 202 203 204 + BOOL 205 + RunningOnLiveMedium(VOID) 206 + { 207 + WCHAR LogPath[MAX_PATH]; 208 + 209 + GetSystemWindowsDirectoryW(LogPath, ARRAYSIZE(LogPath)); 210 + if (GetDriveTypeW(LogPath) == DRIVE_FIXED) 211 + return FALSE; 212 + 213 + return TRUE; 214 + } 215 + 203 216 VOID WINAPI 204 217 ServiceMain(DWORD argc, LPTSTR *argv) 205 218 { ··· 210 223 UNREFERENCED_PARAMETER(argv); 211 224 212 225 DPRINT("ServiceMain() called\n"); 226 + 227 + g_IsLiveMedium = RunningOnLiveMedium(); 213 228 214 229 ServiceStatusHandle = RegisterServiceCtrlHandlerExW(ServiceName, 215 230 ServiceControlHandler,