diff --git a/kernel/dosfns.c b/kernel/dosfns.c index f7430be..b42834e 100644 --- a/kernel/dosfns.c +++ b/kernel/dosfns.c @@ -225,18 +225,17 @@ long DosRWSft(int sft_idx, size_t n, void FAR * bp, int mode) */ if (s->sft_flags & SFT_FSHARED) { - UCOUNT XferCount; + long XferCount; VOID FAR *save_dta; - int err; save_dta = dta; lpCurSft = s; current_filepos = s->sft_posit; /* needed for MSCDEX */ dta = bp; - XferCount = network_redirector_rw(mode == XFR_READ ? REM_READ : REM_WRITE, - s, n, &err); + XferCount = network_redirector_mx(mode == XFR_READ ? REM_READ : REM_WRITE, + s, n); dta = save_dta; - return err == SUCCESS ? (long)XferCount : err; + return XferCount; } /* Do a device transfer if device */ @@ -566,7 +565,7 @@ long DosOpenSft(char FAR * fname, unsigned flags, unsigned attrib) cmd = REM_OPEN; attrib = (BYTE)flags; } - status = network_redirector_open(cmd, sftp, attrib); + status = (int)network_redirector_mx(cmd, sftp, attrib); if (status >= SUCCESS) { if (sftp->sft_count == 0) diff --git a/kernel/int2f.asm b/kernel/int2f.asm index d992616..32827a0 100644 --- a/kernel/int2f.asm +++ b/kernel/int2f.asm @@ -313,9 +313,9 @@ remote_getfattr: jc no_clear_ax jmp short no_neg_ax -;int ASMPASCAL network_redirector_open(unsigned cmd, void far *s, unsigned arg) - global NETWORK_REDIRECTOR_OPEN -NETWORK_REDIRECTOR_OPEN: +;long ASMPASCAL network_redirector_mx(unsigned cmd, void far *s, unsigned arg) + global NETWORK_REDIRECTOR_MX +NETWORK_REDIRECTOR_MX: pop bx ; ret address pop cx ; stack value (arg) pop dx ; off s @@ -326,9 +326,14 @@ call_int2f: push bp push si push di - mov di, dx ; es:di -> s cmp al, 0fh je remote_getfattr + + mov di, dx ; es:di -> s + cmp al, 08h + je remote_rw + cmp al, 09h + je remote_rw push cx ; arg int2f_call: @@ -398,6 +403,17 @@ _remote_getfree: xor cx, cx jmp short clear_ax +remote_rw: + clc ; set to succeed + int 2fh + jc int2f_carry + mov ax, cx + xor dx, dx ; dx:ax = bytes read + jmp short no_neg_ax +int2f_carry: neg ax + cwd + jmp short no_neg_ax + global _QRemote_Fn _QRemote_Fn: push bp @@ -414,27 +430,8 @@ _QRemote_Fn: mov ax,0xffff jc no_neg_ax xor cx, cx - jmp short clear_ax + jmp clear_ax - global _network_redirector_rw -_network_redirector_rw: - push bp - mov bp, sp - push si - push di - mov ax, [bp+4] - les di, [bp+6] - mov cx, [bp+10] - clc ; set to succeed - int 2fh - jc int2f_carry - xor ax, ax -int2f_carry: neg ax - mov di, [bp+12] - mov [di], ax - mov ax, cx - jmp no_neg_ax - global _remote_process_end _remote_process_end: ; Terminate process mov ds, [_cu_psp] diff --git a/kernel/network.c b/kernel/network.c index 5799797..5004243 100644 --- a/kernel/network.c +++ b/kernel/network.c @@ -53,7 +53,7 @@ VOID set_machine_name(BYTE FAR * netname, UWORD name_num) int network_redirector_fp(unsigned cmd, void far *s) { - return network_redirector_open(cmd, s, 0); + return (int)network_redirector_mx(cmd, s, 0); } int network_redirector(unsigned cmd) diff --git a/kernel/proto.h b/kernel/proto.h index 015415e..68dae7e 100644 --- a/kernel/proto.h +++ b/kernel/proto.h @@ -381,9 +381,7 @@ COUNT truename(const char FAR * src, char * dest, COUNT t); /* network.c */ int network_redirector(unsigned cmd); int network_redirector_fp(unsigned cmd, void far *s); -int ASMPASCAL network_redirector_open(unsigned cmd, void far *s, unsigned arg); -unsigned ASMCFUNC network_redirector_rw(unsigned cmd, void far *s, - unsigned n, int *err); +long ASMPASCAL network_redirector_mx(unsigned cmd, void far *s, unsigned arg); COUNT ASMCFUNC remote_doredirect(UWORD b, UCOUNT n, UWORD d, VOID FAR * s, UWORD i, VOID FAR * data); COUNT ASMCFUNC remote_printset(UWORD b, UCOUNT n, UWORD d, VOID FAR * s,