Eric Pouech pouech-eric@wanadoo.fr writes:
this won't work if the file number you want to dup is one of the default files (stdin, stdout, stderr...), as Win32HandleToDosFileHandle won't let you set it. Unless Win32HandleToDosFileHandle is wrong about this test.
I think it's wrong yes, there's no reason that it couldn't return a std handle. If there are really places where we don't want that, we can do the check in the caller, but I suspect it was done only to allow lazy init of the stdio handles.