mirror of
https://github.com/reactos/reactos.git
synced 2024-12-27 09:34:43 +00:00
[INPUT] Fix exception on SPI_SETDEFALTINPUTLANG (#6043)
Follow-up to #4666. Fix an abnormal termination at setting the default language. - pCurrent was NULL at the scene. Don't use it there for SPI_SETDEFALTINPUTLANG. - Save the default keyboard layout. Use it. CORE-11700, CORE-13244, CORE-18364
This commit is contained in:
parent
fb642f727f
commit
f7a4c26322
1 changed files with 6 additions and 2 deletions
|
@ -385,6 +385,7 @@ InputList_Process(VOID)
|
|||
DWORD dwNumber;
|
||||
BOOL bRet = FALSE;
|
||||
HKEY hPreloadKey, hSubstKey;
|
||||
HKL hDefaultKL = NULL;
|
||||
|
||||
if (!InputList_PrepareUserRegistry(&hPreloadKey, &hSubstKey))
|
||||
{
|
||||
|
@ -442,6 +443,9 @@ InputList_Process(VOID)
|
|||
|
||||
/* Activate the DEFAULT entry */
|
||||
ActivateKeyboardLayout(pCurrent->hkl, KLF_RESET);
|
||||
|
||||
/* Save it */
|
||||
hDefaultKL = pCurrent->hkl;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -467,7 +471,7 @@ InputList_Process(VOID)
|
|||
}
|
||||
|
||||
/* Change the default keyboard language */
|
||||
if (SystemParametersInfoW(SPI_SETDEFAULTINPUTLANG, 0, &pCurrent->hkl, 0))
|
||||
if (SystemParametersInfoW(SPI_SETDEFAULTINPUTLANG, 0, &hDefaultKL, 0))
|
||||
{
|
||||
DWORD dwRecipients = BSM_ALLDESKTOPS | BSM_APPLICATIONS;
|
||||
|
||||
|
@ -475,7 +479,7 @@ InputList_Process(VOID)
|
|||
&dwRecipients,
|
||||
WM_INPUTLANGCHANGEREQUEST,
|
||||
INPUTLANGCHANGE_SYSCHARSET,
|
||||
(LPARAM)pCurrent->hkl);
|
||||
(LPARAM)hDefaultKL);
|
||||
}
|
||||
|
||||
/* Retry to delete (in case of failure to delete the default keyboard) */
|
||||
|
|
Loading…
Reference in a new issue