home *** CD-ROM | disk | FTP | other *** search
/ Microsoft Programmer's Library 1.3 / Microsoft-Programers-Library-v1.3.iso / sampcode / dos_ency / 7 / fxn45h.asm < prev    next >
Encoding:
Assembly Source File  |  1988-08-11  |  789 b   |  21 lines

  1. fhandle dw      ?               ; handle from previous open
  2.  
  3.         .
  4.         .
  5.         .
  6.                                 ; duplicate the handle...
  7.         mov     bx,fhandle      ; BX = handle for file
  8.         mov     ah,45h          ; Function 45H = dup handle
  9.         int     21h             ; transfer to MS-DOS
  10.         jc      error           ; jump if function call failed
  11.  
  12.                                 ; now close the new handle...
  13.         mov     bx,ax           ; BX = duplicated handle
  14.         mov     ah,3eh          ; Function 3EH = close 
  15.         int     21h             ; transfer to MS-DOS
  16.         jc      error           ; jump if close failed
  17.         mov     bx,fhandle      ; replace closed handle with active handle
  18.         .
  19.         .
  20.         .
  21.