mirror of
https://github.com/reactos/reactos.git
synced 2025-05-06 10:28:45 +00:00
[NTUSER][USER32] NtUserGetKeyboardLayoutName and GetKeyboardLayoutNameW (#4595)
#4594 has proved that the 1st argument of NtUserGetKeyboardLayoutName has type PUNICODE_STRING. CORE-11700
This commit is contained in:
parent
786017c5b6
commit
3e42f7b478
7 changed files with 32 additions and 9 deletions
|
@ -417,7 +417,7 @@
|
|||
@ stdcall NtUserGetImeInfoEx(long long)
|
||||
@ stdcall NtUserGetInternalWindowPos(ptr ptr ptr)
|
||||
@ stdcall NtUserGetKeyboardLayoutList(long ptr)
|
||||
@ stdcall NtUserGetKeyboardLayoutName(str)
|
||||
@ stdcall NtUserGetKeyboardLayoutName(ptr)
|
||||
@ stdcall NtUserGetKeyboardState(ptr)
|
||||
@ stdcall NtUserGetKeyNameText(long wstr long)
|
||||
@ stdcall NtUserGetKeyState(long)
|
||||
|
|
|
@ -418,7 +418,7 @@
|
|||
@ stdcall NtUserGetImeInfoEx(long long)
|
||||
@ stdcall NtUserGetInternalWindowPos(ptr ptr ptr)
|
||||
@ stdcall NtUserGetKeyboardLayoutList(long ptr)
|
||||
@ stdcall NtUserGetKeyboardLayoutName(str)
|
||||
@ stdcall NtUserGetKeyboardLayoutName(ptr)
|
||||
@ stdcall NtUserGetKeyboardState(ptr)
|
||||
@ stdcall NtUserGetKeyNameText(long wstr long)
|
||||
@ stdcall NtUserGetKeyState(long)
|
||||
|
|
|
@ -431,7 +431,7 @@
|
|||
@ stdcall NtUserGetImeInfoEx(long long)
|
||||
@ stdcall NtUserGetInternalWindowPos(ptr ptr ptr)
|
||||
@ stdcall NtUserGetKeyboardLayoutList(long ptr)
|
||||
@ stdcall NtUserGetKeyboardLayoutName(str)
|
||||
@ stdcall NtUserGetKeyboardLayoutName(ptr)
|
||||
@ stdcall NtUserGetKeyboardState(ptr)
|
||||
@ stdcall NtUserGetKeyNameText(long wstr long)
|
||||
@ stdcall NtUserGetKeyState(long)
|
||||
|
|
|
@ -417,7 +417,7 @@
|
|||
@ stdcall NtUserGetImeInfoEx(long long)
|
||||
@ stdcall NtUserGetInternalWindowPos(ptr ptr ptr)
|
||||
@ stdcall NtUserGetKeyboardLayoutList(long ptr)
|
||||
@ stdcall NtUserGetKeyboardLayoutName(str)
|
||||
@ stdcall NtUserGetKeyboardLayoutName(ptr)
|
||||
@ stdcall NtUserGetKeyboardState(ptr)
|
||||
@ stdcall NtUserGetKeyNameText(long wstr long)
|
||||
@ stdcall NtUserGetKeyState(long)
|
||||
|
|
|
@ -2431,7 +2431,7 @@ NtUserGetKeyboardLayoutList(
|
|||
BOOL
|
||||
NTAPI
|
||||
NtUserGetKeyboardLayoutName(
|
||||
LPWSTR lpszName);
|
||||
_Inout_ PUNICODE_STRING pustrName);
|
||||
|
||||
DWORD
|
||||
NTAPI
|
||||
|
|
|
@ -649,11 +649,12 @@ Quit:
|
|||
BOOL
|
||||
APIENTRY
|
||||
NtUserGetKeyboardLayoutName(
|
||||
LPWSTR pwszName)
|
||||
_Inout_ PUNICODE_STRING pustrName)
|
||||
{
|
||||
BOOL bRet = FALSE;
|
||||
PKL pKl;
|
||||
PTHREADINFO pti;
|
||||
UNICODE_STRING ustrTemp;
|
||||
|
||||
UserEnterShared();
|
||||
|
||||
|
@ -665,8 +666,24 @@ NtUserGetKeyboardLayoutName(
|
|||
|
||||
_SEH2_TRY
|
||||
{
|
||||
ProbeForWrite(pwszName, KL_NAMELENGTH*sizeof(WCHAR), 1);
|
||||
wcscpy(pwszName, pKl->spkf->awchKF);
|
||||
ProbeForWriteUnicodeString(pustrName);
|
||||
ProbeForWrite(pustrName->Buffer, pustrName->MaximumLength, 1);
|
||||
|
||||
if (IS_IME_HKL(pKl->hkl))
|
||||
{
|
||||
RtlIntegerToUnicodeString((ULONG)(ULONG_PTR)pKl->hkl, 16, pustrName);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (pustrName->MaximumLength < KL_NAMELENGTH * sizeof(WCHAR))
|
||||
{
|
||||
EngSetLastError(ERROR_INVALID_PARAMETER);
|
||||
goto cleanup;
|
||||
}
|
||||
RtlInitUnicodeString(&ustrTemp, pKl->spkf->awchKF); /* FIXME: Do not use awchKF */
|
||||
RtlCopyUnicodeString(pustrName, &ustrTemp);
|
||||
}
|
||||
|
||||
bRet = TRUE;
|
||||
}
|
||||
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
|
||||
|
|
|
@ -584,7 +584,13 @@ GetKeyboardLayoutNameA(LPSTR pwszKLID)
|
|||
BOOL WINAPI
|
||||
GetKeyboardLayoutNameW(LPWSTR pwszKLID)
|
||||
{
|
||||
return NtUserGetKeyboardLayoutName(pwszKLID);
|
||||
UNICODE_STRING Name;
|
||||
|
||||
RtlInitEmptyUnicodeString(&Name,
|
||||
pwszKLID,
|
||||
KL_NAMELENGTH * sizeof(WCHAR));
|
||||
|
||||
return NtUserGetKeyboardLayoutName(&Name);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Reference in a new issue