Commit 151694a0 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

user32: Handle NULL argument in GetKeyboardLayoutNameW().

parent ab1eee50
......@@ -966,6 +966,11 @@ BOOL WINAPI GetKeyboardLayoutNameA(LPSTR pszKLID)
*/
BOOL WINAPI GetKeyboardLayoutNameW(LPWSTR pwszKLID)
{
if (!pwszKLID)
{
SetLastError(ERROR_NOACCESS);
return FALSE;
}
return USER_Driver->pGetKeyboardLayoutName(pwszKLID);
}
......
......@@ -1595,6 +1595,14 @@ static void test_keyboard_layout_name(void)
BOOL ret;
char klid[KL_NAMELENGTH];
if (0) /* crashes on native system */
ret = GetKeyboardLayoutNameA(NULL);
SetLastError(0xdeadbeef);
ret = GetKeyboardLayoutNameW(NULL);
ok(!ret, "got %d\n", ret);
ok(GetLastError() == ERROR_NOACCESS, "got %d\n", GetLastError());
if (GetKeyboardLayout(0) != (HKL)(ULONG_PTR)0x04090409) return;
klid[0] = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment