1 /* $Id: dup.c,v 1.2 2002/05/07 22:31:25 hbirr Exp $ */
4 #include <msvcrt/internal/file.h>
10 HANDLE hProcess
= GetCurrentProcess();
14 hFile
= _get_osfhandle(handle
);
15 if (hFile
== INVALID_HANDLE_VALUE
)
17 result
= DuplicateHandle(hProcess
,
23 DUPLICATE_SAME_ACCESS
);
27 fd
= __fileno_alloc(hFile
, __fileno_getmode(handle
));