mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 10:04:49 +00:00
[USER32] Improve CliGetPreloadKeyboardLayouts
CORE-11700
This commit is contained in:
parent
10acb335fa
commit
21feb529fe
1 changed files with 7 additions and 4 deletions
|
@ -369,7 +369,7 @@ BOOL FASTCALL CliGetImeHotKeysFromRegistry(VOID)
|
|||
|
||||
VOID APIENTRY CliGetPreloadKeyboardLayouts(PBYTE pbFlags)
|
||||
{
|
||||
WCHAR szValueName[8], szValue[16];
|
||||
WCHAR szValueName[12], szValue[16];
|
||||
UNICODE_STRING ustrValue;
|
||||
DWORD dwKL, cbValue, dwType;
|
||||
UINT iNumber;
|
||||
|
@ -382,14 +382,17 @@ VOID APIENTRY CliGetPreloadKeyboardLayouts(PBYTE pbFlags)
|
|||
|
||||
for (iNumber = 1; iNumber < 1000; ++iNumber)
|
||||
{
|
||||
StringCchPrintfW(szValueName, _countof(szValueName), L"%u", iNumber);
|
||||
RtlIntegerToUnicode(iNumber, 10, sizeof(szValueName), szValueName);
|
||||
|
||||
cbValue = sizeof(szValue);
|
||||
error = RegQueryValueExW(hKey, szValueName, NULL, &dwType, (LPBYTE)szValue, &cbValue);
|
||||
if (error != ERROR_SUCCESS || dwType != REG_SZ)
|
||||
if (error != ERROR_SUCCESS)
|
||||
break;
|
||||
|
||||
szValue[_countof(szValue) - 1] = 0;
|
||||
if (dwType != REG_SZ)
|
||||
continue;
|
||||
|
||||
szValue[_countof(szValue) - 1] = 0; /* Avoid stack overrun */
|
||||
|
||||
RtlInitUnicodeString(&ustrValue, szValue);
|
||||
RtlUnicodeStringToInteger(&ustrValue, 16, &dwKL);
|
||||
|
|
Loading…
Reference in a new issue