Просмотр исходного кода

RedirFunc will be removed. Make sure it doesn't break 64-bit install mode for 64-bit Setup in the mean time, without introducing new warnings.

So these modes work:
-32-bit Setup + 32-bit install mode
-32-bit Setup + 64-bit install mode
-64-bit Setup + 64-bit install mode

But this one does not yet:
-64-bit Setup + 32-bit install mode
Martijn Laan 1 месяц назад
Родитель
Сommit
c405525289
1 измененных файлов с 13 добавлено и 1 удалено
  1. 13 1
      Projects/Src/Setup.RedirFunc.pas

+ 13 - 1
Projects/Src/Setup.RedirFunc.pas

@@ -20,8 +20,10 @@ uses
 
 type
   TPreviousFsRedirectionState = record
+    {$IFNDEF WIN64}
     DidDisable: Boolean;
     OldValue: Pointer;
+    {$ENDIF}
   end;
 
 function AreFsRedirectionFunctionsAvailable: Boolean;
@@ -109,14 +111,16 @@ implementation
 uses
   Shared.CommonFunc, PathFunc;
 
+{$IFNDEF WIN64}
 var
   Wow64DisableWow64FsRedirectionFunc: function(var OldValue: Pointer): BOOL; stdcall;
   Wow64RevertWow64FsRedirectionFunc: function(OldValue: Pointer): BOOL; stdcall;
   FsRedirectionFunctionsAvailable: Boolean;
+{$ENDIF}
 
 function AreFsRedirectionFunctionsAvailable: Boolean;
 begin
-  Result := FsRedirectionFunctionsAvailable;
+  Result := {$IFNDEF WIN64} FsRedirectionFunctionsAvailable {$ELSE} False {$ENDIF};
 end;
 
 function DisableFsRedirectionIf(const Disable: Boolean;
@@ -129,6 +133,7 @@ function DisableFsRedirectionIf(const Disable: Boolean;
   Returns True if successful, False if not. For extended error information when
   False is returned, call GetLastError. }
 begin
+  {$IFNDEF WIN64}
   PreviousState.DidDisable := False;
   if not Disable then
     Result := True
@@ -148,6 +153,9 @@ begin
       Result := False;
     end;
   end;
+  {$ELSE}
+  Result := True;
+  {$ENDIF}
 end;
 
 procedure RestoreFsRedirection(const PreviousState: TPreviousFsRedirectionState);
@@ -155,8 +163,10 @@ procedure RestoreFsRedirection(const PreviousState: TPreviousFsRedirectionState)
   DisableFsRedirectionIf. There is no indication of failure (which is
   extremely unlikely). }
 begin
+  {$IFNDEF WIN64}
   if PreviousState.DidDisable then
     Wow64RevertWow64FsRedirectionFunc(PreviousState.OldValue);
+  {$ENDIF}
 end;
 
 { *Redir functions }
@@ -595,12 +605,14 @@ begin
 end;
 
 initialization
+  {$IFNDEF WIN64}
   Wow64DisableWow64FsRedirectionFunc := GetProcAddress(GetModuleHandle(kernel32),
     'Wow64DisableWow64FsRedirection');
   Wow64RevertWow64FsRedirectionFunc := GetProcAddress(GetModuleHandle(kernel32),
     'Wow64RevertWow64FsRedirection');
   FsRedirectionFunctionsAvailable := Assigned(Wow64DisableWow64FsRedirectionFunc) and
     Assigned(Wow64RevertWow64FsRedirectionFunc);
+  {$ENDIF}
 
   { For GetVersionNumbersRedir: Pre-load shell32.dll since GetFileVersionInfo
     and GetFileVersionInfoSize will try to load it when reading version info