[Bug 10827] No input/output after AllocConsole

wine-bugs at winehq.org wine-bugs at winehq.org
Wed Dec 19 16:00:07 CST 2007


http://bugs.winehq.org/show_bug.cgi?id=10827


Kirill K. Smirnov <lich at math.spbu.ru> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |lich at math.spbu.ru




--- Comment #1 from Kirill K. Smirnov <lich at 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


-- 
Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all bug changes.



More information about the wine-bugs mailing list