[Bug 22216] New: Problem with freopen("CONOUT$", "w", stdout);
http://bugs.winehq.org/show_bug.cgi?id=22216 Summary: Problem with freopen("CONOUT$", "w", stdout); Product: Wine Version: unspecified Platform: x86 OS/Version: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: msvcrt AssignedTo: wine-bugs(a)winehq.org ReportedBy: terra(a)gnome.org I am having trouble with code that reads... has_console = FALSE; { typedef BOOL (CALLBACK* LPFNATTACHCONSOLE)(DWORD); LPFNATTACHCONSOLE MyAttachConsole; HMODULE hmod; if ((hmod = GetModuleHandle("kernel32.dll"))) { MyAttachConsole = (LPFNATTACHCONSOLE) GetProcAddress(hmod, "AttachConsole"); if (MyAttachConsole && MyAttachConsole(ATTACH_PARENT_PROCESS)) { freopen("CONOUT$", "w", stdout); freopen("CONOUT$", "w", stderr); dup2(fileno(stdout), 1); dup2(fileno(stderr), 2); has_console = TRUE; } } } The freopen calls should cause stderr and stdout to be redirected to the console. Under wine they are not. The failure occurs in dlls/kernel32/console.c function OpenConsoleW when it checks creation != OPEN_EXISTING. creation at that point is CREATE_ALWAYS. Changing the check to allow CREATE_ALWAYS fixes my problem, but may not be right. (The code is from Gnumeric, btw.) -- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email Do not reply to this email, post in Bugzilla using the above URL to reply. ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=22216 Austin English <austinenglish(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |testcase -- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email Do not reply to this email, post in Bugzilla using the above URL to reply. ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=22216 Dmitry Timoshkov <dmitry(a)codeweavers.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Component|msvcrt |-unknown --- Comment #1 from Dmitry Timoshkov <dmitry(a)codeweavers.com> 2010-03-31 00:48:23 --- Wine version? Does it work if you run the test from wineconsole? -- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email Do not reply to this email, post in Bugzilla using the above URL to reply. ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=22216 --- Comment #2 from Dmitry Timoshkov <dmitry(a)codeweavers.com> 2010-03-31 00:52:52 --- Most likely a duplicate of the bug 5541. -- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email Do not reply to this email, post in Bugzilla using the above URL to reply. ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=22216 --- Comment #3 from M Welinder <terra(a)gnome.org> 2010-03-31 07:44:49 ---
Wine version?
Git from a couple of weeks ago, give or take.
Does it work if you run the test from wineconsole?
No difference.
Most likely a duplicate of the bug 5541.
It doesn't look that way to me. WriteConsoleW is not part of the equation here. -- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email Do not reply to this email, post in Bugzilla using the above URL to reply. ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=22216 Vitaliy Margolen <vitaliy(a)kievinfo.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version|unspecified |1.1.41 -- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email Do not reply to this email, post in Bugzilla using the above URL to reply. ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=22216 Vitaliy Margolen <vitaliy(a)kievinfo.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Component|-unknown |kernel32 -- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email Do not reply to this email, post in Bugzilla using the above URL to reply. ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=22216 Jerome Leclanche <adys.wh(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |adys.wh(a)gmail.com --- Comment #4 from Jerome Leclanche <adys.wh(a)gmail.com> 2011-11-08 09:05:20 CST --- Please retest in wine-1.3.32. -- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email Do not reply to this email, post in Bugzilla using the above URL to reply. ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=22216 Eric Pouech <eric.pouech(a)orange.fr> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |ASSIGNED CC| |eric.pouech(a)orange.fr Ever Confirmed|0 |1 --- Comment #5 from Eric Pouech <eric.pouech(a)orange.fr> 2012-02-05 15:24:34 CST --- I've fixed the CreateFileW call that was wrong (called from msvcrt.freopen) but this simple code still doesn't work as AttachConsole isn't implemented yet A+ -- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email Do not reply to this email, post in Bugzilla using the above URL to reply. ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=22216 --- Comment #6 from Austin English <austinenglish(a)gmail.com> 2012-02-08 17:52:26 CST --- http://source.winehq.org/git/wine.git/commitdiff/d967484ecc1f6a8c4f84b9d04a6... -- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email Do not reply to this email, post in Bugzilla using the above URL to reply. ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=22216 Eric Pouech <eric.pouech(a)orange.fr> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |RESOLVED Resolution| |FIXED --- Comment #7 from Eric Pouech <eric.pouech(a)orange.fr> 2012-02-25 14:02:20 CST --- this part (about reopen failing is fixed) AttachConsole still needs to be implemented, but that's another bug report, and it'll wait after 1.4 is out A+ -- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email Do not reply to this email, post in Bugzilla using the above URL to reply. ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=22216 --- Comment #8 from Jerome Leclanche <adys.wh(a)gmail.com> 2012-02-25 14:04:08 CST --- (In reply to comment #7) Do you remember the commit fixing it? -- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email Do not reply to this email, post in Bugzilla using the above URL to reply. ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=22216 --- Comment #9 from Eric Pouech <eric.pouech(a)orange.fr> 2012-02-25 14:33:13 CST --- see comment #6 <g> A+ -- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email Do not reply to this email, post in Bugzilla using the above URL to reply. ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=22216 Nikolay Sivov <bunglehead(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Fixed by SHA1| |d967484ecc1f6a8c4f84b9d04a6 | |30c566d7c11ae -- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email Do not reply to this email, post in Bugzilla using the above URL to reply. ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=22216 Alexandre Julliard <julliard(a)winehq.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED --- Comment #10 from Alexandre Julliard <julliard(a)winehq.org> 2012-03-02 13:02:31 CST --- Closing bugs fixed in 1.4-rc6. -- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email Do not reply to this email, post in Bugzilla using the above URL to reply. ------- You are receiving this mail because: ------- You are watching all bug changes.
participants (1)
-
wine-bugs@winehq.org