2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS Console Server DLL
4 * FILE: concfg/settings.h
5 * PURPOSE: Public Console Settings Management Interface
6 * PROGRAMMERS: Johannes Anderwald
7 * Hermes Belusca-Maito (hermes.belusca@sfr.fr)
12 /* STRUCTURES *****************************************************************/
15 * Undocumented message and structure used by Windows' console.dll
16 * for setting console info.
17 * See http://www.catch22.net/sites/default/source/files/setconsoleinfo.c
18 * and http://www.scn.rain.com/~neighorn/PDF/MSBugPaper.pdf
19 * for more information.
21 #define WM_SETCONSOLEINFO (WM_USER + 201)
23 // This shared structure has alignment requirements
24 // in order to be compatible with the Windows one.
27 typedef struct _CONSOLE_STATE_INFO
29 ULONG cbSize
; // Real length of this structure, at least sizeof(_CONSOLE_STATE_INFO).
30 // The real length takes into account for the real size of the console title.
32 COORD ScreenBufferSize
;
39 WCHAR FaceName
[LF_FACESIZE
];
47 USHORT ScreenAttributes
;
48 USHORT PopupAttributes
;
50 ULONG HistoryBufferSize
;
51 ULONG NumberOfHistoryBuffers
;
53 COLORREF ColorTable
[16];
58 WCHAR ConsoleTitle
[ANYSIZE_ARRAY
];
59 } CONSOLE_STATE_INFO
, *PCONSOLE_STATE_INFO
;
62 C_ASSERT(sizeof(CONSOLE_STATE_INFO
) == 0xD0);
68 * BYTE Foreground = LOBYTE(Attributes) & 0x0F;
69 * BYTE Background = (LOBYTE(Attributes) & 0xF0) >> 4;
71 #define RGBFromAttrib(Console, Attribute) ((Console)->Colors[(Attribute) & 0xF])
72 #define TextAttribFromAttrib(Attribute) ( !((Attribute) & COMMON_LVB_REVERSE_VIDEO) ? (Attribute) & 0xF : ((Attribute) >> 4) & 0xF )
73 #define BkgdAttribFromAttrib(Attribute) ( !((Attribute) & COMMON_LVB_REVERSE_VIDEO) ? ((Attribute) >> 4) & 0xF : (Attribute) & 0xF )
74 #define MakeAttrib(TextAttrib, BkgdAttrib) (USHORT)((((BkgdAttrib) & 0xF) << 4) | ((TextAttrib) & 0xF))
76 /* FUNCTIONS ******************************************************************/
79 ConCfgOpenUserSettings(LPCWSTR ConsoleTitle
,
84 ConCfgReadUserSettings(IN OUT PCONSOLE_STATE_INFO ConsoleInfo
,
85 IN BOOLEAN DefaultSettings
);
87 ConCfgWriteUserSettings(IN PCONSOLE_STATE_INFO ConsoleInfo
,
88 IN BOOLEAN DefaultSettings
);
90 VOID
ConCfgInitDefaultSettings(IN OUT PCONSOLE_STATE_INFO ConsoleInfo
);
91 VOID
ConCfgGetDefaultSettings(IN OUT PCONSOLE_STATE_INFO ConsoleInfo
);