1 <chapter id=
"consoles">
2 <title>Consoles in Wine
</title>
5 As described in the Wine User Guide's CUI section, Wine
6 manipulates three kinds of
"consoles" in order to support
7 properly the Win32 CUI API.
10 The following table describes the main implementation
11 differences between the three approaches.
14 <title>Function consoles implementation comparison
</title>
15 <tgroup cols=
"4" align=
"left">
18 <entry>Function
</entry>
19 <entry>Bare streams
</entry>
20 <entry>Wineconsole
& user backend
</entry>
21 <entry>Wineconsole
& curses backend
</entry>
27 Console as a Win32 Object (and associated
31 No specific Win32 object is used in this case. The
32 handles manipulated for the standard Win32 streams
33 are in fact
"bare handles" to their corresponding
34 Unix streams. The mode manipulation functions
35 (
<function>GetConsoleMode
</function> /
36 <function>SetConsoleMode
</function>) are not
40 Implemented in server, and a specific Winelib
41 program (wineconsole) is in charge of the
42 rendering and user input. The mode manipulation
43 functions behave as expected.
46 Implemented in server, and a specific Winelib
47 program (wineconsole) is in charge of the
48 rendering and user input. The mode manipulation
49 functions behave as expected.
54 Inheritance (including handling in
55 <function>CreateProcess
</function> of
56 <constant>CREATE_DETACHED
</constant>,
57 <constant>CREATE_NEW_CONSOLE
</constant> flags).
60 Not supported. Every process child of a process
61 will inherit the Unix streams, so will also
62 inherit the Win32 standard streams.
65 Fully supported (each new console creation will be
66 handled by the creation of a new USER32 window)
69 Fully supported, except for the creation of a new
70 console, which will be rendered on the same Unix
71 terminal as the previous one, leading to
72 unpredictable results.
76 <entry><function>ReadFile
</function> /
<function>WriteFile
</function> operations
</entry>
77 <entry>Fully supported
</entry>
78 <entry>Fully supported
</entry>
79 <entry>Fully supported
</entry>
83 Screen-buffer manipulation (creation, deletion, resizing...)
85 <entry>Not supported
</entry>
86 <entry>Fully supported
</entry>
88 Partly supported (this won't work too well as we
89 don't control (so far) the size of underlying Unix
95 APIs for reading/writing screen-buffer content,
98 <entry>Not supported
</entry>
99 <entry>Fully supported
</entry>
100 <entry>Fully supported
</entry>
104 APIs for manipulating the rendering window size
106 <entry>Not supported
</entry>
107 <entry>Fully supported
</entry>
109 Partly supported (this won't work too well as we
110 don't control (so far) the size of underlying Unix
116 Signaling (in particular, Ctrl-C handling)
119 Nothing is done, which means that Ctrl-C will
120 generate (as usual) a
<constant>SIGINT
</constant>
121 which will terminate the program.
124 Partly supported (Ctrl-C behaves as expected,
125 however the other Win32 CUI signaling isn't
126 properly implemented).
129 Partly supported (Ctrl-C behaves as expected,
130 however the other Win32 CUI signaling isn't
131 properly implemented).
140 The Win32 objects behind a console can be created in several occasions:
144 When the program is started from wineconsole, a new
145 console object is created and will be used (inherited)
146 by the process launched from wineconsole.
151 When a program, which isn't attached to a console, calls
152 <function>AllocConsole
</function>, Wine then launches
153 wineconsole, and attaches the current program to this
154 console. In this mode, the USER32 mode is always
155 selected as Wine cannot tell the current state of the
162 Please also note, that starting a child process with the
163 <constant>CREATE_NEW_CONSOLE
</constant> flag, will end-up
164 calling
<function>AllocConsole
</function> in the child
165 process, hence creating a wineconsole with the USER32 backend.
169 <!-- Keep this comment at the end of the file
172 sgml-parent-document:("wine-devel.sgml" "set" "book" "part" "chapter" "")