ソースを参照

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
Turrican 6 年 前
コミット
0e975b1229
1 ファイル変更2 行追加2 行削除
  1. 2 2
      Quick.Commons.pas

+ 2 - 2
Quick.Commons.pas

@@ -455,10 +455,10 @@ begin
   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);