mirror of https://github.com/red-prig/fpPS4.git
This commit is contained in:
parent
c20d02a1b9
commit
dbc7fede18
|
@ -452,8 +452,8 @@ begin
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function SetFilePointerEx(hFile:HANDLE;
|
function SetFilePointerEx(hFile:HANDLE;
|
||||||
lDistanceToMove:LARGE_INTEGER;
|
liDistanceToMove:LARGE_INTEGER;
|
||||||
lpDistanceToMoveHigh:PLARGE_INTEGER;
|
lpNewFilePointer:PLARGE_INTEGER;
|
||||||
dwMoveMethod:DWORD):BOOL; external 'kernel32';
|
dwMoveMethod:DWORD):BOOL; external 'kernel32';
|
||||||
|
|
||||||
function _sys_lseek(fd:Integer;offset:Int64;whence:Integer):Int64;
|
function _sys_lseek(fd:Integer;offset:Int64;whence:Integer):Int64;
|
||||||
|
@ -605,6 +605,7 @@ var
|
||||||
h:THandle;
|
h:THandle;
|
||||||
N:DWORD;
|
N:DWORD;
|
||||||
O:TOVERLAPPED;
|
O:TOVERLAPPED;
|
||||||
|
p:Int64;
|
||||||
begin
|
begin
|
||||||
if (data=nil) then Exit(-EFAULT);
|
if (data=nil) then Exit(-EFAULT);
|
||||||
if (fd<0) then Exit(-EINVAL);
|
if (fd<0) then Exit(-EINVAL);
|
||||||
|
@ -637,6 +638,10 @@ begin
|
||||||
begin
|
begin
|
||||||
Result:=-EIO;
|
Result:=-EIO;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
//NOTE: pread and pwrite don't change the file position, but ReadFile/WriteFile do, damn it.
|
||||||
|
p:=-N;
|
||||||
|
SetFilePointerEx(h,LARGE_INTEGER(p),nil,FILE_CURRENT);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function ps4_pread(fd:Integer;data:Pointer;size,offset:Int64):Int64; SysV_ABI_CDecl;
|
function ps4_pread(fd:Integer;data:Pointer;size,offset:Int64):Int64; SysV_ABI_CDecl;
|
||||||
|
@ -824,6 +829,7 @@ var
|
||||||
h:THandle;
|
h:THandle;
|
||||||
N:DWORD;
|
N:DWORD;
|
||||||
O:TOVERLAPPED;
|
O:TOVERLAPPED;
|
||||||
|
p:Int64;
|
||||||
begin
|
begin
|
||||||
if (data=nil) then Exit(-EFAULT);
|
if (data=nil) then Exit(-EFAULT);
|
||||||
if (fd<0) then Exit(-EINVAL);
|
if (fd<0) then Exit(-EINVAL);
|
||||||
|
@ -852,6 +858,10 @@ begin
|
||||||
begin
|
begin
|
||||||
Result:=-EIO;
|
Result:=-EIO;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
//NOTE: pread and pwrite don't change the file position, but ReadFile/WriteFile do, damn it.
|
||||||
|
p:=-N;
|
||||||
|
SetFilePointerEx(h,LARGE_INTEGER(p),nil,FILE_CURRENT);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function ps4_pwrite(fd:Integer;data:Pointer;size,offset:Int64):Int64; SysV_ABI_CDecl;
|
function ps4_pwrite(fd:Integer;data:Pointer;size,offset:Int64):Int64; SysV_ABI_CDecl;
|
||||||
|
|
|
@ -1276,6 +1276,8 @@ begin
|
||||||
begin
|
begin
|
||||||
Writeln(StdErr,'[WARN]:sceKernelMmap:',Result);
|
Writeln(StdErr,'[WARN]:sceKernelMmap:',Result);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Result:=px2sce(Result);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function ps4_munmap(addr:Pointer;len:size_t):Integer; SysV_ABI_CDecl;
|
function ps4_munmap(addr:Pointer;len:size_t):Integer; SysV_ABI_CDecl;
|
||||||
|
|
Loading…
Reference in New Issue