http://bugs.winehq.org/show_bug.cgi?id=10827
Kirill K. Smirnov lich@math.spbu.ru changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |lich@math.spbu.ru
--- Comment #1 from Kirill K. Smirnov lich@math.spbu.ru 2007-12-19 16:00:06 --- MSDN and your example are a bit buggy...
AllocConsole modifies standard io handles, so programmer must re-get them using GetStdHandle. (MSDN example updates only OUTPUT, and you forgot to update both of them when you call AllocConsole last time).
[Un]fortunately Windows generates new console handles equal to the old ones, so it is very easy to forget to update them. This behaviour is undocumented but widely used.
I've send three patches to fix this, two of them are already applied. http://www.winehq.org/pipermail/wine-patches/2007-December/048106.html http://www.winehq.org/pipermail/wine-patches/2007-December/048062.html http://www.winehq.org/pipermail/wine-patches/2007-December/048148.html
And the last but not the least: it is dangerous to run console application using 'wineconsole' directly, because it tells system to use predefined io handles (using STARTUPINFO). Applications should be run using 'start' utility.
Dangerous to say: $ wineconsole app.exe use instead: $ wine start app.exe