home *** CD-ROM | disk | FTP | other *** search
- ;/*
- ;** redirect.asm
- ;** contains: getreent(),redirdev(),canredir(),
- ;*/
-
- GETREDIRECTIONLIST equ 05f02h ;Get Redirection List Entry
- REDIRECTDEVICE equ 05f03h ;Redirect Device function #
- CANCELREDIRECTION equ 05f04h ;Cancel redirection
- DOSCALL equ 021h ;DOS Software Interrupt
-
- include model.h
- include prologue.h
-
- pseg cRedirect
-
- ;/*
- ;** int
- ;** getreent(unsigned index, char *localdevname,
- ;** char *networkname,unsigned char *devicestatus,
- ;** unsigned char *devicetype,unsigned *hide);
- ;**
- ;** ARGUMENT(s)
- ;** index - Redirection index (zero based)
- ;** localdevname - Points to 128-byte buffer address
- ;** of the local device name.
- ;** networkname - Points to a 128-byte buffer address of
- ;** network name.
- ;** devicestatus - Points to a 8 bit value that gets the
- ;** device status flag. Bit 0 = 0 if device
- ;** is valid. Bit 0 = 1 if device is not
- ;** valid.
- ;** devicetype - Points to a 8 bit value that gets the
- ;** device type.
- ;** hide - Word programmer can use.
- ;**
- ;** DESCRIPTION
- ;** Returns nonlocal network assignments. The IBM PC Network Program must
- ;** be loaded for the function call to execute properly.
- ;**
- ;** RETURNS
- ;** 0 if successful, else dos error code.
- ;**
- ;** AUTHOR
- ;** "" Fri 11-Nov-1988 16:50:19
- ;** Copyright (C)1988-1990 Greenleaf Software Inc. All Rights Reserved.
- ;**
- ;** MODIFICATIONS
- ;**
- ;*/
- cproc getreent
- mov ax,GETREDIRECTIONLIST
- if _LDATA
- push ds
- push es
- lds si,parm2_
- les di,parm4_
- else
- push es
- mov bx,ds
- mov es,bx
- mov si,parm2_
- mov di,parm3_
- endif
- push bp
- int DOSCALL
- pop bp
- jc getredirexit
-
- if _LDATA
- lds si,parm6_ ;DS:SI->device status
- else
- mov si,parm4_ ;DS:SI->device status
- endif
- mov [si],bh ;save flag
-
- if _LDATA
- lds si,parm8_ ;DS:SI->devicetype
- else
- mov si,parm5_
- endif
- mov [si],bl ;save flag
- if _LDATA
- lds si,parm10_
- else
- mov si,parm6_ ;DS:SI-> User word
- endif
- mov [si],cx ;save users word
- xor ax,ax
- getredirexit:
- if _LDATA
- pop es
- pop ds
- else
- pop es
- endif
- cproce
-
-
- ;/*
- ;** int
- ;** redirdev(unsigned devicetype,unsigned callervalue,
- ;** char *source, char *destination);
- ;**
- ;** ARGUMENT(s)
- ;** devicetype - 03 = printer device,
- ;** 04 = file device
- ;** callervalue - word maintained by DOS for programmer.
- ;** source - points to source ASCIIZ device name
- ;** destination - destination ASCIIZ network path with password
- ;**
- ;**
- ;** DESCRIPTION
- ;** Causes a Redirector/Server connection to be made.
- ;**
- ;**
- ;** RETURNS
- ;** 0 if successful, else DOS error code.
- ;**
- ;** AUTHOR
- ;** "" Mon 14-Nov-1988 10:14:10
- ;** Copyright (C)1988-1990 Greenleaf Software Inc. All Rights Reserved.
- ;**
- ;** MODIFICATIONS
- ;**
- ;*/
- cproc redirdev
- if _LDATA
- push ds
- endif
- push es
- mov bl,parm1_ ;bl=device type
- mov cx,parm2_ ;cx=callers value
- if _LDATA
- lds si,parm3_ ;DS:SI=source device name
- les di,parm5_ ;ES:DI=destination device name
- else
- mov ax,ds
- mov es,ax ;ES=DS
- mov si,parm3_ ;DS:SI=source device name
- mov di,parm4_ ;ES:DI=destination device name
- endif
- mov ax,REDIRECTDEVICE ;MS-DOS function call.
- int DOSCALL
- jc redirectexit
- xor ax,ax
- redirectexit: pop es
- if _LDATA
- pop ds
- endif
-
- cproce
-
- ;/*
- ;** int
- ;** canredir(char *devicename)
- ;**
- ;** ARGUMENT(s)
- ;** devicename - ASCIIZ device name or path
- ;**
- ;** DESCRIPTION
- ;** Cancels a previous redirection.
- ;**
- ;**
- ;** RETURNS
- ;** 0 if successful, else DOS error code.
- ;**
- ;** AUTHOR
- ;** "" Mon 14-Nov-1988 10:14:10
- ;** Copyright (C)1988-1990 Greenleaf Software Inc. All Rights Reserved.
- ;**
- ;** MODIFICATIONS
- ;**
- ;*/
- cproc canredir
- if _LDATA
- push ds
- lds si,parm1_
- else
- mov si,parm1_
- endif
- mov ax,CANCELREDIRECTION
- int DOSCALL
- jc cancelredexit
- xor ax,ax
- cancelredexit:
- if _LDATA
- pop ds
- endif
- cproce
-
-
-
-
- endps
- end
-