mirror of
https://github.com/reactos/reactos.git
synced 2024-07-04 03:34:16 +00:00
[KERNEL32]
Use actual codepage numbers for ANSI and OEM codepages. CORE-7568 #resolve #comment Committed. svn path=/trunk/; revision=63641
This commit is contained in:
parent
6e592c35e9
commit
c19093060f
|
@ -89,21 +89,22 @@ NlsInit(VOID)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Setup ANSI code page. */
|
/* Setup ANSI code page. */
|
||||||
AnsiCodePage.CodePage = CP_ACP;
|
|
||||||
AnsiCodePage.SectionHandle = NULL;
|
AnsiCodePage.SectionHandle = NULL;
|
||||||
AnsiCodePage.SectionMapping = NtCurrentTeb()->ProcessEnvironmentBlock->AnsiCodePageData;
|
AnsiCodePage.SectionMapping = NtCurrentTeb()->ProcessEnvironmentBlock->AnsiCodePageData;
|
||||||
|
|
||||||
RtlInitCodePageTable((PUSHORT)AnsiCodePage.SectionMapping,
|
RtlInitCodePageTable((PUSHORT)AnsiCodePage.SectionMapping,
|
||||||
&AnsiCodePage.CodePageTable);
|
&AnsiCodePage.CodePageTable);
|
||||||
|
AnsiCodePage.CodePage = AnsiCodePage.CodePageTable.CodePage;
|
||||||
|
|
||||||
InsertTailList(&CodePageListHead, &AnsiCodePage.Entry);
|
InsertTailList(&CodePageListHead, &AnsiCodePage.Entry);
|
||||||
|
|
||||||
/* Setup OEM code page. */
|
/* Setup OEM code page. */
|
||||||
OemCodePage.CodePage = CP_OEMCP;
|
|
||||||
OemCodePage.SectionHandle = NULL;
|
OemCodePage.SectionHandle = NULL;
|
||||||
OemCodePage.SectionMapping = NtCurrentTeb()->ProcessEnvironmentBlock->OemCodePageData;
|
OemCodePage.SectionMapping = NtCurrentTeb()->ProcessEnvironmentBlock->OemCodePageData;
|
||||||
|
|
||||||
RtlInitCodePageTable((PUSHORT)OemCodePage.SectionMapping,
|
RtlInitCodePageTable((PUSHORT)OemCodePage.SectionMapping,
|
||||||
&OemCodePage.CodePageTable);
|
&OemCodePage.CodePageTable);
|
||||||
|
OemCodePage.CodePage = OemCodePage.CodePageTable.CodePage;
|
||||||
InsertTailList(&CodePageListHead, &OemCodePage.Entry);
|
InsertTailList(&CodePageListHead, &OemCodePage.Entry);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
@ -199,8 +200,15 @@ IntGetCodePageEntry(UINT CodePage)
|
||||||
WCHAR FileName[MAX_PATH + 1];
|
WCHAR FileName[MAX_PATH + 1];
|
||||||
UINT FileNamePos;
|
UINT FileNamePos;
|
||||||
PCODEPAGE_ENTRY CodePageEntry;
|
PCODEPAGE_ENTRY CodePageEntry;
|
||||||
|
if (CodePage == CP_ACP)
|
||||||
if (CodePage == CP_THREAD_ACP)
|
{
|
||||||
|
return &AnsiCodePage;
|
||||||
|
}
|
||||||
|
else if (CodePage == CP_OEMCP)
|
||||||
|
{
|
||||||
|
return &OemCodePage;
|
||||||
|
}
|
||||||
|
else if (CodePage == CP_THREAD_ACP)
|
||||||
{
|
{
|
||||||
if (!GetLocaleInfoW(GetThreadLocale(),
|
if (!GetLocaleInfoW(GetThreadLocale(),
|
||||||
LOCALE_IDEFAULTANSICODEPAGE | LOCALE_RETURN_NUMBER,
|
LOCALE_IDEFAULTANSICODEPAGE | LOCALE_RETURN_NUMBER,
|
||||||
|
@ -1816,7 +1824,7 @@ GetCPInfoExW(UINT CodePage,
|
||||||
|
|
||||||
lpCPInfoEx->CodePage = CodePageEntry->CodePageTable.CodePage;
|
lpCPInfoEx->CodePage = CodePageEntry->CodePageTable.CodePage;
|
||||||
lpCPInfoEx->UnicodeDefaultChar = CodePageEntry->CodePageTable.UniDefaultChar;
|
lpCPInfoEx->UnicodeDefaultChar = CodePageEntry->CodePageTable.UniDefaultChar;
|
||||||
return GetLocalisedText((DWORD)CodePage, lpCPInfoEx->CodePageName);
|
return GetLocalisedText(CodePageEntry->CodePageTable.CodePage, lpCPInfoEx->CodePageName);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue