mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 01:55:19 +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;
|
DWORD dwNumber;
|
||||||
BOOL bRet = FALSE;
|
BOOL bRet = FALSE;
|
||||||
HKEY hPreloadKey, hSubstKey;
|
HKEY hPreloadKey, hSubstKey;
|
||||||
|
HKL hDefaultKL = NULL;
|
||||||
|
|
||||||
if (!InputList_PrepareUserRegistry(&hPreloadKey, &hSubstKey))
|
if (!InputList_PrepareUserRegistry(&hPreloadKey, &hSubstKey))
|
||||||
{
|
{
|
||||||
|
@ -442,6 +443,9 @@ InputList_Process(VOID)
|
||||||
|
|
||||||
/* Activate the DEFAULT entry */
|
/* Activate the DEFAULT entry */
|
||||||
ActivateKeyboardLayout(pCurrent->hkl, KLF_RESET);
|
ActivateKeyboardLayout(pCurrent->hkl, KLF_RESET);
|
||||||
|
|
||||||
|
/* Save it */
|
||||||
|
hDefaultKL = pCurrent->hkl;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -467,7 +471,7 @@ InputList_Process(VOID)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Change the default keyboard language */
|
/* 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;
|
DWORD dwRecipients = BSM_ALLDESKTOPS | BSM_APPLICATIONS;
|
||||||
|
|
||||||
|
@ -475,7 +479,7 @@ InputList_Process(VOID)
|
||||||
&dwRecipients,
|
&dwRecipients,
|
||||||
WM_INPUTLANGCHANGEREQUEST,
|
WM_INPUTLANGCHANGEREQUEST,
|
||||||
INPUTLANGCHANGE_SYSCHARSET,
|
INPUTLANGCHANGE_SYSCHARSET,
|
||||||
(LPARAM)pCurrent->hkl);
|
(LPARAM)hDefaultKL);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Retry to delete (in case of failure to delete the default keyboard) */
|
/* Retry to delete (in case of failure to delete the default keyboard) */
|
||||||
|
|
Loading…
Reference in a new issue