kernelbase: Reimplement LocaleNameToLCID() using the locale.nls data.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
17c353a3bb
commit
e74b0dc880
|
@ -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 WINAPI DECLSPEC_HOTPATCH LocaleNameToLCID( const WCHAR *name, DWORD flags )
|
||||||
{
|
{
|
||||||
LCID lcid;
|
LCID lcid;
|
||||||
|
const NLS_LOCALE_DATA *locale = get_locale_by_name( name, &lcid );
|
||||||
|
|
||||||
if (!name) return GetUserDefaultLCID();
|
if (!locale)
|
||||||
if (!set_ntstatus( RtlLocaleNameToLcid( name, &lcid, 2 ))) return 0;
|
{
|
||||||
if (!(flags & LOCALE_ALLOW_NEUTRAL_NAMES)) lcid = ConvertDefaultLocale( lcid );
|
SetLastError( ERROR_INVALID_PARAMETER );
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
if (!(flags & LOCALE_ALLOW_NEUTRAL_NAMES) && !locale->inotneutral)
|
||||||
|
lcid = locale->idefaultlanguage;
|
||||||
return lcid;
|
return lcid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue