Skip to content

Commit 3648678

Browse files
author
Arnaud Bouchez
committed
fixed Delphi 6 compilation
1 parent 76afb65 commit 3648678

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

SQLite3/mORMotService.pas

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -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

SynopseCommit.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
'1.18.4951'
1+
'1.18.4952'

0 commit comments

Comments
 (0)