Re-merge parts of network_redirector_rw with network_redirector_open,

and let it return a long instead of using a *err pointer.
Call the resulting function NETWORK_REDIRECTOR_MX (multiplex)


git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@893 6ac86273-5f31-0410-b378-82cca8765d1b
This commit is contained in:
Bart Oldeman 2004-04-21 02:01:56 +00:00
parent 4dc4ae8be8
commit 01e5973aa0
4 changed files with 28 additions and 34 deletions

View File

@ -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)

View File

@ -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,26 +430,7 @@ _QRemote_Fn:
mov ax,0xffff
jc no_neg_ax
xor cx, cx
jmp short 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
jmp clear_ax
global _remote_process_end
_remote_process_end: ; Terminate process

View File

@ -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)

View File

@ -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,