From 3d8292ede66ef5929e9eae76944d2425588be5b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Mon, 17 Apr 2017 23:31:48 +0000 Subject: [PATCH] [CONCFG]: Addendum for r74366: Initialize the console settings information codepage with the current OEM codepage, and read the optional console "CodePage" DWORD registry setting. CORE-12451 svn path=/trunk/; revision=74368 --- reactos/win32ss/user/winsrv/concfg/settings.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/reactos/win32ss/user/winsrv/concfg/settings.c b/reactos/win32ss/user/winsrv/concfg/settings.c index 2d26bfd544a..eadf949abe8 100644 --- a/reactos/win32ss/user/winsrv/concfg/settings.c +++ b/reactos/win32ss/user/winsrv/concfg/settings.c @@ -19,6 +19,7 @@ #include #include // For LF_FACESIZE #include +#include #include // #include // #include @@ -254,7 +255,13 @@ ConCfgReadUserSettings(IN OUT PCONSOLE_STATE_INFO ConsoleInfo, Success = TRUE; } } - if (!wcscmp(szValueName, L"FaceName")) + if (!wcscmp(szValueName, L"CodePage")) + { + if (IsValidCodePage(Value)) + ConsoleInfo->CodePage = Value; + Success = TRUE; + } + else if (!wcscmp(szValueName, L"FaceName")) { wcsncpy(ConsoleInfo->FaceName, szValue, LF_FACESIZE); ConsoleInfo->FaceName[LF_FACESIZE - 1] = UNICODE_NULL; @@ -385,6 +392,7 @@ do { SetConsoleSetting(szValueName, REG_DWORD, sizeof(DWORD), &ConsoleInfo->ColorTable[i], s_Colors[i]); } + SetConsoleSetting(L"CodePage", REG_DWORD, sizeof(DWORD), &ConsoleInfo->CodePage, CP_ACP /* CP_OEMCP */); SetConsoleSetting(L"FaceName", REG_SZ, (wcslen(ConsoleInfo->FaceName) + 1) * sizeof(WCHAR), ConsoleInfo->FaceName, UNICODE_NULL); // wcsnlen SetConsoleSetting(L"FontFamily", REG_DWORD, sizeof(DWORD), &ConsoleInfo->FontFamily, FF_DONTCARE); @@ -487,7 +495,7 @@ ConCfgInitDefaultSettings(IN OUT PCONSOLE_STATE_INFO ConsoleInfo) RtlCopyMemory(ConsoleInfo->ColorTable, s_Colors, sizeof(s_Colors)); - ConsoleInfo->CodePage = 0; + ConsoleInfo->CodePage = GetOEMCP(); } VOID