mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-28 21:00:28 +02:00
* some quick fixes for Win32 with temp variables for some places where the int64 changes breaks.
git-svn-id: trunk@44017 -
This commit is contained in:
parent
69956cd97a
commit
a16f332fbb
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user