26#define CSR_DEFAULT_CURSOR_SIZE 25
29#define DEFAULT_SCREEN_ATTRIB (FOREGROUND_BLUE | FOREGROUND_GREEN | FOREGROUND_RED)
30#define DEFAULT_POPUP_ATTRIB (FOREGROUND_BLUE | FOREGROUND_RED | \
31 BACKGROUND_BLUE | BACKGROUND_GREEN | BACKGROUND_RED | BACKGROUND_INTENSITY)
67#define PATH_SEPARATOR L'\\'
71 if ( DestString ==
NULL || ConsoleName ==
NULL ||
72 *ConsoleName ==
L'\0' || MaxStrLen == 0 )
78 if ((wLength > 0) && (
_wcsnicmp(ConsoleName, DestString, wLength) == 0))
123 DPRINT1(
"RtlOpenCurrentUser() failed, Status = 0x%08lx\n",
Status);
173 DWORD dwNumValues = 0;
175 DWORD dwColorIndex = 0;
186 DPRINT(
"ConCfgOpenUserSettings() failed\n");
193 DPRINT(
"ConCfgReadUserSettings: RegQueryInfoKeyW() failed\n");
198 DPRINT(
"ConCfgReadUserSettings() entered, dwNumValues %d\n", dwNumValues);
200 for (dwIndex = 0; dwIndex < dwNumValues; dwIndex++)
202 dwValue =
sizeof(
Value);
212 dwValue =
sizeof(szValue);
226 swscanf(szValueName,
L"ColorTable%2d", &dwColorIndex);
233 if (!
wcscmp(szValueName,
L"CodePage"))
239 else if (!
wcscmp(szValueName,
L"FaceName"))
249 else if (!
wcscmp(szValueName,
L"FontFamily"))
256 else if (!
wcscmp(szValueName,
L"FontSize"))
266 else if (!
wcscmp(szValueName,
L"FontWeight"))
273 else if (!
wcscmp(szValueName,
L"HistoryBufferSize"))
278 else if (!
wcscmp(szValueName,
L"NumberOfHistoryBuffers"))
283 else if (!
wcscmp(szValueName,
L"HistoryNoDup"))
288 else if (!
wcscmp(szValueName,
L"QuickEdit"))
293 else if (!
wcscmp(szValueName,
L"InsertMode"))
298 else if (!
wcscmp(szValueName,
L"ScreenBufferSize"))
304 else if (!
wcscmp(szValueName,
L"FullScreen"))
309 else if (!
wcscmp(szValueName,
L"WindowPosition"))
316 else if (!
wcscmp(szValueName,
L"WindowSize"))
322 else if (!
wcscmp(szValueName,
L"CursorSize"))
327 else if (!
wcscmp(szValueName,
L"ScreenColors"))
332 else if (!
wcscmp(szValueName,
L"PopupColors"))
351#define SetConsoleSetting(SettingName, SettingType, SettingSize, Setting, DefaultValue) \
353 if (DefaultSettings || (!DefaultSettings && (*(Setting) != (DefaultValue)))) \
355 RegSetValueExW(hKey, (SettingName), 0, (SettingType), (PBYTE)(Setting), (SettingSize)); \
359 RegDeleteValueW(hKey, (SettingName)); \
363 WCHAR szValueName[15];
#define RegCloseKey(hKey)
#define NT_SUCCESS(StatCode)
LONG WINAPI RegCreateKeyExW(_In_ HKEY hKey, _In_ LPCWSTR lpSubKey, _In_ DWORD Reserved, _In_opt_ LPWSTR lpClass, _In_ DWORD dwOptions, _In_ REGSAM samDesired, _In_opt_ LPSECURITY_ATTRIBUTES lpSecurityAttributes, _Out_ PHKEY phkResult, _Out_opt_ LPDWORD lpdwDisposition)
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
LONG WINAPI RegSetValueExW(_In_ HKEY hKey, _In_ LPCWSTR lpValueName, _In_ DWORD Reserved, _In_ DWORD dwType, _In_ CONST BYTE *lpData, _In_ DWORD cbData)
LONG WINAPI RegDeleteValueW(HKEY hKey, LPCWSTR lpValueName)
LONG WINAPI RegEnumValueW(_In_ HKEY hKey, _In_ DWORD index, _Out_ LPWSTR value, _Inout_ PDWORD val_count, _Reserved_ PDWORD reserved, _Out_opt_ PDWORD type, _Out_opt_ LPBYTE data, _Inout_opt_ PDWORD count)
LONG WINAPI RegQueryInfoKeyW(HKEY hKey, LPWSTR lpClass, LPDWORD lpcClass, LPDWORD lpReserved, LPDWORD lpcSubKeys, LPDWORD lpcMaxSubKeyLen, LPDWORD lpcMaxClassLen, LPDWORD lpcValues, LPDWORD lpcMaxValueNameLen, LPDWORD lpcMaxValueLen, LPDWORD lpcbSecurityDescriptor, PFILETIME lpftLastWriteTime)
UINT WINAPI GetSystemWindowsDirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
BOOL WINAPI IsValidCodePage(UINT codepage)
UINT WINAPI GetOEMCP(void)
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
_Check_return_ _CRTIMP int __cdecl swscanf(_In_z_ const wchar_t *_Src, _In_z_ _Scanf_format_string_ const wchar_t *_Format,...)
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
NTSYSAPI ULONG WINAPI RtlNtStatusToDosError(NTSTATUS)
NTSYSAPI NTSTATUS NTAPI RtlOpenCurrentUser(_In_ ACCESS_MASK DesiredAccess, _Out_ PHANDLE KeyHandle)
#define REG_OPTION_NON_VOLATILE
NTSTATUS NTAPI NtClose(IN HANDLE Handle)
_Check_return_ _CRTIMP int __cdecl wcscmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
_Check_return_ _CRTIMP int __cdecl wcsncmp(_In_reads_or_z_(_MaxCount) const wchar_t *_Str1, _In_reads_or_z_(_MaxCount) const wchar_t *_Str2, _In_ size_t _MaxCount)
_Check_return_ _CRTIMP int __cdecl _wcsnicmp(_In_reads_or_z_(_MaxCount) const wchar_t *_Str1, _In_reads_or_z_(_MaxCount) const wchar_t *_Str2, _In_ size_t _MaxCount)
STRSAFEAPI StringCchCatW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszSrc)
STRSAFEAPI StringCchCopyW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszSrc)
STRSAFEAPI StringCchCopyNW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszSrc, size_t cchToCopy)
static CONSOLE_SCREEN_BUFFER_INFO ConsoleInfo
#define RtlCopyMemory(Destination, Source, Length)
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _Out_opt_ PUSHORT _Inout_opt_ PUNICODE_STRING Value
#define DEFAULT_SCREEN_ATTRIB
VOID ConCfgInitDefaultSettings(IN OUT PCONSOLE_STATE_INFO ConsoleInfo)
VOID ConCfgGetDefaultSettings(IN OUT PCONSOLE_STATE_INFO ConsoleInfo)
static const COLORREF s_Colors[16]
#define CSR_DEFAULT_CURSOR_SIZE
#define DEFAULT_POPUP_ATTRIB
BOOLEAN ConCfgOpenUserSettings(IN LPCWSTR ConsoleTitle, OUT PHKEY phSubKey, IN REGSAM samDesired, IN BOOLEAN Create)
BOOLEAN ConCfgWriteUserSettings(IN PCONSOLE_STATE_INFO ConsoleInfo, IN BOOLEAN DefaultSettings)
BOOLEAN ConCfgReadUserSettings(IN OUT PCONSOLE_STATE_INFO ConsoleInfo, IN BOOLEAN DefaultSettings)
#define SetConsoleSetting(SettingName, SettingType, SettingSize, Setting, DefaultValue)
static VOID TranslateConsoleName(OUT LPWSTR DestString, IN LPCWSTR ConsoleName, IN UINT MaxStrLen)