1
0
mirror of https://github.com/valinet/ExplorerPatcher.git synced 2024-11-23 23:21:08 +01:00

L10N: Fixed a little bug in EP_L10N_ApplyPreferredLanguageForCurrentThread

This commit is contained in:
Amrsatrio 2023-11-21 04:36:15 +07:00
parent 72f1458afe
commit a7a3d2727c

View File

@ -48,11 +48,15 @@ BOOL EP_L10N_ApplyPreferredLanguageForCurrentThread()
(LPBYTE)&dwPreferredLanguage,
&dwSize
);
if (lres == ERROR_SUCCESS && dwSize > 0)
if (lres == ERROR_SUCCESS && dwPreferredLanguage != 0)
{
EP_L10N_Language language = LangIDToEPLanguage(dwPreferredLanguage);
EP_L10N_Language language = LangIDToEPLanguage((LANGID)dwPreferredLanguage);
rv = SetThreadPreferredUILanguages(MUI_LANGUAGE_NAME, language.wszId, nullptr);
}
else
{
rv = SetThreadPreferredUILanguages(MUI_LANGUAGE_NAME, nullptr, nullptr);
}
RegCloseKey(hKey);
}
return rv;