Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- TASM 2.x / MASM 6.x Assembly Language - <b>function 46h (70) force handle duplication (forcdup)</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
Function 46h (70)        Force Handle Duplication (FORCDUP)

    Force one handle to refer to the same file as another handle. (Both
    handles must already exist.)

       On entry:      AH         46h
                      BX         First file handle
                      CX         Handle to be changed

       Returns:       AX         Error code, if CF is set

       Error codes:   4          No handles available
                      6          Invalid handle

                      Call Function 59h for extended error code information
                      (DOS 3.0 and above).

  --------------------------------------------------------------------------

    This function causes the second handle (in CX) to refer to the same
    file, at the same location, as the first handle (in BX). If the second
    handle refers to an open file, that file is closed before the handle
    is set equal to the first handle.

       Notes:         Moving the file pointer of either handle by a Read,
                      Write, or Lseek causes the other handle to be
                      changed also. However, closing one handle does not
                      close the other.

                      This function is useful for redirection. For
                      example, to redirect standard output (predefined as
                      Handle 1) to a file, place 1 in CX, and in BX place
                      the handle for the file to which output is to be
                      redirected.

See Also: 45h 59h

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson