be00e5020730fde37c7aedec6a34c73d7f7ae911
[reactos.git] / win32ss / user / winsrv / consrv / 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 #pragma pack(push, 1)
15
16 /*
17 * Structure used to hold terminal-specific information
18 */
19 typedef struct _TERMINAL_INFO
20 {
21 ULONG Size; /* Size of the memory buffer pointed by TermInfo */
22 PVOID TermInfo; /* Address (or offset when talking to console.dll) of the memory buffer holding terminal information */
23 } TERMINAL_INFO, *PTERMINAL_INFO;
24
25 /*
26 * Structure used to hold console information
27 */
28 typedef struct _CONSOLE_INFO
29 {
30 ULONG HistoryBufferSize;
31 ULONG NumberOfHistoryBuffers;
32 BOOLEAN HistoryNoDup;
33
34 BOOLEAN QuickEdit;
35 BOOLEAN InsertMode;
36 ULONG InputBufferSize;
37 COORD ScreenBufferSize;
38 COORD ConsoleSize; /* The size of the console */
39
40 BOOLEAN CursorBlinkOn;
41 BOOLEAN ForceCursorOff;
42 ULONG CursorSize;
43
44 USHORT ScreenAttrib; // CHAR_INFO ScreenFillAttrib
45 USHORT PopupAttrib;
46
47 COLORREF Colors[16]; /* Color palette */
48
49 ULONG CodePage;
50
51 WCHAR ConsoleTitle[MAX_PATH + 1];
52 } CONSOLE_INFO, *PCONSOLE_INFO;
53
54 #define RGBFromAttrib(Console, Attribute) ((Console)->Colors[(Attribute) & 0xF])
55 #define TextAttribFromAttrib(Attribute) ((Attribute) & 0xF)
56 #define BkgdAttribFromAttrib(Attribute) (((Attribute) >> 4) & 0xF)
57 #define MakeAttrib(TextAttrib, BkgdAttrib) (DWORD)((((BkgdAttrib) & 0xF) << 4) | ((TextAttrib) & 0xF))
58
59 /*
60 * Structure used to communicate with console.dll
61 */
62 typedef struct _CONSOLE_PROPS
63 {
64 HWND hConsoleWindow;
65 BOOL ShowDefaultParams;
66
67 BOOLEAN AppliedConfig;
68 DWORD ActiveStaticControl;
69
70 CONSOLE_INFO ci; /* Console-specific informations */
71 TERMINAL_INFO TerminalInfo; /* Frontend-specific parameters */
72 } CONSOLE_PROPS, *PCONSOLE_PROPS;
73
74 #pragma pack(pop)
75
76 /* FUNCTIONS ******************************************************************/
77
78 #ifndef CONSOLE_H__ // If we aren't included by console.dll
79
80 BOOL ConSrvOpenUserSettings(DWORD ProcessId,
81 LPCWSTR ConsoleTitle,
82 PHKEY hSubKey,
83 REGSAM samDesired,
84 BOOL bCreate);
85
86 BOOL ConSrvReadUserSettings(IN OUT PCONSOLE_INFO ConsoleInfo,
87 IN DWORD ProcessId);
88 BOOL ConSrvWriteUserSettings(IN PCONSOLE_INFO ConsoleInfo,
89 IN DWORD ProcessId);
90 VOID ConSrvGetDefaultSettings(IN OUT PCONSOLE_INFO ConsoleInfo,
91 IN DWORD ProcessId);
92 VOID ConSrvApplyUserSettings(IN PCONSOLE Console,
93 IN PCONSOLE_INFO ConsoleInfo);
94
95 #endif
96
97 /* EOF */