https://git.reactos.org/?p=reactos.git;a=commitdiff;h=5bd03d8b97c4a3c0344f8…
commit 5bd03d8b97c4a3c0344f864dd36feb735f2103a2
Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com>
AuthorDate: Thu Sep 8 11:00:04 2022 +0900
Commit: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com>
CommitDate: Thu Sep 8 11:00:04 2022 +0900
[NTUSER] Implement IntReorderKeyboardLayouts
This function is provided for KLF_REORDER flag.
CORE-11700
---
win32ss/user/ntuser/kbdlayout.c | 16 +++++++++++++---
1 file changed, 13 insertions(+), 3 deletions(-)
diff --git a/win32ss/user/ntuser/kbdlayout.c b/win32ss/user/ntuser/kbdlayout.c
index d41f53d3472..45e055d8758 100644
--- a/win32ss/user/ntuser/kbdlayout.c
+++ b/win32ss/user/ntuser/kbdlayout.c
@@ -745,10 +745,20 @@ co_UserActivateKeyboardLayout(
VOID FASTCALL
IntReorderKeyboardLayouts(
_Inout_ PWINSTATION_OBJECT pWinSta,
- _Inout_ PKL pKL)
+ _Inout_ PKL pNewKL)
{
- /* FIXME */
- gspklBaseLayout = pKL;
+ 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 */