@@ -2189,11 +2189,13 @@ procedure TSynWindowsPrivileges.LoadPrivileges;
21892189 len := Length(name );
21902190 if not LookupPrivilegeNameA(nil ,tp.Privileges[i].Luid,@name [1 ],len) then
21912191 if GetLastError <> ERROR_INSUFFICIENT_BUFFER then
2192- raise ESynException.CreateUTF8(' TSynWindowsPrivileges cannot lookup privilege name for Luid (%)' , [Int64(tp.Privileges[i].Luid)])
2192+ raise ESynException.CreateUTF8(' TSynWindowsPrivileges cannot lookup privilege name for Luid (%)' ,
2193+ [PInt64(@tp.Privileges[i].Luid)^]) // PInt64() to avoid URW699 on Delphi 6
21932194 else begin
21942195 SetLength(name , len);
21952196 if not LookupPrivilegeNameA(nil ,tp.Privileges[i].Luid,@name [1 ],len) then
2196- raise ESynException.CreateUTF8(' TSynWindowsPrivileges cannot lookup privilege name for Luid (%)' , [Int64(tp.Privileges[i].Luid)])
2197+ raise ESynException.CreateUTF8(' TSynWindowsPrivileges cannot lookup privilege name for Luid (%)' ,
2198+ [PInt64(@tp.Privileges[i].Luid)^])
21972199 end ;
21982200 enumval := IdemPCharArray(@name [1 ], UPCASE_SE_NAMES);
21992201 if (enumval >= ord(low(TWinSystemPrivilege))) and (enumval <= ord(high(TWinSystemPrivilege))) then begin
@@ -2221,13 +2223,13 @@ function TSynWindowsPrivileges.SetPrivilege(aPrivilege: Pointer;
22212223 if not LookupPrivilegeValue(nil , aPrivilege, id) then
22222224 exit;
22232225 tp.PrivilegeCount := 1 ;
2224- tp.Privileges[0 ].Luid := Int64( id);
2226+ tp.Privileges[0 ].Luid := PInt64(@ id)^ ;
22252227 tp.Privileges[0 ].Attributes := 0 ;
22262228 AdjustTokenPrivileges(Token, false, tp, sizeof(TOKEN_PRIVILEGES), @tpprev, @cbprev);
22272229 if GetLastError <> ERROR_SUCCESS then
22282230 exit;
2229- tpprev.PrivilegeCount := 1 ;
2230- tpprev.Privileges[0 ].Luid := Int64( id);
2231+ tpprev.PrivilegeCount := 1 ;
2232+ tpprev.Privileges[0 ].Luid := PInt64(@ id)^ ;
22312233 with tpprev.Privileges[0 ] do
22322234 if aEnablePrivilege then
22332235 Attributes := Attributes or SE_PRIVILEGE_ENABLED
0 commit comments