-- v2: user32: Implement DefRawInputProc.
From: Andrey Gusev andrey.goosev@gmail.com
Used in The Testament of Sherlock Holmes on mouse move. --- dlls/user32/input.c | 4 ++-- dlls/user32/tests/input.c | 20 ++++++++++++++++++++ 2 files changed, 22 insertions(+), 2 deletions(-)
diff --git a/dlls/user32/input.c b/dlls/user32/input.c index a329150f745..bb7477ed482 100644 --- a/dlls/user32/input.c +++ b/dlls/user32/input.c @@ -649,7 +649,7 @@ UINT WINAPI GetRawInputDeviceInfoA( HANDLE device, UINT command, void *data, UIN */ LRESULT WINAPI DefRawInputProc( RAWINPUT **data, INT data_count, UINT header_size ) { - FIXME( "data %p, data_count %d, header_size %u stub!\n", data, data_count, header_size ); + TRACE( "data %p, data_count %d, header_size %u.\n", data, data_count, header_size );
- return 0; + return header_size == sizeof(RAWINPUTHEADER) ? 0 : -1; } diff --git a/dlls/user32/tests/input.c b/dlls/user32/tests/input.c index f508ed69b74..919edeeb239 100644 --- a/dlls/user32/tests/input.c +++ b/dlls/user32/tests/input.c @@ -2900,6 +2900,25 @@ static void test_rawinput(const char* argv0) CloseDesktop(params.desk); }
+static void test_DefRawInputProc(void) +{ + LRESULT ret; + + SetLastError(0xdeadbeef); + ret = DefRawInputProc(NULL, 0, sizeof(RAWINPUTHEADER)); + ok(!ret, "got %Id\n", ret); + ok(GetLastError() == 0xdeadbeef, "got %ld\n", GetLastError()); + ret = DefRawInputProc((void *)(UINT_PTR)0xcafe, 0xbeef, sizeof(RAWINPUTHEADER)); + ok(!ret, "got %Id\n", ret); + ok(GetLastError() == 0xdeadbeef, "got %ld\n", GetLastError()); + ret = DefRawInputProc(NULL, 0, sizeof(RAWINPUTHEADER) - 1); + ok(ret == -1, "got %Id\n", ret); + ok(GetLastError() == 0xdeadbeef, "got %ld\n", GetLastError()); + ret = DefRawInputProc(NULL, 0, sizeof(RAWINPUTHEADER) + 1); + ok(ret == -1, "got %Id\n", ret); + ok(GetLastError() == 0xdeadbeef, "got %ld\n", GetLastError()); +} + static void test_key_map(void) { HKL kl = GetKeyboardLayout(0); @@ -4589,6 +4608,7 @@ START_TEST(input) test_GetRawInputBuffer(); test_RegisterRawInputDevices(); test_rawinput(argv[0]); + test_DefRawInputProc();
if(pGetMouseMovePointsEx) test_GetMouseMovePointsEx(argv[0]);
Hi,
It looks like your patch introduced the new failures shown below. Please investigate and fix them before resubmitting your patch. If they are not new, fixing them anyway would help a lot. Otherwise please ask for the known failures list to be updated.
The tests also ran into some preexisting test failures. If you know how to fix them that would be helpful. See the TestBot job for the details:
The full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=122338
Your paranoid android.
=== w7u_2qxl (32 bit report) ===
user32: input.c:746: Test failed: 0 (a4/0): 00 from 00 -> 80 unexpected input.c:746: Test failed: 0 (a4/0): 41 from 01 -> 00 unexpected
=== w7u_el (32 bit report) ===
user32: input.c:2404: Test failed: Spurious WM_INPUT messages
=== w10pro64 (64 bit report) ===
user32: input.c:4187: Test failed: 2:0: WaitForSingleObject returned 258 input.c:4130: Test failed: 2:0: expected that X highest bit is set, got 0 input.c:4131: Test failed: 2:0: expected that X keystate is set input.c:4131: Test failed: 2:0: expected that X keystate is set input.c:4138: Test failed: 2:0: expected that X keystate is set input.c:4138: Test failed: 2:0: expected that X keystate is set input.c:4130: Test failed: 2:1: expected that X highest bit is set, got 0x1 input.c:4131: Test failed: 2:1: expected that X keystate is set input.c:4131: Test failed: 2:1: expected that X keystate is set input.c:4138: Test failed: 2:1: expected that X keystate is set input.c:4138: Test failed: 2:1: expected that X keystate is set input.c:4130: Test failed: 2:2: expected that X highest bit is set, got 0 input.c:4131: Test failed: 2:2: expected that X keystate is set input.c:4131: Test failed: 2:2: expected that X keystate is set input.c:4138: Test failed: 2:2: expected that X keystate is set input.c:4138: Test failed: 2:2: expected that X keystate is set input.c:4130: Test failed: 2:3: expected that X highest bit is set, got 0x1 input.c:4131: Test failed: 2:3: expected that X keystate is set input.c:4131: Test failed: 2:3: expected that X keystate is set input.c:4138: Test failed: 2:3: expected that X keystate is set input.c:4138: Test failed: 2:3: expected that X keystate is set input.c:4130: Test failed: 3:1: expected that X highest bit is set, got 0x1 input.c:4131: Test failed: 3:1: expected that X keystate is set input.c:4131: Test failed: 3:1: expected that X keystate is set input.c:4138: Test failed: 3:1: expected that X keystate is set input.c:4138: Test failed: 3:1: expected that X keystate is set input.c:4130: Test failed: 3:2: expected that X highest bit is set, got 0 input.c:4131: Test failed: 3:2: expected that X keystate is set input.c:4131: Test failed: 3:2: expected that X keystate is set input.c:4138: Test failed: 3:2: expected that X keystate is set input.c:4138: Test failed: 3:2: expected that X keystate is set input.c:4130: Test failed: 3:3: expected that X highest bit is set, got 0x1 input.c:4131: Test failed: 3:3: expected that X keystate is set input.c:4131: Test failed: 3:3: expected that X keystate is set input.c:4138: Test failed: 3:3: expected that X keystate is set input.c:4138: Test failed: 3:3: expected that X keystate is set input.c:4130: Test failed: 4:0: expected that X highest bit is set, got 0 input.c:4131: Test failed: 4:0: expected that X keystate is set input.c:4131: Test failed: 4:0: expected that X keystate is set input.c:4138: Test failed: 4:0: expected that X keystate is set input.c:4138: Test failed: 4:0: expected that X keystate is set input.c:4130: Test failed: 4:1: expected that X highest bit is set, got 0x1 input.c:4131: Test failed: 4:1: expected that X keystate is set input.c:4131: Test failed: 4:1: expected that X keystate is set input.c:4138: Test failed: 4:1: expected that X keystate is set input.c:4138: Test failed: 4:1: expected that X keystate is set
I've pushed a version with tests (which show that last error is not affected).
This merge request was approved by Huw Davies.