Function 46h Force Duplicate of a Handle (FORCEDUP or CDUP)

Forces handle in CX to refer to the same file at the same

position as BX

entry AH 46h

BX existing file handle

CX new file handle

return CF clear both handles now refer to existing file

set error

AX error code (4, 6)

note 1) If CX was an open file, it is closed first

2) If you move the read/write pointer of either file, both will move

3) The handle in BX must be open