Martijn Laan 3 months ago
parent
commit
9f10cdda01
1 changed files with 1 additions and 1 deletions
  1. 1 1
      Projects/Src/SetupLdrAndSetup.RedirFunc.pas

+ 1 - 1
Projects/Src/SetupLdrAndSetup.RedirFunc.pas

@@ -170,11 +170,11 @@ end;
 class function TRedir<T>.RedirIf(const Disable: Boolean; const FailResult: T; const Func: TFunc<T>): T;
 class function TRedir<T>.RedirIf(const Disable: Boolean; const FailResult: T; const Func: TFunc<T>): T;
 begin
 begin
   var PrevState: TPreviousFsRedirectionState;
   var PrevState: TPreviousFsRedirectionState;
-  var ErrorCode: DWORD;
   if not DisableFsRedirectionIf(Disable, PrevState) then begin
   if not DisableFsRedirectionIf(Disable, PrevState) then begin
     Result := FailResult;
     Result := FailResult;
     Exit;
     Exit;
   end;
   end;
+  var ErrorCode: DWORD;
   try
   try
     Result := Func;
     Result := Func;
     ErrorCode := GetLastError;
     ErrorCode := GetLastError;