https://git.reactos.org/?p=reactos.git;a=commitdiff;h=1381cea2a73245002c09e…
commit 1381cea2a73245002c09ee3f3a743dd6b7111589
Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com>
AuthorDate: Fri Aug 12 09:16:18 2022 +0900
Commit: GitHub <noreply(a)github.com>
CommitDate: Fri Aug 12 09:16:18 2022 +0900
[USER32] Refactoring on LoadKeyboardLayout(W/Ex) (#4601)
- Add IntLoadKeyboardLayout (Win: LoadKeyboardLayoutWorker) helper function.
- Use it in LoadKeyboardLayoutW and LoadKeyboardLayoutEx functions.
CORE-11700
---
win32ss/user/user32/misc/stubs.c | 9 ---------
win32ss/user/user32/windows/input.c | 38 +++++++++++++++++++++++++++++++++----
2 files changed, 34 insertions(+), 13 deletions(-)
diff --git a/win32ss/user/user32/misc/stubs.c b/win32ss/user/user32/misc/stubs.c
index 8199c0222f7..bb1754b781f 100644
--- a/win32ss/user/user32/misc/stubs.c
+++ b/win32ss/user/user32/misc/stubs.c
@@ -441,15 +441,6 @@ BOOL WINAPI IsServerSideWindow(HWND wnd)
return FALSE;
}
-/*
- * @unimplemented
- */
-HKL WINAPI LoadKeyboardLayoutEx(DWORD unknown,LPCWSTR pwszKLID,UINT Flags) //1st
parameter unknown
-{
- UNIMPLEMENTED;
- return FALSE;
-}
-
/*
* @unimplemented
*/
diff --git a/win32ss/user/user32/windows/input.c b/win32ss/user/user32/windows/input.c
index 1de1dc0f293..dd396999e3b 100644
--- a/win32ss/user/user32/windows/input.c
+++ b/win32ss/user/user32/windows/input.c
@@ -639,11 +639,16 @@ LoadKeyboardLayoutA(LPCSTR pszKLID,
}
/*
- * @implemented
+ * @unimplemented
*/
-HKL WINAPI
-LoadKeyboardLayoutW(LPCWSTR pwszKLID,
- UINT Flags)
+/* Win: LoadKeyboardLayoutWorker */
+HKL APIENTRY
+IntLoadKeyboardLayout(
+ _In_ HKL hklUnload,
+ _In_z_ LPCWSTR pwszKLID,
+ _In_ LANGID wLangID,
+ _In_ UINT Flags,
+ _In_ BOOL unknown5)
{
DWORD dwhkl, dwType, dwSize;
UNICODE_STRING ustrKbdName;
@@ -712,6 +717,31 @@ LoadKeyboardLayoutW(LPCWSTR pwszKLID,
dwhkl, Flags);
}
+/*
+ * @implemented
+ */
+HKL WINAPI
+LoadKeyboardLayoutW(LPCWSTR pwszKLID,
+ UINT Flags)
+{
+ TRACE("(%s, 0x%X)", debugstr_w(pwszKLID), Flags);
+ return IntLoadKeyboardLayout(NULL, pwszKLID, 0, Flags, FALSE);
+}
+
+/*
+ * @unimplemented
+ */
+HKL WINAPI
+LoadKeyboardLayoutEx(HKL hklUnload,
+ LPCWSTR pwszKLID,
+ UINT Flags)
+{
+ FIXME("(%p, %s, 0x%X)", hklUnload, debugstr_w(pwszKLID), Flags);
+ if (!hklUnload)
+ return NULL;
+ return IntLoadKeyboardLayout(hklUnload, pwszKLID, 0, Flags, FALSE);
+}
+
/*
* @implemented
*/