Permalink
Browse files

fixed Delphi 6 compilation

  • Loading branch information...
Arnaud Bouchez
Arnaud Bouchez committed Jan 11, 2019
1 parent 76afb65 commit 36486785f2b3af0bf0015960fe43d76d32f819e4
Showing with 8 additions and 6 deletions.
  1. +7 −5 SQLite3/mORMotService.pas
  2. +1 −1 SynopseCommit.inc
@@ -2189,11 +2189,13 @@ procedure TSynWindowsPrivileges.LoadPrivileges;
len := Length(name);
if not LookupPrivilegeNameA(nil,tp.Privileges[i].Luid,@name[1],len) then
if GetLastError <> ERROR_INSUFFICIENT_BUFFER then
raise ESynException.CreateUTF8('TSynWindowsPrivileges cannot lookup privilege name for Luid (%)', [Int64(tp.Privileges[i].Luid)])
raise ESynException.CreateUTF8('TSynWindowsPrivileges cannot lookup privilege name for Luid (%)',
[PInt64(@tp.Privileges[i].Luid)^]) // PInt64() to avoid URW699 on Delphi 6
else begin
SetLength(name, len);
if not LookupPrivilegeNameA(nil,tp.Privileges[i].Luid,@name[1],len) then
raise ESynException.CreateUTF8('TSynWindowsPrivileges cannot lookup privilege name for Luid (%)', [Int64(tp.Privileges[i].Luid)])
raise ESynException.CreateUTF8('TSynWindowsPrivileges cannot lookup privilege name for Luid (%)',
[PInt64(@tp.Privileges[i].Luid)^])
end;
enumval := IdemPCharArray(@name[1], UPCASE_SE_NAMES);
if (enumval >= ord(low(TWinSystemPrivilege))) and (enumval <= ord(high(TWinSystemPrivilege))) then begin
@@ -2221,13 +2223,13 @@ function TSynWindowsPrivileges.SetPrivilege(aPrivilege: Pointer;
if not LookupPrivilegeValue(nil, aPrivilege, id) then
exit;
tp.PrivilegeCount := 1;
tp.Privileges[0].Luid := Int64(id);
tp.Privileges[0].Luid := PInt64(@id)^;
tp.Privileges[0].Attributes := 0;
AdjustTokenPrivileges(Token, false, tp, sizeof(TOKEN_PRIVILEGES), @tpprev, @cbprev);
if GetLastError <> ERROR_SUCCESS then
exit;
tpprev.PrivilegeCount := 1;
tpprev.Privileges[0].Luid := Int64(id);
tpprev.PrivilegeCount := 1;
tpprev.Privileges[0].Luid := PInt64(@id)^;
with tpprev.Privileges[0] do
if aEnablePrivilege then
Attributes := Attributes or SE_PRIVILEGE_ENABLED
@@ -1 +1 @@
'1.18.4951'
'1.18.4952'

0 comments on commit 3648678

Please sign in to comment.