user32: Check input to GetAsyncKeyState().

This commit is contained in:
Lei Zhang 2008-12-08 11:25:30 -08:00 committed by Alexandre Julliard
parent c3cdc671a4
commit 54eebfe5e5
2 changed files with 10 additions and 0 deletions

View File

@ -272,6 +272,8 @@ HWND WINAPI GetCapture(void)
*/
SHORT WINAPI GetAsyncKeyState(INT nKey)
{
if (nKey < 0 || nKey > 256)
return 0;
return USER_Driver->pGetAsyncKeyState( nKey );
}

View File

@ -1240,6 +1240,13 @@ static void test_ToUnicode(void)
todo_wine ok(ret == 0, "ToUnicode for CTRL + SHIFT + Return didn't return 0 (was %i)\n", ret);
}
static void test_get_async_key_state(void)
{
/* input value sanity checks */
ok(0 == GetAsyncKeyState(1000000), "GetAsyncKeyState did not return 0\n");
ok(0 == GetAsyncKeyState(-1000000), "GetAsyncKeyState did not return 0\n");
}
START_TEST(input)
{
init_function_pointers();
@ -1254,6 +1261,7 @@ START_TEST(input)
test_mouse_ll_hook();
test_key_map();
test_ToUnicode();
test_get_async_key_state();
if(pGetMouseMovePointsEx)
test_GetMouseMovePointsEx();