mirror of
https://github.com/reactos/reactos.git
synced 2026-06-08 08:52:59 +08:00
[NTUSER] Fix UserSetDefaultInputLang by using reordering
- Move IntReorderKeyboardLayouts function. - Fix UserSetDefaultInputLang function. CORE-11700
This commit is contained in:
@@ -556,6 +556,26 @@ UserHklToKbl(HKL hKl)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// Win: ReorderKeyboardLayouts
|
||||
VOID FASTCALL
|
||||
IntReorderKeyboardLayouts(
|
||||
_Inout_ PWINSTATION_OBJECT pWinSta,
|
||||
_Inout_ PKL pNewKL)
|
||||
{
|
||||
PKL pOldKL = gspklBaseLayout;
|
||||
|
||||
if ((pWinSta->Flags & WSS_NOIO) || pNewKL == pOldKL)
|
||||
return;
|
||||
|
||||
pNewKL->pklPrev->pklNext = pNewKL->pklNext;
|
||||
pNewKL->pklNext->pklPrev = pNewKL->pklPrev;
|
||||
pNewKL->pklNext = pOldKL;
|
||||
pNewKL->pklPrev = pOldKL->pklPrev;
|
||||
pOldKL->pklPrev->pklNext = pNewKL;
|
||||
pOldKL->pklPrev = pNewKL;
|
||||
gspklBaseLayout = pNewKL; /* Should we use UserAssignmentLock? */
|
||||
}
|
||||
|
||||
/*
|
||||
* UserSetDefaultInputLang
|
||||
*
|
||||
@@ -571,7 +591,7 @@ UserSetDefaultInputLang(HKL hKl)
|
||||
if (!pKl)
|
||||
return FALSE;
|
||||
|
||||
gspklBaseLayout = pKl;
|
||||
IntReorderKeyboardLayouts(IntGetProcessWindowStation(NULL), pKl);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -741,26 +761,6 @@ co_UserActivateKeyboardLayout(
|
||||
return hOldKL;
|
||||
}
|
||||
|
||||
// Win: ReorderKeyboardLayouts
|
||||
VOID FASTCALL
|
||||
IntReorderKeyboardLayouts(
|
||||
_Inout_ PWINSTATION_OBJECT pWinSta,
|
||||
_Inout_ PKL pNewKL)
|
||||
{
|
||||
PKL pOldKL = gspklBaseLayout;
|
||||
|
||||
if ((pWinSta->Flags & WSS_NOIO) || pNewKL == pOldKL)
|
||||
return;
|
||||
|
||||
pNewKL->pklPrev->pklNext = pNewKL->pklNext;
|
||||
pNewKL->pklNext->pklPrev = pNewKL->pklPrev;
|
||||
pNewKL->pklNext = pOldKL;
|
||||
pNewKL->pklPrev = pOldKL->pklPrev;
|
||||
pOldKL->pklPrev->pklNext = pNewKL;
|
||||
pOldKL->pklPrev = pNewKL;
|
||||
gspklBaseLayout = pNewKL; /* Should we use UserAssignmentLock? */
|
||||
}
|
||||
|
||||
/* Win: xxxActivateKeyboardLayout */
|
||||
HKL APIENTRY
|
||||
co_IntActivateKeyboardLayout(
|
||||
|
||||
Reference in New Issue
Block a user