From db3e08770fe9bfb6f06a71761e48a40fe9764058 Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Wed, 3 Feb 2021 17:48:35 -0600 Subject: [PATCH] ntdll: Map LANG_SERBIAN_NEUTRAL in RtlLocaleNameToLcid(). Signed-off-by: Zebediah Figura Signed-off-by: Alexandre Julliard --- dlls/kernel32/tests/locale.c | 10 +++------- dlls/ntdll/locale.c | 3 +++ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/dlls/kernel32/tests/locale.c b/dlls/kernel32/tests/locale.c index 0f409abe3e2..b354f759335 100644 --- a/dlls/kernel32/tests/locale.c +++ b/dlls/kernel32/tests/locale.c @@ -2861,14 +2861,12 @@ static void test_LocaleNameToLCID(void) for (ptr = neutralsublang_names; *ptr->name; ptr++) { lcid = pLocaleNameToLCID(ptr->name, 0); - todo_wine_if (ptr->todo) - ok(lcid == ptr->lcid, "%s: got wrong lcid 0x%04x, expected 0x%04x\n", - wine_dbgstr_w(ptr->name), lcid, ptr->lcid); + ok(lcid == ptr->lcid, "%s: got wrong lcid 0x%04x, expected 0x%04x\n", + wine_dbgstr_w(ptr->name), lcid, ptr->lcid); *buffer = 0; ret = pLCIDToLocaleName(lcid, buffer, ARRAY_SIZE(buffer), 0); ok(ret > 0, "%s: got %d\n", wine_dbgstr_w(ptr->name), ret); - todo_wine_if (ptr->todo) ok(!lstrcmpW(ptr->sname, buffer), "%s: got wrong locale name %s\n", wine_dbgstr_w(ptr->name), wine_dbgstr_w(buffer)); @@ -2974,7 +2972,6 @@ static void test_LocaleNameToLCID(void) status = pRtlLocaleNameToLcid( ptr->name, &lcid, 2 ); ok( !status || broken(ptr->lcid == MAKELANGID(LANG_CHINESE, SUBLANG_CHINESE_SIMPLIFIED)), /* vista */ "%s failed error %x\n", wine_dbgstr_w(ptr->name), status ); - todo_wine_if(ptr->todo) if (!status) ok( lcid == expect, "%s: got wrong lcid 0x%04x, expected 0x%04x\n", wine_dbgstr_w(ptr->name), lcid, expect ); status = pRtlLocaleNameToLcid( ptr->sname, &lcid, 0 ); @@ -4824,8 +4821,7 @@ static void test_GetLocaleInfoEx(void) { val = 0; pGetLocaleInfoEx(ptr->name, LOCALE_ILANGUAGE|LOCALE_RETURN_NUMBER, (WCHAR*)&val, sizeof(val)/sizeof(WCHAR)); - todo_wine_if (ptr->todo) - ok(val == ptr->lcid, "%s: got wrong lcid 0x%04x, expected 0x%04x\n", wine_dbgstr_w(ptr->name), val, ptr->lcid); + ok(val == ptr->lcid, "%s: got wrong lcid 0x%04x, expected 0x%04x\n", wine_dbgstr_w(ptr->name), val, ptr->lcid); bufferW[0] = 0; ret = pGetLocaleInfoEx(ptr->name, LOCALE_SNAME, bufferW, ARRAY_SIZE(bufferW)); ok(ret == lstrlenW(bufferW)+1, "%s: got ret value %d\n", wine_dbgstr_w(ptr->name), ret); diff --git a/dlls/ntdll/locale.c b/dlls/ntdll/locale.c index 3979f41089b..e4d90a8b1d5 100644 --- a/dlls/ntdll/locale.c +++ b/dlls/ntdll/locale.c @@ -1358,6 +1358,9 @@ NTSTATUS WINAPI RtlLocaleNameToLcid( const WCHAR *name, LCID *lcid, ULONG flags case MAKELANGID( LANG_CHINESE, SUBLANG_CHINESE_HONGKONG ): *lcid = MAKELCID( 0x7c04, SORT_DEFAULT ); break; + case MAKELANGID( LANG_SERBIAN, SUBLANG_NEUTRAL ): + *lcid = LANG_SERBIAN_NEUTRAL; + break; default: *lcid = MAKELANGID( PRIMARYLANGID(id), SUBLANG_NEUTRAL ); break;