From 0e975b1229482717a6c543d02e96ae0864f551e9 Mon Sep 17 00:00:00 2001 From: Turrican Date: Tue, 2 Apr 2019 20:55:07 +0200 Subject: [PATCH] Fixed GetSpecialFolderPath will crash if user is under ASP.NET Fixed GetSpecialFolderPath will crash if process user is a special user (System or non local) and is not loading regular local profile under ASP.NET and IIS --- Quick.Commons.pas | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Quick.Commons.pas b/Quick.Commons.pas index 3645b32..ff63ae6 100644 --- a/Quick.Commons.pas +++ b/Quick.Commons.pas @@ -455,10 +455,10 @@ procedure GetEnvironmentPaths; path.ALLUSERSPROFILE := SysUtils.GetEnvironmentVariable('AllUsersProfile'); path.INSTDRIVE := path.HOMEDRIVE; path.TEMP := SysUtils.GetEnvironmentVariable('TEMP'); - path.SYSTEM := GetSpecialFolderPath(CSIDL_SYSTEM); - path.APPDATA:=GetSpecialFolderPath(CSIDL_APPDATA); //these paths fail if user is SYSTEM try + path.SYSTEM := GetSpecialFolderPath(CSIDL_SYSTEM); + path.APPDATA := GetSpecialFolderPath(CSIDL_APPDATA); path.DESKTOP := GetSpecialFolderPath(CSIDL_DESKTOP); path.DESKTOP_ALLUSERS := GetSpecialFolderPath(CSIDL_COMMON_DESKTOPDIRECTORY); path.STARTMENU:=GetSpecialFolderPath(CSIDL_PROGRAMS);