mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 09:03:25 +00:00
[KERNEL32][WINNLS] GetGeoInfoW: Allow to get localized text
Previous implementation ignored the last LangId parameter, and always used GetUserDefaultLCID() instead.
This commit is contained in:
parent
1b35626d54
commit
4278f46620
2 changed files with 29 additions and 6 deletions
|
@ -36,7 +36,11 @@ DEBUG_CHANNEL(nls);
|
||||||
extern int wine_fold_string(int flags, const WCHAR *src, int srclen, WCHAR *dst, int dstlen);
|
extern int wine_fold_string(int flags, const WCHAR *src, int srclen, WCHAR *dst, int dstlen);
|
||||||
extern int wine_get_sortkey(int flags, const WCHAR *src, int srclen, char *dst, int dstlen);
|
extern int wine_get_sortkey(int flags, const WCHAR *src, int srclen, char *dst, int dstlen);
|
||||||
extern int wine_compare_string(int flags, const WCHAR *str1, int len1, const WCHAR *str2, int len2);
|
extern int wine_compare_string(int flags, const WCHAR *str1, int len1, const WCHAR *str2, int len2);
|
||||||
|
#ifdef __REACTOS__
|
||||||
|
extern UINT GetLocalisedText(IN UINT uID, IN LPWSTR lpszDest, IN UINT cchDest, IN LANGID lang);
|
||||||
|
#else
|
||||||
extern UINT GetLocalisedText(IN UINT uID, IN LPWSTR lpszDest, IN UINT cchDest);
|
extern UINT GetLocalisedText(IN UINT uID, IN LPWSTR lpszDest, IN UINT cchDest);
|
||||||
|
#endif
|
||||||
#define NLSRC_OFFSET 5000 /* FIXME */
|
#define NLSRC_OFFSET 5000 /* FIXME */
|
||||||
|
|
||||||
extern HMODULE kernel32_handle;
|
extern HMODULE kernel32_handle;
|
||||||
|
@ -3503,16 +3507,28 @@ BOOL WINAPI EnumUILanguagesW(UILANGUAGE_ENUMPROCW pUILangEnumProc, DWORD dwFlags
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
#ifdef __REACTOS__
|
||||||
|
NLS_GetGeoFriendlyName(GEOID Location, LPWSTR szFriendlyName, int cchData, LANGID lang)
|
||||||
|
#else
|
||||||
NLS_GetGeoFriendlyName(GEOID Location, LPWSTR szFriendlyName, int cchData)
|
NLS_GetGeoFriendlyName(GEOID Location, LPWSTR szFriendlyName, int cchData)
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
/* FIXME: move *.nls resources out of kernel32 into locale.nls */
|
/* FIXME: move *.nls resources out of kernel32 into locale.nls */
|
||||||
Location += NLSRC_OFFSET;
|
Location += NLSRC_OFFSET;
|
||||||
Location &= 0xFFFF;
|
Location &= 0xFFFF;
|
||||||
|
|
||||||
if (cchData == 0)
|
if (cchData == 0)
|
||||||
|
#ifdef __REACTOS__
|
||||||
|
return GetLocalisedText(Location, NULL, 0, lang);
|
||||||
|
#else
|
||||||
return GetLocalisedText(Location, NULL, 0);
|
return GetLocalisedText(Location, NULL, 0);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef __REACTOS__
|
||||||
|
if (GetLocalisedText(Location, szFriendlyName, (UINT)cchData, lang))
|
||||||
|
#else
|
||||||
if (GetLocalisedText(Location, szFriendlyName, (UINT)cchData))
|
if (GetLocalisedText(Location, szFriendlyName, (UINT)cchData))
|
||||||
|
#endif
|
||||||
return strlenW(szFriendlyName) + 1;
|
return strlenW(szFriendlyName) + 1;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -3564,7 +3580,11 @@ INT WINAPI GetGeoInfoW(GEOID geoid, GEOTYPE geotype, LPWSTR data, int data_len,
|
||||||
switch (geotype) {
|
switch (geotype) {
|
||||||
case GEO_FRIENDLYNAME:
|
case GEO_FRIENDLYNAME:
|
||||||
{
|
{
|
||||||
|
#ifdef __REACTOS__
|
||||||
|
return NLS_GetGeoFriendlyName(geoid, data, data_len, lang);
|
||||||
|
#else
|
||||||
return NLS_GetGeoFriendlyName(geoid, data, data_len);
|
return NLS_GetGeoFriendlyName(geoid, data, data_len);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
case GEO_NATION:
|
case GEO_NATION:
|
||||||
val = geoid;
|
val = geoid;
|
||||||
|
|
|
@ -1828,7 +1828,8 @@ UINT
|
||||||
GetLocalisedText(
|
GetLocalisedText(
|
||||||
IN UINT uID,
|
IN UINT uID,
|
||||||
IN LPWSTR lpszDest,
|
IN LPWSTR lpszDest,
|
||||||
IN UINT cchDest)
|
IN UINT cchDest,
|
||||||
|
IN LANGID lang)
|
||||||
{
|
{
|
||||||
HRSRC hrsrc;
|
HRSRC hrsrc;
|
||||||
HGLOBAL hmem;
|
HGLOBAL hmem;
|
||||||
|
@ -1841,8 +1842,7 @@ GetLocalisedText(
|
||||||
if (uID == 37)
|
if (uID == 37)
|
||||||
uID = uID * 100;
|
uID = uID * 100;
|
||||||
|
|
||||||
lcid = GetUserDefaultLCID();
|
lcid = ConvertDefaultLocale(lang);
|
||||||
lcid = ConvertDefaultLocale(lcid);
|
|
||||||
|
|
||||||
langId = LANGIDFROMLCID(lcid);
|
langId = LANGIDFROMLCID(lcid);
|
||||||
|
|
||||||
|
@ -1981,7 +1981,8 @@ GetCPInfoExW(UINT CodePage,
|
||||||
lpCPInfoEx->UnicodeDefaultChar = 0x3f;
|
lpCPInfoEx->UnicodeDefaultChar = 0x3f;
|
||||||
return GetLocalisedText(lpCPInfoEx->CodePage,
|
return GetLocalisedText(lpCPInfoEx->CodePage,
|
||||||
lpCPInfoEx->CodePageName,
|
lpCPInfoEx->CodePageName,
|
||||||
ARRAYSIZE(lpCPInfoEx->CodePageName)) != 0;
|
ARRAYSIZE(lpCPInfoEx->CodePageName),
|
||||||
|
GetThreadLocale()) != 0;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -1991,7 +1992,8 @@ GetCPInfoExW(UINT CodePage,
|
||||||
lpCPInfoEx->UnicodeDefaultChar = 0x3f;
|
lpCPInfoEx->UnicodeDefaultChar = 0x3f;
|
||||||
return GetLocalisedText(lpCPInfoEx->CodePage,
|
return GetLocalisedText(lpCPInfoEx->CodePage,
|
||||||
lpCPInfoEx->CodePageName,
|
lpCPInfoEx->CodePageName,
|
||||||
ARRAYSIZE(lpCPInfoEx->CodePageName)) != 0;
|
ARRAYSIZE(lpCPInfoEx->CodePageName),
|
||||||
|
GetThreadLocale()) != 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
@ -2010,7 +2012,8 @@ GetCPInfoExW(UINT CodePage,
|
||||||
lpCPInfoEx->UnicodeDefaultChar = CodePageEntry->CodePageTable.UniDefaultChar;
|
lpCPInfoEx->UnicodeDefaultChar = CodePageEntry->CodePageTable.UniDefaultChar;
|
||||||
return GetLocalisedText(lpCPInfoEx->CodePage,
|
return GetLocalisedText(lpCPInfoEx->CodePage,
|
||||||
lpCPInfoEx->CodePageName,
|
lpCPInfoEx->CodePageName,
|
||||||
ARRAYSIZE(lpCPInfoEx->CodePageName)) != 0;
|
ARRAYSIZE(lpCPInfoEx->CodePageName),
|
||||||
|
GetThreadLocale()) != 0;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue