Re: [PATCH v3] vbscript/tests: Fix test for WeekDayName(foo, bar, 0).

Jacek Caban <[email protected]>
Newsgroups gmane.comp.emulators.wine.patches
Message-ID <[email protected]>
Hi Alex,

On 01.11.2017 22:04, Alex Henrie wrote:
> -    if (!hkernel32)
> +    if (pGetThreadUILanguage)
>      {
> -        hkernel32 = GetModuleHandleA("kernel32.dll");
> -        pGetThreadUILanguage = (void*)GetProcAddress(hkernel32, "GetThreadUILanguage");
> -        pGetUserDefaultUILanguage = (void*)GetProcAddress(hkernel32, "GetUserDefaultUILanguage");
> +        is_english = (PRIMARYLANGID(pGetThreadUILanguage()) == LANG_ENGLISH &&
> +                      PRIMARYLANGID(GetUserDefaultUILanguage()) == LANG_ENGLISH &&
> +                      PRIMARYLANGID(GetUserDefaultLangID()) == LANG_ENGLISH);


I think you don't want to skip those tests if GetThreadUILanguage is not
available, just don't use it. Something like:

is_english = (!pGetThreadUILanguage ||
PRIMARYLANGID(pGetThreadUILanguage()) == LANG_ENGLISH) && /* other tests */;

should do the trick.


Thanks,

Jacek
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.