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));