mirror of
https://github.com/reactos/reactos.git
synced 2025-05-07 10:46:58 +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 NtUserGetImeInfoEx(long long)
|
||||||
@ stdcall NtUserGetInternalWindowPos(ptr ptr ptr)
|
@ stdcall NtUserGetInternalWindowPos(ptr ptr ptr)
|
||||||
@ stdcall NtUserGetKeyboardLayoutList(long ptr)
|
@ stdcall NtUserGetKeyboardLayoutList(long ptr)
|
||||||
@ stdcall NtUserGetKeyboardLayoutName(str)
|
@ stdcall NtUserGetKeyboardLayoutName(ptr)
|
||||||
@ stdcall NtUserGetKeyboardState(ptr)
|
@ stdcall NtUserGetKeyboardState(ptr)
|
||||||
@ stdcall NtUserGetKeyNameText(long wstr long)
|
@ stdcall NtUserGetKeyNameText(long wstr long)
|
||||||
@ stdcall NtUserGetKeyState(long)
|
@ stdcall NtUserGetKeyState(long)
|
||||||
|
|
|
@ -418,7 +418,7 @@
|
||||||
@ stdcall NtUserGetImeInfoEx(long long)
|
@ stdcall NtUserGetImeInfoEx(long long)
|
||||||
@ stdcall NtUserGetInternalWindowPos(ptr ptr ptr)
|
@ stdcall NtUserGetInternalWindowPos(ptr ptr ptr)
|
||||||
@ stdcall NtUserGetKeyboardLayoutList(long ptr)
|
@ stdcall NtUserGetKeyboardLayoutList(long ptr)
|
||||||
@ stdcall NtUserGetKeyboardLayoutName(str)
|
@ stdcall NtUserGetKeyboardLayoutName(ptr)
|
||||||
@ stdcall NtUserGetKeyboardState(ptr)
|
@ stdcall NtUserGetKeyboardState(ptr)
|
||||||
@ stdcall NtUserGetKeyNameText(long wstr long)
|
@ stdcall NtUserGetKeyNameText(long wstr long)
|
||||||
@ stdcall NtUserGetKeyState(long)
|
@ stdcall NtUserGetKeyState(long)
|
||||||
|
|
|
@ -431,7 +431,7 @@
|
||||||
@ stdcall NtUserGetImeInfoEx(long long)
|
@ stdcall NtUserGetImeInfoEx(long long)
|
||||||
@ stdcall NtUserGetInternalWindowPos(ptr ptr ptr)
|
@ stdcall NtUserGetInternalWindowPos(ptr ptr ptr)
|
||||||
@ stdcall NtUserGetKeyboardLayoutList(long ptr)
|
@ stdcall NtUserGetKeyboardLayoutList(long ptr)
|
||||||
@ stdcall NtUserGetKeyboardLayoutName(str)
|
@ stdcall NtUserGetKeyboardLayoutName(ptr)
|
||||||
@ stdcall NtUserGetKeyboardState(ptr)
|
@ stdcall NtUserGetKeyboardState(ptr)
|
||||||
@ stdcall NtUserGetKeyNameText(long wstr long)
|
@ stdcall NtUserGetKeyNameText(long wstr long)
|
||||||
@ stdcall NtUserGetKeyState(long)
|
@ stdcall NtUserGetKeyState(long)
|
||||||
|
|
|
@ -417,7 +417,7 @@
|
||||||
@ stdcall NtUserGetImeInfoEx(long long)
|
@ stdcall NtUserGetImeInfoEx(long long)
|
||||||
@ stdcall NtUserGetInternalWindowPos(ptr ptr ptr)
|
@ stdcall NtUserGetInternalWindowPos(ptr ptr ptr)
|
||||||
@ stdcall NtUserGetKeyboardLayoutList(long ptr)
|
@ stdcall NtUserGetKeyboardLayoutList(long ptr)
|
||||||
@ stdcall NtUserGetKeyboardLayoutName(str)
|
@ stdcall NtUserGetKeyboardLayoutName(ptr)
|
||||||
@ stdcall NtUserGetKeyboardState(ptr)
|
@ stdcall NtUserGetKeyboardState(ptr)
|
||||||
@ stdcall NtUserGetKeyNameText(long wstr long)
|
@ stdcall NtUserGetKeyNameText(long wstr long)
|
||||||
@ stdcall NtUserGetKeyState(long)
|
@ stdcall NtUserGetKeyState(long)
|
||||||
|
|
|
@ -2431,7 +2431,7 @@ NtUserGetKeyboardLayoutList(
|
||||||
BOOL
|
BOOL
|
||||||
NTAPI
|
NTAPI
|
||||||
NtUserGetKeyboardLayoutName(
|
NtUserGetKeyboardLayoutName(
|
||||||
LPWSTR lpszName);
|
_Inout_ PUNICODE_STRING pustrName);
|
||||||
|
|
||||||
DWORD
|
DWORD
|
||||||
NTAPI
|
NTAPI
|
||||||
|
|
|
@ -649,11 +649,12 @@ Quit:
|
||||||
BOOL
|
BOOL
|
||||||
APIENTRY
|
APIENTRY
|
||||||
NtUserGetKeyboardLayoutName(
|
NtUserGetKeyboardLayoutName(
|
||||||
LPWSTR pwszName)
|
_Inout_ PUNICODE_STRING pustrName)
|
||||||
{
|
{
|
||||||
BOOL bRet = FALSE;
|
BOOL bRet = FALSE;
|
||||||
PKL pKl;
|
PKL pKl;
|
||||||
PTHREADINFO pti;
|
PTHREADINFO pti;
|
||||||
|
UNICODE_STRING ustrTemp;
|
||||||
|
|
||||||
UserEnterShared();
|
UserEnterShared();
|
||||||
|
|
||||||
|
@ -665,8 +666,24 @@ NtUserGetKeyboardLayoutName(
|
||||||
|
|
||||||
_SEH2_TRY
|
_SEH2_TRY
|
||||||
{
|
{
|
||||||
ProbeForWrite(pwszName, KL_NAMELENGTH*sizeof(WCHAR), 1);
|
ProbeForWriteUnicodeString(pustrName);
|
||||||
wcscpy(pwszName, pKl->spkf->awchKF);
|
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;
|
bRet = TRUE;
|
||||||
}
|
}
|
||||||
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
|
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
|
||||||
|
|
|
@ -584,7 +584,13 @@ GetKeyboardLayoutNameA(LPSTR pwszKLID)
|
||||||
BOOL WINAPI
|
BOOL WINAPI
|
||||||
GetKeyboardLayoutNameW(LPWSTR pwszKLID)
|
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