http://bugs.winehq.org/show_bug.cgi?id=17417
--- Comment #3 from Austin Lund austin.lund@gmail.com 2009-02-18 00:05:22 --- I've done some more testing on this.
$ WINEDEBUG="trace+msvcrt,warn+msvcrt" ./programs/winetest/winetest -o out -c msvcrt:file 2>&1 | grep -A 5 dup trace:msvcrt:MSVCRT__dup2 (od=0, nd=10) trace:msvcrt:msvcrt_alloc_fd_from fdstart is 3, fdend is 11 trace:msvcrt:MSVCRT__fstat64 :fd (10) stat (0x33fc68) trace:msvcrt:MSVCRT__fstat64 :dwFileAttributes = 0x0, mode set to 0x2000 trace:msvcrt:MSVCRT__close :fd (10) handle (0x34) trace:msvcrt:msvcrt_free_fd :fd (10) freed
$ WINEDEBUG="trace+msvcrt,warn+msvcrt" ./programs/winetest/winetest -o out -c msvcrtd:debug msvcrt:file 2>&1 | grep -A 5 dup trace:msvcrt:MSVCRT__dup2 (od=0, nd=10) trace:msvcrt:msvcrt_alloc_fd_from fdstart is 3, fdend is 11 trace:msvcrt:MSVCRT__fstat64 :fd (10) stat (0x33fc68) warn:msvcrt:MSVCRT__fstat64 :failed-last error (6) trace:msvcrt:pf_vsnprintf format is L"%s:%d: Test failed" trace:msvcrt:pf_vsnprintf format is L": "
Having a look at the code for fstat64, it seems that
type = GetFileType(hand);
is not returning a type of FILE_TYPE_CHAR. When having a look at the code for GetFileType
if (is_console_handle( hFile )) return FILE_TYPE_CHAR;
it would seem necessary that a console fd should return FILE_TYPE_CHAR.