Synchronize with trunk revision 59636 (just before Alex's CreateProcess revamp).
[reactos.git] / win32ss / user / winsrv / consrv_new / include / settings.h
1 /*
2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS Console Server DLL
4 * FILE: win32ss/user/winsrv/consrv/include/settings.h
5 * PURPOSE: Public Console Settings Management Interface
6 * PROGRAMMERS: Johannes Anderwald
7 * Hermes Belusca-Maito (hermes.belusca@sfr.fr)
8 */
9
10 #pragma once
11
12 /* STRUCTURES *****************************************************************/
13
14 /*
15 * Structure used to hold terminal-specific information
16 */
17 typedef struct _TERMINAL_INFO
18 {
19 ULONG Size; /* Size of the memory buffer pointed by TermInfo */
20 PVOID TermInfo; /* Address (or offset when talking to console.dll) of the memory buffer holding terminal information */
21 } TERMINAL_INFO, *PTERMINAL_INFO;
22
23 /*
24 * Structure used to hold console information
25 */
26 typedef struct _CONSOLE_INFO
27 {
28 ULONG HistoryBufferSize;
29 ULONG NumberOfHistoryBuffers;
30 BOOLEAN HistoryNoDup;
31
32 BOOLEAN QuickEdit;
33 BOOLEAN InsertMode;
34 ULONG InputBufferSize;
35 COORD ScreenBufferSize;
36 COORD ConsoleSize; /* The size of the console */
37
38 BOOLEAN CursorBlinkOn;
39 BOOLEAN ForceCursorOff;
40 ULONG CursorSize;
41
42 USHORT ScreenAttrib; // CHAR_INFO ScreenFillAttrib
43 USHORT PopupAttrib;
44
45 COLORREF Colors[16]; /* Color palette */
46
47 ULONG CodePage;
48
49 WCHAR ConsoleTitle[MAX_PATH + 1];
50 } CONSOLE_INFO, *PCONSOLE_INFO;
51
52 #define RGBFromAttrib(Console, Attribute) ((Console)->Colors[(Attribute) & 0xF])
53 #define TextAttribFromAttrib(Attribute) ((Attribute) & 0xF)
54 #define BkgdAttribFromAttrib(Attribute) (((Attribute) >> 4) & 0xF)
55 #define MakeAttrib(TextAttrib, BkgdAttrib) (DWORD)((((BkgdAttrib) & 0xF) << 4) | ((TextAttrib) & 0xF))
56
57 /*
58 * Structure used to communicate with console.dll
59 */
60 typedef struct _CONSOLE_PROPS
61 {
62 HWND hConsoleWindow;
63 BOOL ShowDefaultParams;
64
65 BOOLEAN AppliedConfig;
66 DWORD ActiveStaticControl;
67
68 CONSOLE_INFO ci; /* Console-specific informations */
69 TERMINAL_INFO TerminalInfo; /* Frontend-specific parameters */
70 } CONSOLE_PROPS, *PCONSOLE_PROPS;
71
72 /* FUNCTIONS ******************************************************************/
73
74 #ifndef CONSOLE_H__ // If we aren't included by console.dll
75
76 BOOL ConSrvOpenUserSettings(DWORD ProcessId,
77 LPCWSTR ConsoleTitle,
78 PHKEY hSubKey,
79 REGSAM samDesired,
80 BOOL bCreate);
81
82 BOOL ConSrvReadUserSettings(IN OUT PCONSOLE_INFO ConsoleInfo,
83 IN DWORD ProcessId);
84 BOOL ConSrvWriteUserSettings(IN PCONSOLE_INFO ConsoleInfo,
85 IN DWORD ProcessId);
86 VOID ConSrvGetDefaultSettings(IN OUT PCONSOLE_INFO ConsoleInfo,
87 IN DWORD ProcessId);
88 VOID ConSrvApplyUserSettings(IN PCONSOLE Console,
89 IN PCONSOLE_INFO ConsoleInfo);
90
91 #endif
92
93 /* EOF */