Commit e74b0dc8 authored by Alexandre Julliard's avatar Alexandre Julliard

kernelbase: Reimplement LocaleNameToLCID() using the locale.nls data.

parent 17c353a3
......@@ -5596,10 +5596,15 @@ INT WINAPI DECLSPEC_HOTPATCH LCMapStringW( LCID lcid, DWORD flags, const WCHAR *
LCID WINAPI DECLSPEC_HOTPATCH LocaleNameToLCID( const WCHAR *name, DWORD flags )
{
LCID lcid;
const NLS_LOCALE_DATA *locale = get_locale_by_name( name, &lcid );
if (!name) return GetUserDefaultLCID();
if (!set_ntstatus( RtlLocaleNameToLcid( name, &lcid, 2 ))) return 0;
if (!(flags & LOCALE_ALLOW_NEUTRAL_NAMES)) lcid = ConvertDefaultLocale( lcid );
if (!locale)
{
SetLastError( ERROR_INVALID_PARAMETER );
return 0;
}
if (!(flags & LOCALE_ALLOW_NEUTRAL_NAMES) && !locale->inotneutral)
lcid = locale->idefaultlanguage;
return lcid;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment