This fixes a crash with .NET application running with such locales, for example en-DE. The crash happens early in initialization, due to failure to return preferred UI language, which happens because there is no LCID -> locale name conversion for custom locales. It doesn't affect just preferred language, but also system default language, and other derived values.
From: Nikolay Sivov nsivov@codeweavers.com
--- dlls/ntdll/unix/env.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/dlls/ntdll/unix/env.c b/dlls/ntdll/unix/env.c index 062da7600b1..9b3bdadd80c 100644 --- a/dlls/ntdll/unix/env.c +++ b/dlls/ntdll/unix/env.c @@ -859,9 +859,9 @@ static void init_locale(void) if ((header = read_nls_file( "locale.nls" ))) { locale_table = (const NLS_LOCALE_HEADER *)((char *)header + header->locales); - if ((locale = get_win_locale( locale_table, system_locale ))) + if ((locale = get_win_locale( locale_table, system_locale )) && locale->idefaultlanguage != LOCALE_CUSTOM_UNSPECIFIED) system_lcid = locale->idefaultlanguage; - if ((locale = get_win_locale( locale_table, user_locale ))) + if ((locale = get_win_locale( locale_table, user_locale )) && locale->idefaultlanguage != LOCALE_CUSTOM_UNSPECIFIED) user_lcid = locale->idefaultlanguage; free( header ); }
Hi,
It looks like your patch introduced the new failures shown below. Please investigate and fix them before resubmitting your patch. If they are not new, fixing them anyway would help a lot. Otherwise please ask for the known failures list to be updated.
The tests also ran into some preexisting test failures. If you know how to fix them that would be helpful. See the TestBot job for the details:
The full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=126306
Your paranoid android.
=== debian11 (32 bit report) ===
ntoskrnl.exe: ntoskrnl.c:1707: Test succeeded inside todo block: got error 997 driver_pnp.c:737: Test failed: expected IRP_MN_REMOVE_DEVICE
Alexandre Julliard (@julliard) commented about dlls/ntdll/unix/env.c:
if ((header = read_nls_file( "locale.nls" ))) { locale_table = (const NLS_LOCALE_HEADER *)((char *)header + header->locales);
if ((locale = get_win_locale( locale_table, system_locale )))
if ((locale = get_win_locale( locale_table, system_locale )) && locale->idefaultlanguage != LOCALE_CUSTOM_UNSPECIFIED) system_lcid = locale->idefaultlanguage;
if ((locale = get_win_locale( locale_table, user_locale )))
if ((locale = get_win_locale( locale_table, user_locale )) && locale->idefaultlanguage != LOCALE_CUSTOM_UNSPECIFIED)
You shouldn't need to do that for the user locale, named locales should work fine there.