mirror of
https://github.com/reactos/reactos.git
synced 2025-05-06 18:31:26 +00:00
[KBSWITCH][IMM32][USER32] Consider keyboard layout corner cases
Considering invalid Keyboard Layout registry entries. CORE-11700
This commit is contained in:
parent
fb86db15bb
commit
bbef618032
3 changed files with 6 additions and 4 deletions
|
@ -341,7 +341,7 @@ BuildLeftPopupMenu(VOID)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!GetLayoutName(szLayoutNum, szName, ARRAYSIZE(szName)))
|
if (!GetLayoutName(szLayoutNum, szName, ARRAYSIZE(szName)))
|
||||||
break;
|
continue;
|
||||||
|
|
||||||
AppendMenu(hMenu, MF_STRING, _ttoi(szLayoutNum), szName);
|
AppendMenu(hMenu, MF_STRING, _ttoi(szLayoutNum), szName);
|
||||||
}
|
}
|
||||||
|
|
|
@ -898,7 +898,7 @@ UINT APIENTRY Imm32GetImeLayout(PREG_IME pLayouts, UINT cLayouts)
|
||||||
|
|
||||||
lError = RegOpenKeyW(hkeyLayouts, szImeKey, &hkeyIME); /* Open the IME key */
|
lError = RegOpenKeyW(hkeyLayouts, szImeKey, &hkeyIME); /* Open the IME key */
|
||||||
if (lError != ERROR_SUCCESS)
|
if (lError != ERROR_SUCCESS)
|
||||||
break;
|
continue;
|
||||||
|
|
||||||
/* Load the "Ime File" value */
|
/* Load the "Ime File" value */
|
||||||
szImeFileName[0] = 0;
|
szImeFileName[0] = 0;
|
||||||
|
@ -910,12 +910,12 @@ UINT APIENTRY Imm32GetImeLayout(PREG_IME pLayouts, UINT cLayouts)
|
||||||
|
|
||||||
/* We don't allow the invalid "IME File" values for security reason */
|
/* We don't allow the invalid "IME File" values for security reason */
|
||||||
if (!szImeFileName[0] || wcscspn(szImeFileName, L":\\/") != wcslen(szImeFileName))
|
if (!szImeFileName[0] || wcscspn(szImeFileName, L":\\/") != wcslen(szImeFileName))
|
||||||
break;
|
continue;
|
||||||
|
|
||||||
Imm32StrToUInt(szImeKey, &Value, 16);
|
Imm32StrToUInt(szImeKey, &Value, 16);
|
||||||
hKL = (HKL)(DWORD_PTR)Value;
|
hKL = (HKL)(DWORD_PTR)Value;
|
||||||
if (!IS_IME_HKL(hKL))
|
if (!IS_IME_HKL(hKL))
|
||||||
break;
|
continue;
|
||||||
|
|
||||||
/* Store the IME key and the IME filename */
|
/* Store the IME key and the IME filename */
|
||||||
pLayouts[nCount].hKL = hKL;
|
pLayouts[nCount].hKL = hKL;
|
||||||
|
|
|
@ -796,6 +796,7 @@ IntLoadKeyboardLayout(
|
||||||
{
|
{
|
||||||
bIsIME = FALSE;
|
bIsIME = FALSE;
|
||||||
wHigh = 0;
|
wHigh = 0;
|
||||||
|
ERR("0x%X\n", dwKLID);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -810,6 +811,7 @@ IntLoadKeyboardLayout(
|
||||||
{
|
{
|
||||||
bIsIME = FALSE;
|
bIsIME = FALSE;
|
||||||
wHigh = 0;
|
wHigh = 0;
|
||||||
|
ERR("'%s'\n", debugstr_w(szPath));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue