From 08a9dc503191b912b2251d5b77824a414338dbbc Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Tue, 29 Mar 2022 22:10:54 +0200 Subject: [PATCH] kernelbase: Reimplement misc locale info values in GetLocaleInfoW/Ex using the locale.nls data. Signed-off-by: Alexandre Julliard --- dlls/kernelbase/locale.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/dlls/kernelbase/locale.c b/dlls/kernelbase/locale.c index a0960703097..669e1b14290 100644 --- a/dlls/kernelbase/locale.c +++ b/dlls/kernelbase/locale.c @@ -1276,7 +1276,7 @@ static int get_locale_info( const NLS_LOCALE_DATA *locale, LCID lcid, LCTYPE typ return locale_return_strarray( locale->sduration, 0, type, buffer, len ); case LOCALE_SKEYBOARDSTOINSTALL: - return -1; + return locale_return_string( locale->skeyboardstoinstall, type, buffer, len ); case LOCALE_SSHORTESTDAYNAME1: case LOCALE_SSHORTESTDAYNAME2: @@ -1304,13 +1304,13 @@ static int get_locale_info( const NLS_LOCALE_DATA *locale, LCID lcid, LCTYPE typ return locale_return_string( locale->sneginfinity, type, buffer, len ); case LOCALE_SSCRIPTS: - return -1; + return locale_return_string( locale->sscripts, type, buffer, len ); case LOCALE_SPARENT: return locale_return_string( locale->sparent, type, buffer, len ); case LOCALE_SCONSOLEFALLBACKNAME: - return -1; + return locale_return_string( locale->sconsolefallbackname, type, buffer, len ); case LOCALE_SLOCALIZEDLANGUAGENAME: /* FIXME: localization */ @@ -1320,7 +1320,7 @@ static int get_locale_info( const NLS_LOCALE_DATA *locale, LCID lcid, LCTYPE typ return locale_return_number( locale->ireadinglayout, type, buffer, len ); case LOCALE_INEUTRAL: - return -1; + return locale_return_number( !locale->inotneutral, type, buffer, len ); case LOCALE_SENGLISHDISPLAYNAME: return locale_return_string( locale->sengdisplayname, type, buffer, len ); @@ -1350,7 +1350,12 @@ static int get_locale_info( const NLS_LOCALE_DATA *locale, LCID lcid, LCTYPE typ return locale_return_string( locale->sopentypelanguagetag, type, buffer, len ); case LOCALE_SSORTLOCALE: - return -1; + if (SORTIDFROMLCID(lcid)) /* custom sort locale */ + { + const NLS_LOCALE_LCID_INDEX *entry = find_lcid_entry( lcid & ~0x80000000 ); + if (entry) return locale_return_string( entry->name, type, buffer, len ); + } + return locale_return_string( locale->ssortlocale, type, buffer, len ); case LOCALE_SRELATIVELONGDATE: return locale_return_string( locale->srelativelongdate, type, buffer, len );