[USER32] Retry: Fix build against 0aa9d9f and 1d10671

CORE-18338
This commit is contained in:
Katayama Hirofumi MZ 2022-08-28 16:12:55 +09:00
parent 1d106717bf
commit 2ba41ad4e0

View file

@ -658,21 +658,12 @@ IntLoadKeyboardLayout(
WCHAR wszRegKey[256] = L"SYSTEM\\CurrentControlSet\\Control\\Keyboard Layouts\\";
WCHAR wszLayoutId[10], wszNewKLID[10], szImeFileName[80];
HKL hNewKL;
HKEY hKey;
BOOL bIsIME;
dwhkl = wcstoul(pwszKLID, NULL, 16);
bIsIME = IS_IME_HKL(UlongToHandle(dwhkl));
if (bIsIME) /* IME? */
{
/* Check "IME File" value */
dwSize = sizeof(szImeFileName);
if (RegQueryValueExW(hKey, L"IME File", NULL, &dwType, (LPBYTE)szImeFileName,
&dwSize) != ERROR_SUCCESS)
{
dwhkl = LOWORD(dwhkl);
}
}
else
if (!bIsIME) /* Not IME? */
{
dwhkl = LOWORD(dwhkl); /* LOWORD of dwhkl is language identifier */
}
@ -713,6 +704,14 @@ IntLoadKeyboardLayout(
dwhkl |= (0xf000 | wcstol(wszLayoutId, NULL, 16)) << 16;
}
/* Check "IME File" value */
dwSize = sizeof(szImeFileName);
if (RegQueryValueExW(hKey, L"IME File", NULL, &dwType, (LPBYTE)szImeFileName,
&dwSize) != ERROR_SUCCESS)
{
dwhkl = LOWORD(dwhkl);
}
/* Close the key now */
RegCloseKey(hKey);
}