mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-22 02:09:29 +02:00
* merging Carl's fixes from the fixes branch
This commit is contained in:
parent
5543ee6413
commit
afe7569a0c
@ -1600,7 +1600,7 @@ function DosQueryMuxWaitSem(Handle:longint;var CSemRec:longint;
|
|||||||
****************************************************************************}
|
****************************************************************************}
|
||||||
|
|
||||||
|
|
||||||
type TDateTime=record
|
type TDateTime=packed record
|
||||||
Hour,
|
Hour,
|
||||||
Minute,
|
Minute,
|
||||||
Second,
|
Second,
|
||||||
@ -1608,7 +1608,7 @@ type TDateTime=record
|
|||||||
Day,
|
Day,
|
||||||
Month:byte;
|
Month:byte;
|
||||||
Year:word;
|
Year:word;
|
||||||
TimeZone:integer;
|
TimeZone:smallint;
|
||||||
WeekDay:byte;
|
WeekDay:byte;
|
||||||
end;
|
end;
|
||||||
PDateTime=^TDateTime;
|
PDateTime=^TDateTime;
|
||||||
@ -4031,7 +4031,10 @@ external 'DOSCALLS' index 582;
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.9 2001-01-27 18:31:38 hajny
|
Revision 1.10 2001-05-20 18:40:32 hajny
|
||||||
|
* merging Carl's fixes from the fixes branch
|
||||||
|
|
||||||
|
Revision 1.9 2001/01/27 18:31:38 hajny
|
||||||
* Another bunch of compatibility additions
|
* Another bunch of compatibility additions
|
||||||
|
|
||||||
Revision 1.8 2001/01/23 20:28:05 hajny
|
Revision 1.8 2001/01/23 20:28:05 hajny
|
||||||
|
@ -1993,7 +1993,7 @@ const
|
|||||||
function WinInitialize(flOptions : cardinal) : cardinal; cdecl;external 'pmwin' index 763;
|
function WinInitialize(flOptions : cardinal) : cardinal; cdecl;external 'pmwin' index 763;
|
||||||
function WinTerminate(hab : cardinal) : longbool; cdecl;external 'pmwin' index 888;
|
function WinTerminate(hab : cardinal) : longbool; cdecl;external 'pmwin' index 888;
|
||||||
function WinQueryAnchorBlock(hwnd : cardinal) : cardinal; cdecl;external 'pmwin' index 800;
|
function WinQueryAnchorBlock(hwnd : cardinal) : cardinal; cdecl;external 'pmwin' index 800;
|
||||||
function WinCreateWindow(hwndParent : cardinal;pszClass,pszName : pchar;flStyle : cardinal;x,y,cx,cy : longint;hwndOwner,hwndInsertBehind,id : cardinal;var pCtlData,PresParams : pointer) : cardinal; cdecl;external 'pmwin' index 909;
|
function WinCreateWindow(hwndParent : cardinal;pszClass,pszName : pchar;flStyle : cardinal;x,y,cx,cy : longint;hwndOwner,hwndInsertBehind,id : cardinal;var pCtlData,pPresParams : pointer) : cardinal; cdecl;external 'pmwin' index 909;
|
||||||
function WinEnableWindow(hwnd : cardinal;fEnable : longbool) : longbool; cdecl;external 'pmwin' index 735;
|
function WinEnableWindow(hwnd : cardinal;fEnable : longbool) : longbool; cdecl;external 'pmwin' index 735;
|
||||||
function WinIsWindowEnabled(hwnd : cardinal) : longbool; cdecl;external 'pmwin' index 773;
|
function WinIsWindowEnabled(hwnd : cardinal) : longbool; cdecl;external 'pmwin' index 773;
|
||||||
function WinEnableWindowUpdate(hwnd : cardinal;fEnable : longbool) : longbool; cdecl;external 'pmwin' index 736;
|
function WinEnableWindowUpdate(hwnd : cardinal;fEnable : longbool) : longbool; cdecl;external 'pmwin' index 736;
|
||||||
@ -2150,7 +2150,7 @@ const
|
|||||||
function WinCopyRect(hab : cardinal;var rclDst,rclSrc : TRectl) : longbool; cdecl;external 'pmwin' index 710;
|
function WinCopyRect(hab : cardinal;var rclDst,rclSrc : TRectl) : longbool; cdecl;external 'pmwin' index 710;
|
||||||
function WinCopyRect(hab : cardinal;prclDst,prclSrc : PRectl) : longbool; cdecl;external 'pmwin' index 710;
|
function WinCopyRect(hab : cardinal;prclDst,prclSrc : PRectl) : longbool; cdecl;external 'pmwin' index 710;
|
||||||
function WinSetRect(hab : cardinal;var rcl : TRectl;xLeft,yBottom,xRight,yTop : longint) : longbool; cdecl;external 'pmwin' index 868;
|
function WinSetRect(hab : cardinal;var rcl : TRectl;xLeft,yBottom,xRight,yTop : longint) : longbool; cdecl;external 'pmwin' index 868;
|
||||||
function WinSetRect(hab : cardinal;prcl : PRectl;xLeft,yBottom,xRight,yTop : longint) : longbool; cdecl;external 'pmwin' index 868;
|
function WinSetRect(hab : cardinal;_prcl : PRectl;xLeft,yBottom,xRight,yTop : longint) : longbool; cdecl;external 'pmwin' index 868;
|
||||||
function WinIsRectEmpty(hab : cardinal;var rcl : TRectl) : longbool; cdecl;external 'pmwin' index 770;
|
function WinIsRectEmpty(hab : cardinal;var rcl : TRectl) : longbool; cdecl;external 'pmwin' index 770;
|
||||||
function WinIsRectEmpty(hab : cardinal;prcl : PRectl) : longbool; cdecl;external 'pmwin' index 770;
|
function WinIsRectEmpty(hab : cardinal;prcl : PRectl) : longbool; cdecl;external 'pmwin' index 770;
|
||||||
function WinEqualRect(hab : cardinal;var rcl1,rcl2 : TRectl) : longbool; cdecl;external 'pmwin' index 741;
|
function WinEqualRect(hab : cardinal;var rcl1,rcl2 : TRectl) : longbool; cdecl;external 'pmwin' index 741;
|
||||||
@ -2169,7 +2169,7 @@ const
|
|||||||
function WinUnionRect(hab : cardinal;prclDst,prclSrc1,prclSrc2 : PRectl) : longbool; cdecl;external 'pmwin' index 891;
|
function WinUnionRect(hab : cardinal;prclDst,prclSrc1,prclSrc2 : PRectl) : longbool; cdecl;external 'pmwin' index 891;
|
||||||
function WinSubtractRect(hab : cardinal;var rclDst,rclSrc1,rclSrc2 : TRectl) : longbool; cdecl;external 'pmwin' index 887;
|
function WinSubtractRect(hab : cardinal;var rclDst,rclSrc1,rclSrc2 : TRectl) : longbool; cdecl;external 'pmwin' index 887;
|
||||||
function WinSubtractRect(hab : cardinal;prclDst,prclSrc1,prclSrc2 : PRectl) : longbool; cdecl;external 'pmwin' index 887;
|
function WinSubtractRect(hab : cardinal;prclDst,prclSrc1,prclSrc2 : PRectl) : longbool; cdecl;external 'pmwin' index 887;
|
||||||
function WinMakeRect(hab : cardinal;var pwrc : TRectl) : longbool; cdecl;external 'pmwin' index 786;
|
function WinMakeRect(hab : cardinal;var wrc : TRectl) : longbool; cdecl;external 'pmwin' index 786;
|
||||||
function WinMakeRect(hab : cardinal;pwrc : PRectl) : longbool; cdecl;external 'pmwin' index 786;
|
function WinMakeRect(hab : cardinal;pwrc : PRectl) : longbool; cdecl;external 'pmwin' index 786;
|
||||||
function WinMakePoints(hab : cardinal;var wpt : TPointL;cwpt : cardinal) : longbool; cdecl;external 'pmwin' index 785;
|
function WinMakePoints(hab : cardinal;var wpt : TPointL;cwpt : cardinal) : longbool; cdecl;external 'pmwin' index 785;
|
||||||
function WinMakePoints(hab : cardinal;pwpt : PPointL;cwpt : cardinal) : longbool; cdecl;external 'pmwin' index 785;
|
function WinMakePoints(hab : cardinal;pwpt : PPointL;cwpt : cardinal) : longbool; cdecl;external 'pmwin' index 785;
|
||||||
@ -2265,7 +2265,7 @@ const
|
|||||||
function WinGetErrorInfo(hab : cardinal) : PERRINFO; cdecl;external 'pmwin' index 751;
|
function WinGetErrorInfo(hab : cardinal) : PERRINFO; cdecl;external 'pmwin' index 751;
|
||||||
function WinFreeErrorInfo(var perrinfo : ERRINFO) : longbool; cdecl;external 'pmwin' index 748;
|
function WinFreeErrorInfo(var perrinfo : ERRINFO) : longbool; cdecl;external 'pmwin' index 748;
|
||||||
function WinDdeInitiate(hwndClient : cardinal;pszAppName,pszTopicName : pchar;var cctxt : TConvContext) : longbool; cdecl;external 'pmwin' index 718;
|
function WinDdeInitiate(hwndClient : cardinal;pszAppName,pszTopicName : pchar;var cctxt : TConvContext) : longbool; cdecl;external 'pmwin' index 718;
|
||||||
function WinDdeInitiate(hwndClient : cardinal;pszAppName,pszTopicName : pchar;cctxt : PConvContext) : longbool; cdecl;external 'pmwin' index 718;
|
function WinDdeInitiate(hwndClient : cardinal;pszAppName,pszTopicName : pchar;pcctxt : PConvContext) : longbool; cdecl;external 'pmwin' index 718;
|
||||||
function WinDdeRespond(hwndClient,hwndServer : cardinal;pszAppName,pszTopicName : pchar;var cctxt : TConvContext) : pointer; cdecl;external 'pmwin' index 720;
|
function WinDdeRespond(hwndClient,hwndServer : cardinal;pszAppName,pszTopicName : pchar;var cctxt : TConvContext) : pointer; cdecl;external 'pmwin' index 720;
|
||||||
function WinDdeRespond(hwndClient,hwndServer : cardinal;pszAppName,pszTopicName : pchar;pcctxt : PConvContext) : pointer; cdecl;external 'pmwin' index 720;
|
function WinDdeRespond(hwndClient,hwndServer : cardinal;pszAppName,pszTopicName : pchar;pcctxt : PConvContext) : pointer; cdecl;external 'pmwin' index 720;
|
||||||
function WinDdePostMsg(hwndTo,hwndFrom,wm : cardinal;var ddest : DDEStruct;flOptions : cardinal) : longbool; cdecl;external 'pmwin' index 719;
|
function WinDdePostMsg(hwndTo,hwndFrom,wm : cardinal;var ddest : DDEStruct;flOptions : cardinal) : longbool; cdecl;external 'pmwin' index 719;
|
||||||
@ -2970,7 +2970,10 @@ const
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.3 2000-09-03 19:01:14 hajny
|
Revision 1.4 2001-05-20 18:40:34 hajny
|
||||||
|
* merging Carl's fixes from the fixes branch
|
||||||
|
|
||||||
|
Revision 1.3 2000/09/03 19:01:14 hajny
|
||||||
+ pmerr merged into PMWin
|
+ pmerr merged into PMWin
|
||||||
|
|
||||||
Revision 1.1.2.1 2000/09/03 18:23:12 hajny
|
Revision 1.1.2.1 2000/09/03 18:23:12 hajny
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/ prt0.s (emx+fpk) -- Made from crt0.s,
|
/ prt0.s (emx+fpc) -- Made from crt0.s,
|
||||||
/ Copyright (c) 1990-1999-2000 by Eberhard Mattes.
|
/ Copyright (c) 1990-1999-2001 by Eberhard Mattes.
|
||||||
/ Changed for Free Pascal in 1997 Daniel Mantione.
|
/ Changed for Free Pascal in 1997 Daniel Mantione.
|
||||||
/ This code is _not_ under the Library GNU Public
|
/ This code is _not_ under the Library GNU Public
|
||||||
/ License, because the original is not. See copying.emx
|
/ License, because the original is not. See copying.emx
|
||||||
@ -71,3 +71,4 @@ __heap_brk:
|
|||||||
.stabs "___DTOR_LIST__", 21, 0, 0, 0xffffffff
|
.stabs "___DTOR_LIST__", 21, 0, 0, 0xffffffff
|
||||||
.stabs "___crtinit1__", 21, 0, 0, 0xffffffff
|
.stabs "___crtinit1__", 21, 0, 0, 0xffffffff
|
||||||
.stabs "___crtexit1__", 21, 0, 0, 0xffffffff
|
.stabs "___crtexit1__", 21, 0, 0, 0xffffffff
|
||||||
|
.stabs "___eh_frame__", 21, 0, 0, 0xffffffff
|
||||||
|
@ -159,9 +159,43 @@ external 'DOSCALLS' index 255;
|
|||||||
function DosSetDefaultDisk (DiskNum:longint): longint; cdecl;
|
function DosSetDefaultDisk (DiskNum:longint): longint; cdecl;
|
||||||
external 'DOSCALLS' index 220;
|
external 'DOSCALLS' index 220;
|
||||||
|
|
||||||
|
{ This is not real prototype, but its close enough }
|
||||||
|
{ for us. (The 2nd parameter is acutally a pointer) }
|
||||||
|
{ to a structure. }
|
||||||
|
function DosCreateDir( Name : pchar; p : pointer): longint; cdecl;
|
||||||
|
external 'DOSCALLS' index 270;
|
||||||
|
|
||||||
|
function DosDeleteDir( Name : pchar) : longint; cdecl;
|
||||||
|
external 'DOSCALLS' index 226;
|
||||||
|
|
||||||
{This is the correct way to call external assembler procedures.}
|
{This is the correct way to call external assembler procedures.}
|
||||||
procedure syscall; external name '___SYSCALL';
|
procedure syscall; external name '___SYSCALL';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
{ converts an OS/2 error code to a TP compatible error }
|
||||||
|
{ code. Same thing exists under most other supported }
|
||||||
|
{ systems. }
|
||||||
|
{ Only call for OS/2 DLL imported routines }
|
||||||
|
Procedure Errno2InOutRes;
|
||||||
|
Begin
|
||||||
|
{ errors 1..18 are the same as in DOS }
|
||||||
|
case InOutRes of
|
||||||
|
{ simple offset to convert these error codes }
|
||||||
|
{ exactly like the error codes in Win32 }
|
||||||
|
19..31 : InOutRes := InOutRes + 131;
|
||||||
|
{ gets a bit more complicated ... }
|
||||||
|
32..33 : InOutRes := 5;
|
||||||
|
38 : InOutRes := 100;
|
||||||
|
39 : InOutRes := 101;
|
||||||
|
112 : InOutRes := 101;
|
||||||
|
110 : InOutRes := 5;
|
||||||
|
114 : InOutRes := 6;
|
||||||
|
290 : InOutRes := 290;
|
||||||
|
end;
|
||||||
|
{ all other cases ... we keep the same error code }
|
||||||
|
end;
|
||||||
|
|
||||||
{***************************************************************************
|
{***************************************************************************
|
||||||
|
|
||||||
Runtime error checking related routines.
|
Runtime error checking related routines.
|
||||||
@ -169,6 +203,23 @@ procedure syscall; external name '___SYSCALL';
|
|||||||
***************************************************************************}
|
***************************************************************************}
|
||||||
|
|
||||||
{$S-}
|
{$S-}
|
||||||
|
procedure st1(stack_size : longint); [public,alias : 'FPC_STACKCHECK'];
|
||||||
|
var
|
||||||
|
c: cardinal;
|
||||||
|
begin
|
||||||
|
c := cardinal(Sptr) - cardinal(stack_size) - 16384;
|
||||||
|
if os_mode = osos2 then
|
||||||
|
begin
|
||||||
|
if (c <= cardinal(StackBottom)) then
|
||||||
|
HandleError(202);
|
||||||
|
end
|
||||||
|
else
|
||||||
|
begin
|
||||||
|
if (c <= cardinal(heap_brk)) then
|
||||||
|
HandleError(202);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
(*
|
||||||
procedure st1(stack_size:longint); assembler; [public,alias: 'FPC_STACKCHECK'];
|
procedure st1(stack_size:longint); assembler; [public,alias: 'FPC_STACKCHECK'];
|
||||||
{ called when trying to get local stack }
|
{ called when trying to get local stack }
|
||||||
{ if the compiler directive $S is set }
|
{ if the compiler directive $S is set }
|
||||||
@ -198,6 +249,7 @@ asm
|
|||||||
call HandleError
|
call HandleError
|
||||||
end ['EAX','EBX'];
|
end ['EAX','EBX'];
|
||||||
{no stack check in system }
|
{no stack check in system }
|
||||||
|
*)
|
||||||
|
|
||||||
{****************************************************************************
|
{****************************************************************************
|
||||||
|
|
||||||
@ -222,26 +274,33 @@ asm
|
|||||||
decl %eax
|
decl %eax
|
||||||
end ['EAX'];
|
end ['EAX'];
|
||||||
|
|
||||||
function paramstr(l:longint):string;
|
|
||||||
|
|
||||||
function args:pointer;assembler;
|
function args:pointer;assembler;
|
||||||
|
|
||||||
asm
|
asm
|
||||||
movl argv,%eax
|
movl argv,%eax
|
||||||
end ['EAX'];
|
end ['EAX'];
|
||||||
|
|
||||||
|
|
||||||
|
function paramstr(l:longint):string;
|
||||||
|
|
||||||
var p:^Pchar;
|
var p:^Pchar;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
|
{ There seems to be a problem with EMX for DOS when trying to }
|
||||||
|
{ access paramstr(0), and to avoid problems between DOS and }
|
||||||
|
{ OS/2 they have been separated. }
|
||||||
|
if os_Mode = OsOs2 then
|
||||||
|
begin
|
||||||
if L = 0 then
|
if L = 0 then
|
||||||
begin
|
begin
|
||||||
GetMem (P, 260);
|
GetMem (P, 260);
|
||||||
|
p[0] := #0; { in case of error, initialize to empty string }
|
||||||
{$ASMMODE INTEL}
|
{$ASMMODE INTEL}
|
||||||
asm
|
asm
|
||||||
mov edx, P
|
mov edx, P
|
||||||
mov ecx, 260
|
mov ecx, 260
|
||||||
mov eax, 7F33h
|
mov eax, 7F33h
|
||||||
call syscall
|
call syscall { error handle already with empty string }
|
||||||
end;
|
end;
|
||||||
ParamStr := StrPas (PChar (P));
|
ParamStr := StrPas (PChar (P));
|
||||||
FreeMem (P, 260);
|
FreeMem (P, 260);
|
||||||
@ -253,23 +312,14 @@ begin
|
|||||||
paramstr:=strpas(p[l]);
|
paramstr:=strpas(p[l]);
|
||||||
end
|
end
|
||||||
else paramstr:='';
|
else paramstr:='';
|
||||||
end;
|
end
|
||||||
|
else
|
||||||
{
|
begin
|
||||||
procedure randomize;
|
p:=args;
|
||||||
|
paramstr:=strpas(p[l]);
|
||||||
var hl:longint;
|
|
||||||
|
|
||||||
begin
|
|
||||||
asm
|
|
||||||
movb $0x2c,%ah
|
|
||||||
call syscall
|
|
||||||
movw %cx,-4(%ebp)
|
|
||||||
movw %dx,-2(%ebp)
|
|
||||||
end;
|
end;
|
||||||
randseed:=hl;
|
|
||||||
end;
|
end;
|
||||||
}
|
|
||||||
|
|
||||||
procedure randomize; assembler;
|
procedure randomize; assembler;
|
||||||
asm
|
asm
|
||||||
@ -295,7 +345,7 @@ function sbrk(size:longint):longint; assembler;
|
|||||||
asm
|
asm
|
||||||
movl size,%edx
|
movl size,%edx
|
||||||
movw $0x7f00,%ax
|
movw $0x7f00,%ax
|
||||||
call syscall
|
call syscall { result directly in EAX }
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function getheapstart:pointer;assembler;
|
function getheapstart:pointer;assembler;
|
||||||
@ -333,12 +383,15 @@ procedure do_close(h:longint);
|
|||||||
begin
|
begin
|
||||||
{ Only three standard handles under real OS/2 }
|
{ Only three standard handles under real OS/2 }
|
||||||
if (h > 4) or
|
if (h > 4) or
|
||||||
(os_MODE = osOS2) and (h > 2) then
|
((os_MODE = osOS2) and (h > 2)) then
|
||||||
begin
|
begin
|
||||||
asm
|
asm
|
||||||
movb $0x3e,%ah
|
movb $0x3e,%ah
|
||||||
movl h,%ebx
|
movl h,%ebx
|
||||||
call syscall
|
call syscall
|
||||||
|
jnc .Lnoerror { error code? }
|
||||||
|
movw %ax, InOutRes { yes, then set InOutRes }
|
||||||
|
.Lnoerror:
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@ -388,6 +441,9 @@ end;
|
|||||||
|
|
||||||
function do_write(h,addr,len:longint) : longint; assembler;
|
function do_write(h,addr,len:longint) : longint; assembler;
|
||||||
asm
|
asm
|
||||||
|
xorl %eax,%eax
|
||||||
|
cmpl $0,len { 0 bytes to write is undefined behavior }
|
||||||
|
jz .LDOSWRITE1
|
||||||
movl len,%ecx
|
movl len,%ecx
|
||||||
movl addr,%edx
|
movl addr,%edx
|
||||||
movl h,%ebx
|
movl h,%ebx
|
||||||
@ -445,26 +501,14 @@ end;
|
|||||||
|
|
||||||
procedure do_truncate(handle,pos:longint); assembler;
|
procedure do_truncate(handle,pos:longint); assembler;
|
||||||
asm
|
asm
|
||||||
(* DOS function 40h isn't safe for this according to EMX documentation
|
(* DOS function 40h isn't safe for this according to EMX documentation *)
|
||||||
movl $0x4200,%eax
|
|
||||||
movl handle,%ebx
|
|
||||||
movl pos,%edx
|
|
||||||
call syscall
|
|
||||||
jc .LTruncate1
|
|
||||||
movl handle,%ebx
|
|
||||||
movl pos,%edx
|
|
||||||
movl %ebp,%edx
|
|
||||||
xorl %ecx,%ecx
|
|
||||||
movb $0x40,%ah
|
|
||||||
call syscall
|
|
||||||
*)
|
|
||||||
movl $0x7F25,%eax
|
movl $0x7F25,%eax
|
||||||
movl Handle,%ebx
|
movl Handle,%ebx
|
||||||
movl Pos,%edx
|
movl Pos,%edx
|
||||||
call syscall
|
call syscall
|
||||||
inc %eax
|
incl %eax
|
||||||
movl %ecx, %eax
|
movl %ecx, %eax
|
||||||
jnz .LTruncate1
|
jnz .LTruncate1 { compare the value of EAX to verify error }
|
||||||
(* File position is undefined after truncation, move to the end. *)
|
(* File position is undefined after truncation, move to the end. *)
|
||||||
movl $0x4202,%eax
|
movl $0x4202,%eax
|
||||||
movl Handle,%ebx
|
movl Handle,%ebx
|
||||||
@ -588,8 +632,8 @@ begin
|
|||||||
movw %cx, InOutRes
|
movw %cx, InOutRes
|
||||||
movw UnusedHandle, %ax
|
movw UnusedHandle, %ax
|
||||||
.LOPEN1:
|
.LOPEN1:
|
||||||
movl f,%edx
|
movl f,%edx { Warning : This assumes Handle is first }
|
||||||
movw %ax,(%edx)
|
movw %ax,(%edx) { field of FileRec }
|
||||||
end;
|
end;
|
||||||
if (InOutRes = 4) and Increase_File_Handle_Count then
|
if (InOutRes = 4) and Increase_File_Handle_Count then
|
||||||
(* Trying again after increasing amount of file handles *)
|
(* Trying again after increasing amount of file handles *)
|
||||||
@ -633,9 +677,9 @@ asm
|
|||||||
call syscall
|
call syscall
|
||||||
mov eax, 1
|
mov eax, 1
|
||||||
jc @IsDevEnd
|
jc @IsDevEnd
|
||||||
test edx, 80h
|
test edx, 80h { verify if it is a file }
|
||||||
jnz @IsDevEnd
|
jnz @IsDevEnd
|
||||||
dec eax
|
dec eax { nope, so result is zero }
|
||||||
@IsDevEnd:
|
@IsDevEnd:
|
||||||
end;
|
end;
|
||||||
{$ASMMODE ATT}
|
{$ASMMODE ATT}
|
||||||
@ -671,6 +715,7 @@ end;
|
|||||||
Directory Handling
|
Directory Handling
|
||||||
*****************************************************************************}
|
*****************************************************************************}
|
||||||
|
|
||||||
|
|
||||||
procedure dosdir(func:byte;const s:string);
|
procedure dosdir(func:byte;const s:string);
|
||||||
|
|
||||||
var buffer:array[0..255] of char;
|
var buffer:array[0..255] of char;
|
||||||
@ -690,26 +735,66 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
procedure MkDir (const S: string);
|
procedure MkDir (const S: string);[IOCHECK];
|
||||||
|
|
||||||
|
var buffer:array[0..255] of char;
|
||||||
|
Rc : word;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
If (s='') or (InOutRes <> 0) then
|
If (s='') or (InOutRes <> 0) then
|
||||||
exit;
|
exit;
|
||||||
|
if os_mode = osOs2 then
|
||||||
|
begin
|
||||||
|
move(s[1],buffer,length(s));
|
||||||
|
buffer[length(s)]:=#0;
|
||||||
|
allowslash(Pchar(@buffer));
|
||||||
|
Rc := DosCreateDir(buffer,nil);
|
||||||
|
if Rc <> 0 then
|
||||||
|
begin
|
||||||
|
InOutRes := Rc;
|
||||||
|
Errno2Inoutres;
|
||||||
|
end;
|
||||||
|
end
|
||||||
|
else
|
||||||
|
begin
|
||||||
|
{ Under EMX 0.9d DOS this routine call may sometimes fail }
|
||||||
|
{ The syscall documentation indicates clearly that this }
|
||||||
|
{ routine was NOT tested. }
|
||||||
DosDir ($39, S);
|
DosDir ($39, S);
|
||||||
end;
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
procedure rmdir(const s : string);
|
procedure rmdir(const s : string);[IOCHECK];
|
||||||
|
var buffer:array[0..255] of char;
|
||||||
|
Rc : word;
|
||||||
begin
|
begin
|
||||||
If (s='') or (InOutRes <> 0) then
|
If (s='') or (InOutRes <> 0) then
|
||||||
exit;
|
exit;
|
||||||
|
if os_mode = osOs2 then
|
||||||
|
begin
|
||||||
|
move(s[1],buffer,length(s));
|
||||||
|
buffer[length(s)]:=#0;
|
||||||
|
allowslash(Pchar(@buffer));
|
||||||
|
Rc := DosDeleteDir(buffer);
|
||||||
|
if Rc <> 0 then
|
||||||
|
begin
|
||||||
|
InOutRes := Rc;
|
||||||
|
Errno2Inoutres;
|
||||||
|
end;
|
||||||
|
end
|
||||||
|
else
|
||||||
|
begin
|
||||||
|
{ Under EMX 0.9d DOS this routine call may sometimes fail }
|
||||||
|
{ The syscall documentation indicates clearly that this }
|
||||||
|
{ routine was NOT tested. }
|
||||||
DosDir ($3A, S);
|
DosDir ($3A, S);
|
||||||
end;
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
{$ASMMODE INTEL}
|
{$ASMMODE INTEL}
|
||||||
|
|
||||||
procedure ChDir (const S: string);
|
procedure ChDir (const S: string);[IOCheck];
|
||||||
|
|
||||||
var RC: longint;
|
var RC: longint;
|
||||||
Buffer: array [0..255] of char;
|
Buffer: array [0..255] of char;
|
||||||
@ -735,7 +820,10 @@ begin
|
|||||||
AllowSlash (PChar (@Buffer));
|
AllowSlash (PChar (@Buffer));
|
||||||
RC := DosSetCurrentDir (@Buffer);
|
RC := DosSetCurrentDir (@Buffer);
|
||||||
if RC <> 0 then
|
if RC <> 0 then
|
||||||
|
begin
|
||||||
InOutRes := RC;
|
InOutRes := RC;
|
||||||
|
Errno2InOutRes;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
@ -745,7 +833,10 @@ begin
|
|||||||
AllowSlash (PChar (@Buffer));
|
AllowSlash (PChar (@Buffer));
|
||||||
RC := DosSetCurrentDir (@Buffer);
|
RC := DosSetCurrentDir (@Buffer);
|
||||||
if RC <> 0 then
|
if RC <> 0 then
|
||||||
InOutRes := RC;
|
begin
|
||||||
|
InOutRes:= RC;
|
||||||
|
Errno2InOutRes;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
@ -767,9 +858,13 @@ begin
|
|||||||
@LCHDIR:
|
@LCHDIR:
|
||||||
end;
|
end;
|
||||||
if (Length (S) > 2) and (InOutRes <> 0) then
|
if (Length (S) > 2) and (InOutRes <> 0) then
|
||||||
|
{ Under EMX 0.9d DOS this routine may sometime }
|
||||||
|
{ fail or crash the system. }
|
||||||
DosDir ($3B, S);
|
DosDir ($3B, S);
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
|
{ Under EMX 0.9d DOS this routine may sometime }
|
||||||
|
{ fail or crash the system. }
|
||||||
DosDir ($3B, S);
|
DosDir ($3B, S);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -894,7 +989,9 @@ begin
|
|||||||
call HandleError
|
call HandleError
|
||||||
@heapok:
|
@heapok:
|
||||||
end;
|
end;
|
||||||
|
{ in OS/2 this will always be nil, but in DOS mode }
|
||||||
|
{ this can be changed. }
|
||||||
|
first_meg := nil;
|
||||||
{Now request, if we are running under DOS,
|
{Now request, if we are running under DOS,
|
||||||
read-access to the first meg. of memory.}
|
read-access to the first meg. of memory.}
|
||||||
if os_mode in [osDOS,osDPMI] then
|
if os_mode in [osDOS,osDPMI] then
|
||||||
@ -904,11 +1001,12 @@ begin
|
|||||||
mov ecx, 0FFFh
|
mov ecx, 0FFFh
|
||||||
xor edx, edx
|
xor edx, edx
|
||||||
call syscall
|
call syscall
|
||||||
|
jnc @endmem
|
||||||
mov first_meg, eax
|
mov first_meg, eax
|
||||||
|
@endmem:
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
first_meg := nil;
|
|
||||||
(* Initialize the amount of file handles *)
|
(* Initialize the amount of file handles *)
|
||||||
FileHandleCount := GetFileHandleCount;
|
FileHandleCount := GetFileHandleCount;
|
||||||
end;
|
end;
|
||||||
@ -920,7 +1018,7 @@ begin
|
|||||||
osOS2:
|
osOS2:
|
||||||
begin
|
begin
|
||||||
dosgetinfoblocks(@tib,nil);
|
dosgetinfoblocks(@tib,nil);
|
||||||
stackbottom:=longint(tib^.stack);
|
stackbottom:=cardinal(tib^.stack);
|
||||||
end;
|
end;
|
||||||
osDPMI:
|
osDPMI:
|
||||||
stackbottom:=0; {Not sure how to get it, but seems to be
|
stackbottom:=0; {Not sure how to get it, but seems to be
|
||||||
@ -958,7 +1056,10 @@ begin
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.12 2001-04-20 19:05:11 hajny
|
Revision 1.13 2001-05-20 18:40:32 hajny
|
||||||
|
* merging Carl's fixes from the fixes branch
|
||||||
|
|
||||||
|
Revision 1.12 2001/04/20 19:05:11 hajny
|
||||||
* setne operand size fixed
|
* setne operand size fixed
|
||||||
|
|
||||||
Revision 1.11 2001/03/21 23:29:40 florian
|
Revision 1.11 2001/03/21 23:29:40 florian
|
||||||
|
@ -529,7 +529,7 @@ begin
|
|||||||
if (os_mode = osDOS) or (os_mode = osDPMI) then
|
if (os_mode = osDOS) or (os_mode = osDPMI) then
|
||||||
{Function 36 is not supported in OS/2.}
|
{Function 36 is not supported in OS/2.}
|
||||||
asm
|
asm
|
||||||
movb 8(%ebp),%dl
|
movb Drive,%dl
|
||||||
movb $0x36,%ah
|
movb $0x36,%ah
|
||||||
call syscall
|
call syscall
|
||||||
cmpw $-1,%ax
|
cmpw $-1,%ax
|
||||||
@ -538,6 +538,7 @@ begin
|
|||||||
mulw %bx
|
mulw %bx
|
||||||
shll $16,%edx
|
shll $16,%edx
|
||||||
movw %ax,%dx
|
movw %ax,%dx
|
||||||
|
movl $0,%eax
|
||||||
xchgl %edx,%eax
|
xchgl %edx,%eax
|
||||||
leave
|
leave
|
||||||
ret
|
ret
|
||||||
@ -567,7 +568,7 @@ begin
|
|||||||
if (os_mode = osDOS) or (os_mode = osDPMI) then
|
if (os_mode = osDOS) or (os_mode = osDPMI) then
|
||||||
{Function 36 is not supported in OS/2.}
|
{Function 36 is not supported in OS/2.}
|
||||||
asm
|
asm
|
||||||
movb 8(%ebp),%dl
|
Drive,%dl
|
||||||
movb $0x36,%ah
|
movb $0x36,%ah
|
||||||
call syscall
|
call syscall
|
||||||
movw %dx,%bx
|
movw %dx,%bx
|
||||||
@ -577,6 +578,7 @@ begin
|
|||||||
mulw %bx
|
mulw %bx
|
||||||
shll $16,%edx
|
shll $16,%edx
|
||||||
movw %ax,%dx
|
movw %ax,%dx
|
||||||
|
movl $0,%eax
|
||||||
xchgl %edx,%eax
|
xchgl %edx,%eax
|
||||||
leave
|
leave
|
||||||
ret
|
ret
|
||||||
@ -704,7 +706,7 @@ end;
|
|||||||
procedure InitInternational;
|
procedure InitInternational;
|
||||||
var Country: TCountryCode;
|
var Country: TCountryCode;
|
||||||
CtryInfo: TCountryInfo;
|
CtryInfo: TCountryInfo;
|
||||||
Size: cardinal;
|
Size: longint;
|
||||||
RC: longint;
|
RC: longint;
|
||||||
begin
|
begin
|
||||||
Size := 0;
|
Size := 0;
|
||||||
@ -759,7 +761,6 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
{****************************************************************************
|
{****************************************************************************
|
||||||
Initialization code
|
Initialization code
|
||||||
****************************************************************************}
|
****************************************************************************}
|
||||||
@ -774,7 +775,10 @@ end.
|
|||||||
|
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.9 2001-02-21 21:23:38 hajny
|
Revision 1.10 2001-05-20 18:40:33 hajny
|
||||||
|
* merging Carl's fixes from the fixes branch
|
||||||
|
|
||||||
|
Revision 1.9 2001/02/21 21:23:38 hajny
|
||||||
* GetEnvironmentVariable now really merged
|
* GetEnvironmentVariable now really merged
|
||||||
|
|
||||||
Revision 1.8 2001/02/20 22:14:19 peter
|
Revision 1.8 2001/02/20 22:14:19 peter
|
||||||
|
@ -16,6 +16,11 @@ finish PM support high
|
|||||||
- PMBitmap................................................RB
|
- PMBitmap................................................RB
|
||||||
- PMStdDlg
|
- PMStdDlg
|
||||||
|
|
||||||
|
RTL
|
||||||
|
- sockets
|
||||||
|
- graph
|
||||||
|
- pass dos compatibility tests
|
||||||
|
|
||||||
? enhance ld linker high
|
? enhance ld linker high
|
||||||
|
|
||||||
libgdb medium
|
libgdb medium
|
||||||
|
Loading…
Reference in New Issue
Block a user