Release 980215
[wine] / documentation / console
1
2 Console - First Pass
3 --------------------
4
5 Consoles are just xterms created with the -Sxxn switch.
6 A pty is opened and the master goes to the xterm side
7 and the slave is held by the wine side.  The slave fd
8 is changed into a HANDLE32 and this HANDLE32 is set
9 to the STD_*_HANDLES.
10
11 For now writing/reading to a console just calls FileWrite/FileRead.
12
13 If the command line console is to be inheirited or
14 a process inherits it's parents console (-- can that happen???),
15 the console is created at process init time via PROCESS_InheritConsole.
16 The 0, 1, and 2 file descriptors are duped to be the
17 STD_*_HANDLES in this case.  Also in this case a flag is set
18 to indicate that the console comes from the parent process or
19 command line.
20
21 If a process doesn't have a console at all, it's 
22 pdb->console is set to NULL.  This helps indicate when
23 it is possible to create a new console (via AllocConsole).
24
25
26 Like most k32 objects, when the FreeConsole is called, the 
27 ref count is decremented and the console is freed when
28 it reaches zero.  The free kills the xterm and closes
29 the master/slave fds.
30
31 Also like most k32 objects, we assume that (K32OBJ) header is the
32 first field so the casting (from K32OBJ *to CONSOLE *)
33 works correctly.
34
35 BUGS
36 ----
37
38 A exit handler needs to be added.  If the process exits
39 without calling FreeConsole, the xterm continues on...
40 But... there should probably be a generic exit handler in
41 wine for this kind of stuff (K32OBJs).
42