mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-18 01:49:20 +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.lpSecurityDescriptor:=nil;
|
||||
filerec(f).handle:=CreateFile(p,oflags,shflags,@security,cd,FILE_ATTRIBUTE_NORMAL,0);
|
||||
|
||||
{ append mode }
|
||||
if ((flags and $100)<>0) and
|
||||
(filerec(f).handle<>0) and
|
||||
@ -288,6 +289,7 @@ begin
|
||||
do_seekend(filerec(f).handle);
|
||||
filerec(f).mode:=fmoutput; {fool fmappend}
|
||||
end;
|
||||
|
||||
{ get errors }
|
||||
{ handle -1 is returned sometimes !! (PM) }
|
||||
if (filerec(f).handle=0) or (filerec(f).handle=UnusedHandle) then
|
||||
|
@ -132,7 +132,7 @@ type
|
||||
PLPWSTR = ^LPWSTR;
|
||||
|
||||
PSecurityAttributes = ^TSecurityAttributes;
|
||||
TSecurityAttributes = packed record
|
||||
TSecurityAttributes = record
|
||||
nLength : DWORD;
|
||||
lpSecurityDescriptor : Pointer;
|
||||
bInheritHandle : BOOL;
|
||||
@ -235,7 +235,7 @@ threadvar
|
||||
stdcall;external KernelDLL name 'MoveFileA';
|
||||
function CreateFile(lpFileName:pchar; dwDesiredAccess:DWORD; dwShareMode:DWORD;
|
||||
lpSecurityAttributes:PSECURITYATTRIBUTES; dwCreationDisposition:DWORD;
|
||||
dwFlagsAndAttributes:DWORD; hTemplateFile:DWORD):longint;
|
||||
dwFlagsAndAttributes:DWORD; hTemplateFile:DWORD):THandle;
|
||||
stdcall;external KernelDLL name 'CreateFileA';
|
||||
function GetProcAddress(hModule:THandle; lpProcName:pchar):pointer; stdcall; external KernelDLL name 'GetProcAddress';
|
||||
|
||||
|
@ -42,7 +42,7 @@ type
|
||||
|
||||
const
|
||||
{ Default filehandles }
|
||||
UnusedHandle : THandle = -1;
|
||||
UnusedHandle : THandle = THandle(-1);
|
||||
StdInputHandle : THandle = 0;
|
||||
StdOutputHandle : THandle = 0;
|
||||
StdErrorHandle : THandle = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user