Table of Contents

SVC_DUPHANDLE

Duplicate a file handle. This call creates a new file handle that refers to the same open file, pipe, or device as an existing handle.

Brief

Duplicate file handle (INT 21h AH=45h)

Input

Return

Notes

Binding

MASM

include macrolib.inc
 
    mov bx, handle
    @SvcDupHandle
 
handle dw 1234h

C

#include <svc.h>
 
unsigned short newhandle;
unsigned short oldhandle = 0x1234;
 
newhandle = SvcDupHandle(oldhandle);

The underlying pragma is defined as:

extern unsigned short SvcDupHandle(unsigned short handle);
#pragma aux SvcDupHandle = \
    "hlt"           \
    "db  0"         \
    "db  NOT 0"     \
    parm [bx]       \
    value [ax]      \
    modify [ax bx cx dx];

See also

2024/11/07 03:44 · prokushev · 0 Comments