4 #include <msvcrt/internal/file.h>
13 HANDLE hProcess = GetCurrentProcess();
17 hFile = _get_osfhandle(handle);
18 if (hFile == INVALID_HANDLE_VALUE)
20 result = DuplicateHandle(hProcess,
26 DUPLICATE_SAME_ACCESS);
30 fd = __fileno_alloc(hFile, __fileno_getmode(handle));