[USER32] Refactoring on LoadKeyboardLayout(W/Ex) (#4601)

- Add IntLoadKeyboardLayout (Win: LoadKeyboardLayoutWorker) helper function.
- Use it in LoadKeyboardLayoutW and LoadKeyboardLayoutEx functions.
CORE-11700
This commit is contained in:
Katayama Hirofumi MZ 2022-08-12 09:16:18 +09:00 committed by GitHub
parent c15a9c1d09
commit 1381cea2a7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 34 additions and 13 deletions

View file

@ -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
*/

View file

@ -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
*/