http://bugs.winehq.org/show_bug.cgi?id=21930
--- Comment #8 from Andrey Turkin andrey.turkin@gmail.com 2010-05-27 17:47:30 --- Fails in same way with current git...
===================== 0023:Call KERNEL32.GetStdHandle(fffffff5) ret=00404540 0023:Ret KERNEL32.GetStdHandle() retval=00000053 ret=00404540
0023:Call PE DLL (proc=0x7df83c30,module=0x7df40000 L"msvcrt.dll",reason=PROCESS_ATTACH,res=(nil)) .... 0023:Call KERNEL32.GetStdHandle(fffffff5) ret=7df5abf0 0023:Ret KERNEL32.GetStdHandle() retval=00000053 ret=7df5abf0 0023:Call KERNEL32.DuplicateHandle(ffffffff,00000053,ffffffff,7df940a4,00000000,00000001,00000002) ret=7df5ac36 0023:Ret KERNEL32.DuplicateHandle() retval=00000001 ret=7df5ac36 ... 0023:Ret PE DLL (proc=0x7df83c30,module=0x7df40000 L"msvcrt.dll",reason=PROCESS_ATTACH,res=(nil)) retval=1
0023:Call PE DLL (proc=0x7df83c30,module=0x7df40000 L"msvcrt.dll",reason=PROCESS_DETACH,res=(nil)) ... 0023:Call KERNEL32.CloseHandle(fffffff5) ret=7df59b16 0023:Ret KERNEL32.CloseHandle() retval=00000001 ret=7df59b16 ... 0023:Call KERNEL32.GetStdHandle(fffffff5) ret=7df59cf4 0023:Ret KERNEL32.GetStdHandle() retval=00000000 ret=7df59cf4 ... 0023:Ret PE DLL (proc=0x7df83c30,module=0x7df40000 L"msvcrt.dll",reason=PROCESS_DETACH,res=(nil)) retval=1 0023:Ret KERNEL32.FreeLibrary() retval=00000001 ret=00387757
0023:Call KERNEL32.WriteFile(00000053,00410360,00000025,0033fbcc,00000000) ret=004043d9 === fails with "invalid handle" error ===
Obviously the application expects console handles to survive msvcrt.dll load and unload. Since it works with native msvcrt then it must be something inside Wine's msvcrt that works not as it should, doesn't it?