home *** CD-ROM | disk | FTP | other *** search
/ Piper's Pit BBS/FTP: ibm 0020 - 0029 / ibm0020-0029 / ibm0028.tar / ibm0028 / GRLF-C-2.ZIP / GFUNC / REDIRECT.ASM < prev    next >
Encoding:
Assembly Source File  |  1990-05-30  |  4.0 KB  |  196 lines

  1. ;/*
  2. ;** redirect.asm
  3. ;** contains: getreent(),redirdev(),canredir(),
  4. ;*/
  5.  
  6. GETREDIRECTIONLIST    equ    05f02h        ;Get Redirection List Entry
  7. REDIRECTDEVICE        equ    05f03h        ;Redirect Device function #
  8. CANCELREDIRECTION    equ    05f04h        ;Cancel redirection
  9. DOSCALL         equ    021h        ;DOS Software Interrupt
  10.  
  11.         include model.h
  12.         include prologue.h
  13.  
  14.         pseg    cRedirect
  15.  
  16. ;/*
  17. ;**  int
  18. ;** getreent(unsigned index, char *localdevname,
  19. ;**        char *networkname,unsigned char *devicestatus,
  20. ;**        unsigned char *devicetype,unsigned *hide);
  21. ;**
  22. ;** ARGUMENT(s)
  23. ;**    index        -    Redirection index (zero based)
  24. ;**    localdevname    -    Points to 128-byte buffer address
  25. ;**                of the local device name.
  26. ;**    networkname    -    Points to a 128-byte buffer address of
  27. ;**                network name.
  28. ;**    devicestatus    -    Points to a 8 bit value that gets the
  29. ;**                device status flag.  Bit 0 = 0 if device
  30. ;**                is valid.  Bit 0 = 1 if device is not
  31. ;**                valid.
  32. ;**    devicetype    -    Points to a 8 bit value that gets the
  33. ;**                device type.
  34. ;**    hide        -    Word programmer can use.
  35. ;**
  36. ;** DESCRIPTION
  37. ;**  Returns nonlocal network assignments.  The IBM PC Network Program must
  38. ;**  be loaded for the function call to execute properly.
  39. ;**
  40. ;** RETURNS
  41. ;**  0 if successful, else dos error code.
  42. ;**
  43. ;** AUTHOR
  44. ;**  ""   Fri 11-Nov-1988    16:50:19
  45. ;**   Copyright (C)1988-1990 Greenleaf Software Inc. All Rights Reserved.
  46. ;**
  47. ;** MODIFICATIONS
  48. ;**
  49. ;*/
  50.         cproc    getreent
  51.         mov    ax,GETREDIRECTIONLIST
  52.         if    _LDATA
  53.          push    ds
  54.          push    es
  55.          lds    si,parm2_
  56.          les    di,parm4_
  57.         else
  58.          push    es
  59.          mov    bx,ds
  60.          mov    es,bx
  61.          mov    si,parm2_
  62.          mov    di,parm3_
  63.         endif
  64.         push    bp
  65.         int    DOSCALL
  66.         pop    bp
  67.         jc    getredirexit
  68.  
  69.         if    _LDATA
  70.          lds    si,parm6_        ;DS:SI->device status
  71.         else
  72.          mov    si,parm4_        ;DS:SI->device status
  73.         endif
  74.         mov    [si],bh         ;save flag
  75.  
  76.         if    _LDATA
  77.          lds    si,parm8_        ;DS:SI->devicetype
  78.         else
  79.          mov    si,parm5_
  80.         endif
  81.         mov    [si],bl         ;save flag
  82.         if    _LDATA
  83.          lds    si,parm10_
  84.         else
  85.          mov    si,parm6_        ;DS:SI-> User word
  86.         endif
  87.         mov    [si],cx            ;save users word
  88.         xor    ax,ax
  89. getredirexit:
  90.         if    _LDATA
  91.          pop    es
  92.          pop    ds
  93.         else
  94.          pop    es
  95.         endif
  96.         cproce
  97.  
  98.  
  99. ;/*
  100. ;**  int
  101. ;** redirdev(unsigned devicetype,unsigned callervalue,
  102. ;**           char *source, char *destination);
  103. ;**
  104. ;** ARGUMENT(s)
  105. ;**    devicetype    -    03 = printer device,
  106. ;**                04 = file device
  107. ;**    callervalue    -    word maintained by DOS for programmer.
  108. ;**    source        -    points to source ASCIIZ device name
  109. ;**    destination    -    destination ASCIIZ network path with password
  110. ;**
  111. ;**
  112. ;** DESCRIPTION
  113. ;**  Causes a Redirector/Server connection to be made.
  114. ;**
  115. ;**
  116. ;** RETURNS
  117. ;**  0 if successful, else DOS error code.
  118. ;**
  119. ;** AUTHOR
  120. ;**  ""   Mon 14-Nov-1988    10:14:10
  121. ;**   Copyright (C)1988-1990 Greenleaf Software Inc. All Rights Reserved.
  122. ;**
  123. ;** MODIFICATIONS
  124. ;**
  125. ;*/
  126.         cproc    redirdev
  127.         if    _LDATA
  128.          push    ds
  129.         endif
  130.         push    es
  131.         mov    bl,parm1_        ;bl=device type
  132.         mov    cx,parm2_        ;cx=callers value
  133.         if    _LDATA
  134.          lds    si,parm3_        ;DS:SI=source device name
  135.          les    di,parm5_        ;ES:DI=destination device name
  136.         else
  137.          mov    ax,ds
  138.          mov    es,ax            ;ES=DS
  139.          mov    si,parm3_        ;DS:SI=source device name
  140.          mov    di,parm4_        ;ES:DI=destination device name
  141.         endif
  142.         mov    ax,REDIRECTDEVICE    ;MS-DOS function call.
  143.         int    DOSCALL
  144.         jc    redirectexit
  145.         xor    ax,ax
  146. redirectexit:    pop    es
  147.         if    _LDATA
  148.          pop    ds
  149.         endif
  150.  
  151.         cproce
  152.  
  153. ;/*
  154. ;**  int
  155. ;** canredir(char *devicename)
  156. ;**
  157. ;** ARGUMENT(s)
  158. ;**  devicename     -    ASCIIZ device name or path
  159. ;**
  160. ;** DESCRIPTION
  161. ;**  Cancels a previous redirection.
  162. ;**
  163. ;**
  164. ;** RETURNS
  165. ;**  0 if successful, else DOS error code.
  166. ;**
  167. ;** AUTHOR
  168. ;**  ""   Mon 14-Nov-1988    10:14:10
  169. ;**   Copyright (C)1988-1990 Greenleaf Software Inc. All Rights Reserved.
  170. ;**
  171. ;** MODIFICATIONS
  172. ;**
  173. ;*/
  174.         cproc    canredir
  175.         if    _LDATA
  176.          push    ds
  177.          lds    si,parm1_
  178.         else
  179.          mov    si,parm1_
  180.         endif
  181.         mov    ax,CANCELREDIRECTION
  182.         int    DOSCALL
  183.         jc    cancelredexit
  184.         xor    ax,ax
  185. cancelredexit:
  186.         if    _LDATA
  187.          pop    ds
  188.         endif
  189.         cproce
  190.  
  191.  
  192.  
  193.  
  194.         endps
  195.         end
  196.