From d71bb18d33b788fef1f935f625f0312a08e16404 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vincas=20Mili=C5=ABnas?= Date: Sun, 26 Jun 2011 23:12:14 +0300 Subject: [PATCH 12/20] user32: Added DefRawInputProc implementation (try 16) --- dlls/user32/input.c | 14 +++++++++++--- dlls/user32/tests/input.c | 2 +- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/dlls/user32/input.c b/dlls/user32/input.c index 1ffce8d..cbdb0d9 100644 --- a/dlls/user32/input.c +++ b/dlls/user32/input.c @@ -557,11 +557,19 @@ UINT WINAPI GetRegisteredRawInputDevices(PRAWINPUTDEVICE pRawInputDevices, PUINT */ LRESULT WINAPI DefRawInputProc(PRAWINPUT *paRawInput, INT nInput, UINT cbSizeHeader) { - FIXME("(paRawInput=%p, nInput=%d, cbSizeHeader=%d) stub!\n", *paRawInput, nInput, cbSizeHeader); + TRACE("(paRawInput=%p, nInput=%d, cbSizeHeader=%d)\n", *paRawInput, nInput, cbSizeHeader); - return 0; -} + if (cbSizeHeader != sizeof( RAWINPUTHEADER )) + { + /* Windows does not set last error code */ + return (LRESULT)-1; + } + + /* The supplied raw input entries can still be retrieved, + so they will have to be released later */ + return S_OK; +} /********************************************************************** * AttachThreadInput (USER32.@) diff --git a/dlls/user32/tests/input.c b/dlls/user32/tests/input.c index 1720fda..e19712e 100644 --- a/dlls/user32/tests/input.c +++ b/dlls/user32/tests/input.c @@ -1630,7 +1630,7 @@ static void test_def_raw_input_proc(void) } ret = pDefRawInputProc(&input, 0, 0); - todo_wine ok(ret == (LRESULT)-1, "DefRawInputProc returned wrong value: expected (LRESULT)-1, got %lu\n", ret); + 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); -- 1.7.3.4