mirror of https://github.com/FDOS/kernel.git
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:
parent
4dc4ae8be8
commit
01e5973aa0
|
@ -225,18 +225,17 @@ long DosRWSft(int sft_idx, size_t n, void FAR * bp, int mode)
|
||||||
*/
|
*/
|
||||||
if (s->sft_flags & SFT_FSHARED)
|
if (s->sft_flags & SFT_FSHARED)
|
||||||
{
|
{
|
||||||
UCOUNT XferCount;
|
long XferCount;
|
||||||
VOID FAR *save_dta;
|
VOID FAR *save_dta;
|
||||||
int err;
|
|
||||||
|
|
||||||
save_dta = dta;
|
save_dta = dta;
|
||||||
lpCurSft = s;
|
lpCurSft = s;
|
||||||
current_filepos = s->sft_posit; /* needed for MSCDEX */
|
current_filepos = s->sft_posit; /* needed for MSCDEX */
|
||||||
dta = bp;
|
dta = bp;
|
||||||
XferCount = network_redirector_rw(mode == XFR_READ ? REM_READ : REM_WRITE,
|
XferCount = network_redirector_mx(mode == XFR_READ ? REM_READ : REM_WRITE,
|
||||||
s, n, &err);
|
s, n);
|
||||||
dta = save_dta;
|
dta = save_dta;
|
||||||
return err == SUCCESS ? (long)XferCount : err;
|
return XferCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Do a device transfer if device */
|
/* Do a device transfer if device */
|
||||||
|
@ -566,7 +565,7 @@ long DosOpenSft(char FAR * fname, unsigned flags, unsigned attrib)
|
||||||
cmd = REM_OPEN;
|
cmd = REM_OPEN;
|
||||||
attrib = (BYTE)flags;
|
attrib = (BYTE)flags;
|
||||||
}
|
}
|
||||||
status = network_redirector_open(cmd, sftp, attrib);
|
status = (int)network_redirector_mx(cmd, sftp, attrib);
|
||||||
if (status >= SUCCESS)
|
if (status >= SUCCESS)
|
||||||
{
|
{
|
||||||
if (sftp->sft_count == 0)
|
if (sftp->sft_count == 0)
|
||||||
|
|
|
@ -313,9 +313,9 @@ remote_getfattr:
|
||||||
jc no_clear_ax
|
jc no_clear_ax
|
||||||
jmp short no_neg_ax
|
jmp short no_neg_ax
|
||||||
|
|
||||||
;int ASMPASCAL network_redirector_open(unsigned cmd, void far *s, unsigned arg)
|
;long ASMPASCAL network_redirector_mx(unsigned cmd, void far *s, unsigned arg)
|
||||||
global NETWORK_REDIRECTOR_OPEN
|
global NETWORK_REDIRECTOR_MX
|
||||||
NETWORK_REDIRECTOR_OPEN:
|
NETWORK_REDIRECTOR_MX:
|
||||||
pop bx ; ret address
|
pop bx ; ret address
|
||||||
pop cx ; stack value (arg)
|
pop cx ; stack value (arg)
|
||||||
pop dx ; off s
|
pop dx ; off s
|
||||||
|
@ -326,9 +326,14 @@ call_int2f:
|
||||||
push bp
|
push bp
|
||||||
push si
|
push si
|
||||||
push di
|
push di
|
||||||
mov di, dx ; es:di -> s
|
|
||||||
cmp al, 0fh
|
cmp al, 0fh
|
||||||
je remote_getfattr
|
je remote_getfattr
|
||||||
|
|
||||||
|
mov di, dx ; es:di -> s
|
||||||
|
cmp al, 08h
|
||||||
|
je remote_rw
|
||||||
|
cmp al, 09h
|
||||||
|
je remote_rw
|
||||||
push cx ; arg
|
push cx ; arg
|
||||||
|
|
||||||
int2f_call:
|
int2f_call:
|
||||||
|
@ -398,6 +403,17 @@ _remote_getfree:
|
||||||
xor cx, cx
|
xor cx, cx
|
||||||
jmp short clear_ax
|
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
|
global _QRemote_Fn
|
||||||
_QRemote_Fn:
|
_QRemote_Fn:
|
||||||
push bp
|
push bp
|
||||||
|
@ -414,27 +430,8 @@ _QRemote_Fn:
|
||||||
mov ax,0xffff
|
mov ax,0xffff
|
||||||
jc no_neg_ax
|
jc no_neg_ax
|
||||||
xor cx, cx
|
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
|
global _remote_process_end
|
||||||
_remote_process_end: ; Terminate process
|
_remote_process_end: ; Terminate process
|
||||||
mov ds, [_cu_psp]
|
mov ds, [_cu_psp]
|
||||||
|
|
|
@ -53,7 +53,7 @@ VOID set_machine_name(BYTE FAR * netname, UWORD name_num)
|
||||||
|
|
||||||
int network_redirector_fp(unsigned cmd, void far *s)
|
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)
|
int network_redirector(unsigned cmd)
|
||||||
|
|
|
@ -381,9 +381,7 @@ COUNT truename(const char FAR * src, char * dest, COUNT t);
|
||||||
/* network.c */
|
/* network.c */
|
||||||
int network_redirector(unsigned cmd);
|
int network_redirector(unsigned cmd);
|
||||||
int network_redirector_fp(unsigned cmd, void far *s);
|
int network_redirector_fp(unsigned cmd, void far *s);
|
||||||
int ASMPASCAL network_redirector_open(unsigned cmd, void far *s, unsigned arg);
|
long ASMPASCAL network_redirector_mx(unsigned cmd, void far *s, unsigned arg);
|
||||||
unsigned ASMCFUNC network_redirector_rw(unsigned cmd, void far *s,
|
|
||||||
unsigned n, int *err);
|
|
||||||
COUNT ASMCFUNC remote_doredirect(UWORD b, UCOUNT n, UWORD d, VOID FAR * s,
|
COUNT ASMCFUNC remote_doredirect(UWORD b, UCOUNT n, UWORD d, VOID FAR * s,
|
||||||
UWORD i, VOID FAR * data);
|
UWORD i, VOID FAR * data);
|
||||||
COUNT ASMCFUNC remote_printset(UWORD b, UCOUNT n, UWORD d, VOID FAR * s,
|
COUNT ASMCFUNC remote_printset(UWORD b, UCOUNT n, UWORD d, VOID FAR * s,
|
||||||
|
|
Loading…
Reference in New Issue