From 75a04bcc91f1ca9e8b45804e7a86c72ba4566c9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vincas=20Mili=C5=ABnas?= Date: Sun, 10 Jul 2011 13:10:14 +0300 Subject: [PATCH 01/20] user32/tests: Added DefRawInputProc tests (try 16) --- dlls/user32/tests/input.c | 32 ++++++++++++++++++++++++++++++++ 1 files changed, 32 insertions(+), 0 deletions(-) diff --git a/dlls/user32/tests/input.c b/dlls/user32/tests/input.c index d45edf1..b70ce57 100644 --- a/dlls/user32/tests/input.c +++ b/dlls/user32/tests/input.c @@ -77,6 +77,7 @@ static struct { static UINT (WINAPI *pSendInput) (UINT, INPUT*, size_t); static int (WINAPI *pGetMouseMovePointsEx) (UINT, LPMOUSEMOVEPOINT, LPMOUSEMOVEPOINT, int, DWORD); +static UINT (WINAPI *pDefRawInputProc) (PRAWINPUT*, INT, UINT); #define MAXKEYEVENTS 12 #define MAXKEYMESSAGES MAXKEYEVENTS /* assuming a key event generates one @@ -159,6 +160,7 @@ static void init_function_pointers(void) trace("GetProcAddress(%s) failed\n", #func); GET_PROC(SendInput) + GET_PROC(DefRawInputProc) GET_PROC(GetMouseMovePointsEx) #undef GET_PROC @@ -1598,6 +1600,34 @@ static void test_keyboard_layout_name(void) ok(!strcmp(klid, "00000409"), "expected 00000409, got %s\n", klid); } +static void test_def_raw_input_proc(void) +{ + RAWINPUT *input = NULL, raw; + LRESULT ret; + + if (!pDefRawInputProc) + { + win_skip("DefRawInputProc is not available\n"); + return; + } + + ret = pDefRawInputProc(&input, 0, 0); + todo_wine ok(ret == (LRESULT)-1, "DefRawInputProc returned wrong value: expected (LRESULT)-1, got %lu\n", ret); + + ret = pDefRawInputProc(&input, 0, sizeof(RAWINPUTHEADER)); + ok(ret == S_OK, "DefRawInputProc returned wrong value: expected S_OK, got %lu\n", ret); + + /* Test that DefRawInputProc is ignorant of the other parameters */ + memset(&raw, 0xFF, sizeof(raw)); + input = &raw; + + ret = pDefRawInputProc(&input, 1000000, sizeof(RAWINPUTHEADER)); + ok(ret == S_OK, "DefRawInputProc returned wrong value: expected S_OK, got %lu\n", ret); + + ret = pDefRawInputProc(&input, -1000000, sizeof(RAWINPUTHEADER)); + ok(ret == S_OK, "DefRawInputProc returned wrong value: expected S_OK, got %lu\n", ret); +} + START_TEST(input) { init_function_pointers(); @@ -1617,6 +1647,8 @@ START_TEST(input) test_get_async_key_state(); test_keyboard_layout_name(); + test_def_raw_input_proc(); + if(pGetMouseMovePointsEx) test_GetMouseMovePointsEx(); else -- 1.7.3.4