1 <chapter id="consoles">
2 <title>Consoles in Wine</title>
4 <sect1 id="wine-consoles">
5 <title>Consoles</title>
8 Written by &name-eric-pouech; <email>&email-eric-pouech</email>
12 As described in the Wine User Guide's CUI section, Wine
13 manipulates three kinds of "consoles" in order to support
14 properly the Win32 CUI API.
17 The following table describes the main implementation
18 differences between the three approaches.
21 <title>Fonction consoles implementation comparison</title>
22 <tgroup cols="4" align="left">
25 <entry>Function</entry>
26 <entry>Bare streams</entry>
27 <entry>Wineconsole & user backend</entry>
28 <entry>Wineconsole & curses backend</entry>
34 Console as a Win32 Object (and associated
38 No specific Win32 object is used in this case. The
39 handles manipulated for the standard Win32 streams
40 are in fact "bare handles" to their corresponding
41 Unix streams. The mode manipulation functions
42 (<function>GetConsoleMode</function> /
43 <function>SetConsoleMode</function>) are not
47 Implemented in server, and a specific Winelib
48 program (wineconsole) is in charge of the
49 rendering and user input. The mode manipulation
50 functions behave as expected.
53 Implemented in server, and a specific Winelib
54 program (wineconsole) is in charge of the
55 rendering and user input. The mode manipulation
56 functions behave as expected.
61 Inheritance (including handling in
62 <function>CreateProcess</function> of
63 <constant>CREATE_DETACHED</constant>,
64 <constant>CREATE_NEW_CONSOLE</constant> flags).
67 Not supported. Every process child of a process
68 will inherit the Unix streams, so will also
69 inherit the Win32 standard streams.
72 Fully supported (each new console creation will be
73 handled by the creation of a new USER32 window)
76 Fully supported, except for the creation of a new
77 console, which will be rendered on the same Unix
78 terminal as the previous one, leading to
79 unpredictible results.
83 <entry><function>ReadFile</function> / <function>WriteFile</function> operations</entry>
84 <entry>Fully supported</entry>
85 <entry>Fully supported</entry>
86 <entry>Fully supported</entry>
90 Screen-buffer manipulation (creation, deletion, resizing...)
92 <entry>Not supported</entry>
93 <entry>Fully supported</entry>
95 Partly supported (this won't work too well as we
96 don't control (so far) the size of underlying Unix
102 APIs for reading/writing screen-buffer content,
105 <entry>Not supported</entry>
106 <entry>Fully supported</entry>
107 <entry>Fully supported</entry>
111 APIs for manipulating the rendering window size
113 <entry>Not supported</entry>
114 <entry>Fully supported</entry>
116 Partly supported (this won't work too well as we
117 don't control (so far) the size of underlying Unix
123 Signaling (in particular, Ctrl-C handling)
126 Nothing is done, which means that Ctrl-C will
127 generate (as usual) a <constant>SIGINT</constant>
128 which will terminate the program.
131 Partly supported (Ctrl-C behaves as expected,
132 however the other Win32 CUI signaling isn't
133 properly implemented).
136 Partly supported (Ctrl-C behaves as expected,
137 however the other Win32 CUI signaling isn't
138 properly implemented).
148 <title>Console creation</title>
151 The Win32 objects behind a console can be created in several occasions:
155 When the program is started from wineconsole, a new
156 console object is created and will be used (inherited)
157 by the process launched from wineconsole.
162 When a program, which isn't attached to a console, calls
163 <function>AllocConsole</function>, Wine then launches
164 wineconsole, and attaches the current program to this
165 console. In this mode, the USER32 mode is always
166 selected as Wine cannot tell the current state of the
173 Please also note, that starting a child process with the
174 <constant>CREATE_NEW_CONSOLE</constant> flag, will end-up
175 calling <function>AllocConsole</function> in the child
176 process, hence creating a wineconsole with the USER32 backend.
181 <!-- Keep this comment at the end of the file
184 sgml-parent-document:("wine-doc.sgml" "set" "book" "part" "chapter" "")