mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-10 21:06:11 +02:00
* GetFileHandle(), THandleStream: changed type that is used to store file handle from Integer to THandle, so it can be redefined to 64 bits on certain platforms, see http://lists.freepascal.org/lists/fpc-devel/2010-November/023019.html
git-svn-id: trunk@16383 -
This commit is contained in:
parent
eb698a6d9a
commit
907e7a32d5
@ -842,16 +842,16 @@ type
|
|||||||
|
|
||||||
THandleStream = class(TStream)
|
THandleStream = class(TStream)
|
||||||
private
|
private
|
||||||
FHandle: Integer;
|
FHandle: THandle;
|
||||||
protected
|
protected
|
||||||
procedure SetSize(NewSize: Longint); override;
|
procedure SetSize(NewSize: Longint); override;
|
||||||
procedure SetSize(const NewSize: Int64); override;
|
procedure SetSize(const NewSize: Int64); override;
|
||||||
public
|
public
|
||||||
constructor Create(AHandle: Integer);
|
constructor Create(AHandle: THandle);
|
||||||
function Read(var Buffer; Count: Longint): Longint; override;
|
function Read(var Buffer; Count: Longint): Longint; override;
|
||||||
function Write(const Buffer; Count: Longint): Longint; override;
|
function Write(const Buffer; Count: Longint): Longint; override;
|
||||||
function Seek(const Offset: Int64; Origin: TSeekOrigin): Int64; override;
|
function Seek(const Offset: Int64; Origin: TSeekOrigin): Int64; override;
|
||||||
property Handle: Integer read FHandle;
|
property Handle: THandle read FHandle;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ TFileStream class }
|
{ TFileStream class }
|
||||||
|
@ -409,7 +409,7 @@ end;
|
|||||||
{* THandleStream *}
|
{* THandleStream *}
|
||||||
{****************************************************************************}
|
{****************************************************************************}
|
||||||
|
|
||||||
Constructor THandleStream.Create(AHandle: Integer);
|
Constructor THandleStream.Create(AHandle: THandle);
|
||||||
|
|
||||||
begin
|
begin
|
||||||
FHandle:=AHandle;
|
FHandle:=AHandle;
|
||||||
|
@ -99,6 +99,6 @@ Function FileSearch (Const Name, DirList : String; ImplicitCurrentDir : Boolean
|
|||||||
Function ExeSearch (Const Name, DirList : String) : String;
|
Function ExeSearch (Const Name, DirList : String) : String;
|
||||||
Function FileIsReadOnly(const FileName: String): Boolean;
|
Function FileIsReadOnly(const FileName: String): Boolean;
|
||||||
|
|
||||||
Function GetFileHandle(var f : File):Longint;
|
Function GetFileHandle(var f : File):THandle;
|
||||||
Function GetFileHandle(var f : Text):Longint;
|
Function GetFileHandle(var f : Text):THandle;
|
||||||
|
|
||||||
|
@ -317,13 +317,13 @@ begin
|
|||||||
Result := '';
|
Result := '';
|
||||||
end;
|
end;
|
||||||
|
|
||||||
Function GetFileHandle(var f : File):Longint;
|
Function GetFileHandle(var f : File):THandle;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
result:=filerec(f).handle;
|
result:=filerec(f).handle;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
Function GetFileHandle(var f : Text):Longint;
|
Function GetFileHandle(var f : Text):THandle;
|
||||||
begin
|
begin
|
||||||
result:=textrec(f).handle;
|
result:=textrec(f).handle;
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user