This serie first implements an evolution to programs/wineconsole in order to be able to run a given (CUI) program with a clear status on its console. It allows to pickup between: a newly created (graphical) console, a newly created window-less console (a real console object, but not displayed at all), or detached (no console at all).
As a reminder, Wine also provides two other kinds of console: - running a CUI program, from a unix env, without redirecting all the 3 std streams (ie at least one of the three needs to be mapped to the unix console). This uses a bridge with the current Unix tty. (nick name: console-shell) - running a CUI program, from a unix env, with the 3 std streams not being tied to a console. (nick name: console-shell-no-window) Wineconsole doesn't provide those two consoles as they are already available directly from command line.
Testing some of the Wine programs revealed some bugs in Wine programs/.
Quite a few of them, when outputing, try first to write in Unicode to the console, and fall back (in case output stream has been redirected) to WriteFile, after converting the Unicode string with GetConsoleOutputCP().
This will lead to wrong results when: - program isn't attached to any console - program is attached a console-shell-no-window.
Some others programs do the same, but forcing CP_ACP instead.
I think it's time to evolve a bit... For the two use cases, I propose to always convert output to UTF8 in case of redirection (done with on example of each).
Signed-off-by: Eric Pouech eric.pouech@gmail.com ---
Eric Pouech (4): programs/wineconsole: select console type and/or std handles for child process dlls/kernelbase: fix CreateProcess with CREATE_NO_WINDOW when no std handles are inherited programs/chcp.com: write redirected output in UTF8 programs/attrib: write redirected output in UTF8
dlls/kernelbase/process.c | 2 +- programs/attrib/attrib.c | 9 +- programs/chcp.com/main.c | 9 +- programs/wineconsole/wineconsole.c | 192 ++++++++++++++++++++---- programs/wineconsole/wineconsole.man.in | 40 ++++- programs/wineconsole/wineconsole.rc | 12 ++ programs/wineconsole/wineconsole_res.h | 2 + 7 files changed, 222 insertions(+), 44 deletions(-)