int2f: make share_open_check() to accept FAR

Fixes problem with GCC-ia16 compiled share not allowing open of files.
It seems that the TCC 2.01 compiled version was fortunate in that DS
happened to be correct when the interrupt was called, but this was
not the case for the GCC ia16 compiled version.

It's an analogue of this patch by @stsp for FDPP.
https://github.com/dosemu2/fdpp/commit/5b52510b
This commit is contained in:
Andrew Bird 2021-09-25 18:54:34 +01:00 committed by Kenneth J Davis
parent 5b9e8fedcc
commit 4b3f7e0088
2 changed files with 9 additions and 5 deletions

View File

@ -46,7 +46,7 @@ BYTE share_installed = 0;
code, so DOS simply negates this value and returns it in
AX. */
extern int ASMPASCAL
share_open_check(char * filename, /* pointer to fully qualified filename */
share_open_check(const char FAR * filename, /* pointer to fully qualified filename */
unsigned short pspseg, /* psp segment address of owner process */
int openmode, /* 0=read-only, 1=write-only, 2=read-write */
int sharemode); /* SHARE_COMPAT, etc... */

View File

@ -258,7 +258,7 @@ SHARE_CHECK:
; error. If < 0 is returned, it is the negated error return
; code, so DOS simply negates this value and returns it in
; AX.
; STATIC int share_open_check(char * filename,
; STATIC int share_open_check(const char FAR * filename,
; /* pointer to fully qualified filename */
; unsigned short pspseg,
; /* psp segment address of owner process */
@ -267,13 +267,17 @@ SHARE_CHECK:
; int sharemode) /* SHARE_COMPAT, etc... */
global SHARE_OPEN_CHECK
SHARE_OPEN_CHECK:
mov es, si ; save si
push ds
pop es ; save ds
mov di, si ; save si
pop ax ; return address
popargs si,bx,cx,dx ; filename,pspseg,openmode,sharemode;
popargs {ds,si},bx,cx,dx; filename,pspseg,openmode,sharemode;
push ax ; return address
mov ax, 0x10a0
int 0x2f ; returns ax
mov si, es ; restore si
mov si, di ; restore si
push es
pop ds ; restore ds
ret
; DOS calls this to record the fact that it has successfully