mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-28 15:20:49 +02:00
LCL: FileSize function
fixed compilation for wince fixed handle leak for all windows platforms git-svn-id: trunk@16768 -
This commit is contained in:
parent
8541afd7f9
commit
b1927940a7
@ -839,13 +839,18 @@ begin
|
||||
exit(-1);
|
||||
Result:=st.st_size;
|
||||
{$ELSE}
|
||||
{$IFDEF WINCE}
|
||||
FileInfo.Name:=UTF8Decode(Filename);
|
||||
{$ELSE}
|
||||
FileInfo.Name:=UTF8ToSys(Filename);
|
||||
FileInfo.FindHandle:=Windows.FindFirstFile(PChar(FileInfo.Name),FileInfo.FindData);
|
||||
{$ENDIF}
|
||||
FileInfo.FindHandle:=Windows.FindFirstFile(Windows.LPTSTR(FileInfo.Name),FileInfo.FindData);
|
||||
if FileInfo.FindHandle=Windows.Invalid_Handle_value then begin
|
||||
Result:=-1;
|
||||
exit;
|
||||
end;
|
||||
Result:=(int64(FileInfo.FindData.nFileSizeHigh) shl 32)+FileInfo.FindData.nFileSizeLow;
|
||||
Windows.FindClose(FileInfo.FindHandle);
|
||||
{$ENDIF}
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user