home *** CD-ROM | disk | FTP | other *** search
/ Microsoft Programmer's Library 1.3 / Microsoft-Programers-Library-v1.3.iso / sampcode / dos_ency / section5 / fxn440ah.asm < prev    next >
Encoding:
Assembly Source File  |  1988-08-11  |  1.4 KB  |  29 lines

  1.         ;************************************************************;
  2.         ;                                                            ;
  3.         ;    Function 44H, Subfunction 0AH:                          ;
  4.         ;                  IOCTL Remote Handle Query                 ;
  5.         ;                                                            ;
  6.         ;    int ioctl_char_redir(handle)                            ;
  7.         ;        int handle;                                         ;
  8.         ;                                                            ;
  9.         ;    Returns -1 for all errors, 1 if device/file is remote   ;
  10.         ;    (redirected), 0 if it is local.                         ;
  11.         ;                                                            ;
  12.         ;************************************************************;
  13.  
  14. cProc   ioctl_char_redir,PUBLIC
  15. parmW   handle
  16. cBegin
  17.         mov     bx,handle       ; Get handle.
  18.         mov     ax,440ah        ; Set function code, Subfunction 0AH.
  19.         int     21h             ; Call MS-DOS.
  20.         mov     ax,-1           ; Assume error.
  21.         jc      icrx            ; Branch on error, returning -1.
  22.         inc     ax              ; Set AX = 0.
  23.         test    dh,80h          ; Is bit 15 set?
  24.         jz      icrx            ; If not, device/file is local:
  25.                                 ; Return 0.
  26.         inc     ax              ; Return 1 for remote.
  27. icrx:
  28. cEnd
  29.