Browse Source

* some quick fixes for Win32 with temp variables for some places where the int64 changes breaks.

git-svn-id: trunk@44017 -
marco 5 years ago
parent
commit
a16f332fbb
1 changed files with 16 additions and 5 deletions
  1. 16 5
      rtl/win/sysutils.pp

+ 16 - 5
rtl/win/sysutils.pp

@@ -398,14 +398,18 @@ Function FileAge (Const FileName : UnicodeString): Int64;
 var
   Handle: THandle;
   FindData: TWin32FindDataW;
+  tmpdtime    : longint;
 begin
   Handle := FindFirstFileW(Pwidechar(FileName), FindData);
   if Handle <> INVALID_HANDLE_VALUE then
     begin
       Windows.FindClose(Handle);
       if (FindData.dwFileAttributes and FILE_ATTRIBUTE_DIRECTORY) = 0 then
-        If WinToDosTime(FindData.ftLastWriteTime,Result) then
-          exit;
+        If WinToDosTime(FindData.ftLastWriteTime,tmpdtime) then
+          begin
+            result:=tmpdtime;
+            exit;
+          end;
     end;
   Result := -1;
 end;
@@ -565,6 +569,8 @@ begin
 end;
 
 Function FindMatch(var f: TAbstractSearchRec; var Name: UnicodeString) : Longint;
+var
+  tmpdtime : longint;
 begin
   { Find file with correct attribute }
   While (F.FindData.dwFileAttributes and cardinal(F.ExcludeAttr))<>0 do
@@ -576,7 +582,8 @@ begin
       end;
    end;
   { Convert some attributes back }
-  WinToDosTime(F.FindData.ftLastWriteTime,F.Time);
+  WinToDosTime(F.FindData.ftLastWriteTime,tmpdtime);
+  F.Time:=tmpdtime;
   f.size:=F.FindData.NFileSizeLow+(qword(maxdword)+1)*F.FindData.NFileSizeHigh;
   f.attr:=F.FindData.dwFileAttributes;
   Name:=F.FindData.cFileName;
@@ -627,10 +634,14 @@ end;
 Function FileGetDate (Handle : THandle) : Int64;
 Var
   FT : TFileTime;
+  tmpdtime : longint;
 begin
   If GetFileTime(Handle,nil,nil,@ft) and
-     WinToDosTime(FT,Result) then
-    exit;
+     WinToDosTime(FT,tmpdtime) then
+    begin
+      result:=tmpdtime;
+      exit;
+    end;
   Result:=-1;
 end;