mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-17 16:09:17 +02:00
* basic file io fixed for win64
git-svn-id: trunk@3241 -
This commit is contained in:
parent
61d86150aa
commit
807fc6e948
@ -280,6 +280,7 @@ begin
|
|||||||
security.bInheritHandle:=true;
|
security.bInheritHandle:=true;
|
||||||
security.lpSecurityDescriptor:=nil;
|
security.lpSecurityDescriptor:=nil;
|
||||||
filerec(f).handle:=CreateFile(p,oflags,shflags,@security,cd,FILE_ATTRIBUTE_NORMAL,0);
|
filerec(f).handle:=CreateFile(p,oflags,shflags,@security,cd,FILE_ATTRIBUTE_NORMAL,0);
|
||||||
|
|
||||||
{ append mode }
|
{ append mode }
|
||||||
if ((flags and $100)<>0) and
|
if ((flags and $100)<>0) and
|
||||||
(filerec(f).handle<>0) and
|
(filerec(f).handle<>0) and
|
||||||
@ -288,6 +289,7 @@ begin
|
|||||||
do_seekend(filerec(f).handle);
|
do_seekend(filerec(f).handle);
|
||||||
filerec(f).mode:=fmoutput; {fool fmappend}
|
filerec(f).mode:=fmoutput; {fool fmappend}
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ get errors }
|
{ get errors }
|
||||||
{ handle -1 is returned sometimes !! (PM) }
|
{ handle -1 is returned sometimes !! (PM) }
|
||||||
if (filerec(f).handle=0) or (filerec(f).handle=UnusedHandle) then
|
if (filerec(f).handle=0) or (filerec(f).handle=UnusedHandle) then
|
||||||
|
@ -132,7 +132,7 @@ type
|
|||||||
PLPWSTR = ^LPWSTR;
|
PLPWSTR = ^LPWSTR;
|
||||||
|
|
||||||
PSecurityAttributes = ^TSecurityAttributes;
|
PSecurityAttributes = ^TSecurityAttributes;
|
||||||
TSecurityAttributes = packed record
|
TSecurityAttributes = record
|
||||||
nLength : DWORD;
|
nLength : DWORD;
|
||||||
lpSecurityDescriptor : Pointer;
|
lpSecurityDescriptor : Pointer;
|
||||||
bInheritHandle : BOOL;
|
bInheritHandle : BOOL;
|
||||||
@ -235,7 +235,7 @@ threadvar
|
|||||||
stdcall;external KernelDLL name 'MoveFileA';
|
stdcall;external KernelDLL name 'MoveFileA';
|
||||||
function CreateFile(lpFileName:pchar; dwDesiredAccess:DWORD; dwShareMode:DWORD;
|
function CreateFile(lpFileName:pchar; dwDesiredAccess:DWORD; dwShareMode:DWORD;
|
||||||
lpSecurityAttributes:PSECURITYATTRIBUTES; dwCreationDisposition:DWORD;
|
lpSecurityAttributes:PSECURITYATTRIBUTES; dwCreationDisposition:DWORD;
|
||||||
dwFlagsAndAttributes:DWORD; hTemplateFile:DWORD):longint;
|
dwFlagsAndAttributes:DWORD; hTemplateFile:DWORD):THandle;
|
||||||
stdcall;external KernelDLL name 'CreateFileA';
|
stdcall;external KernelDLL name 'CreateFileA';
|
||||||
function GetProcAddress(hModule:THandle; lpProcName:pchar):pointer; stdcall; external KernelDLL name 'GetProcAddress';
|
function GetProcAddress(hModule:THandle; lpProcName:pchar):pointer; stdcall; external KernelDLL name 'GetProcAddress';
|
||||||
|
|
||||||
|
@ -42,7 +42,7 @@ type
|
|||||||
|
|
||||||
const
|
const
|
||||||
{ Default filehandles }
|
{ Default filehandles }
|
||||||
UnusedHandle : THandle = -1;
|
UnusedHandle : THandle = THandle(-1);
|
||||||
StdInputHandle : THandle = 0;
|
StdInputHandle : THandle = 0;
|
||||||
StdOutputHandle : THandle = 0;
|
StdOutputHandle : THandle = 0;
|
||||||
StdErrorHandle : THandle = 0;
|
StdErrorHandle : THandle = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user