[WINESYNC] kernel32: Don't return a parent locale for neutral locales in GetLocaleInfoEx.

Signed-off-by: Alexandre Julliard <[email protected]>

wine commit id c63a08586f19af7e6a65a064696743f648006fcd by Alexandre Julliard <[email protected]>
This commit is contained in:
winesync
2024-05-03 16:10:00 +02:00
committed by Timo Kreuzer
parent 90c0562935
commit c08580dee3
+13 -7
View File
@@ -1831,16 +1831,22 @@ INT WINAPI GetLocaleInfoEx(LPCWSTR locale, LCTYPE info, LPWSTR buffer, INT len)
if (!lcid) return 0;
/* special handling for neutral locale names */
if (info == LOCALE_SNAME && locale && strlenW(locale) == 2)
if (locale && strlenW(locale) == 2)
{
if (len && len < 3)
switch (info)
{
SetLastError(ERROR_INSUFFICIENT_BUFFER);
return 0;
case LOCALE_SNAME:
if (len && len < 3)
{
SetLastError(ERROR_INSUFFICIENT_BUFFER);
return 0;
}
if (len) strcpyW(buffer, locale);
return 3;
case LOCALE_SPARENT:
if (len) buffer[0] = 0;
return 1;
}
if (len) strcpyW(buffer, locale);
return 3;
}
return GetLocaleInfoW(lcid, info, buffer, len);