-- v3: 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..8477645fad5 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(LongToPtr(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=122339
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:2270: Test failed: GetRawInputData succeeded input.c:2271: Test failed: GetRawInputData returned deadbeef input.c:2404: Test failed: Spurious WM_INPUT messages
On Wed Aug 31 20:00:28 2022 +0000, Huw Davies wrote:
I've pushed a version with tests (which show that last error is not affected).
Great, thanks.
This merge request was approved by R��mi Bernon.