Alexandre Julliard : ntdll: Support overriding the codepage from the manifest.
Alexandre Julliard
julliard at winehq.org
Wed Apr 13 15:14:45 CDT 2022
Module: wine
Branch: master
Commit: 967ef0bf41fc6742398313ebdebd681c1b33dbc3
URL: https://source.winehq.org/git/wine.git/?a=commit;h=967ef0bf41fc6742398313ebdebd681c1b33dbc3
Author: Alexandre Julliard <julliard at winehq.org>
Date: Wed Apr 13 15:58:59 2022 +0200
ntdll: Support overriding the codepage from the manifest.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52223
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/ntdll/loader.c | 2 +-
dlls/ntdll/locale.c | 21 +++++++++++++++++++++
2 files changed, 22 insertions(+), 1 deletion(-)
diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c
index b6cc53763af..d750f7a7579 100644
--- a/dlls/ntdll/loader.c
+++ b/dlls/ntdll/loader.c
@@ -4126,8 +4126,8 @@ void WINAPI LdrInitializeThunk( CONTEXT *context, ULONG_PTR unknown2, ULONG_PTR
RtlInitAnsiString( &func_name, "CtrlRoutine" );
LdrGetProcedureAddress( kernel32->ldr.DllBase, &func_name, 0, (void **)&pCtrlRoutine );
- locale_init();
actctx_init();
+ locale_init();
if (wm->ldr.Flags & LDR_COR_ILONLY)
status = fixup_imports_ilonly( wm, NULL, entry );
else
diff --git a/dlls/ntdll/locale.c b/dlls/ntdll/locale.c
index 3c96a742e4e..b95b3522fce 100644
--- a/dlls/ntdll/locale.c
+++ b/dlls/ntdll/locale.c
@@ -209,6 +209,27 @@ void locale_init(void)
oem_cp = get_locale_data( entry->idx )->idefaultcodepage;
}
+ if (!RtlQueryActivationContextApplicationSettings( 0, NULL, L"http://schemas.microsoft.com/SMI/2019/WindowsSettings",
+ L"activeCodePage", locale, ARRAY_SIZE(locale), NULL ))
+ {
+ const NLS_LOCALE_LCNAME_INDEX *entry = find_lcname_entry( locale );
+
+ if (!wcsicmp( locale, L"utf-8" ))
+ {
+ ansi_cp = oem_cp = CP_UTF8;
+ }
+ else if (!wcsicmp( locale, L"legacy" ))
+ {
+ if (ansi_cp == CP_UTF8) ansi_cp = 1252;
+ if (oem_cp == CP_UTF8) oem_cp = 437;
+ }
+ else if ((entry = find_lcname_entry( locale )))
+ {
+ ansi_cp = get_locale_data( entry->idx )->idefaultansicodepage;
+ oem_cp = get_locale_data( entry->idx )->idefaultcodepage;
+ }
+ }
+
NtGetNlsSectionPtr( 10, 0, NULL, &case_ptr, &size );
NtCurrentTeb()->Peb->UnicodeCaseTableData = case_ptr;
if (ansi_cp != CP_UTF8)
More information about the wine-cvs
mailing list