[PATCH 0/1] MR730: user32: Implement DefRawInputProc.
From: Andrey Gusev <andrey.goosev(a)gmail.com> Used in The Testament of Sherlock Holmes on mouse move. --- dlls/user32/input.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/dlls/user32/input.c b/dlls/user32/input.c index a329150f745..3512a967552 100644 --- a/dlls/user32/input.c +++ b/dlls/user32/input.c @@ -649,7 +649,14 @@ 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 ); + + if (header_size != sizeof(RAWINPUTHEADER)) + { + WARN( "Invalid structure size %u.\n", header_size ); + RtlSetLastWin32Error( ERROR_INVALID_PARAMETER ); + return ~0u; + } return 0; } -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/730
Some tests would be nice. This function is documented to do very little, so while surprising, this may be close to the correct implementation. However, `SetLastError()` should be used instead of `RtlSetLastWin32Error()` if indeed the tests show that the last error is set. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/730#note_7298
I don't write tests. The game gives expected 16 bytes for header_size. Regarding `SetLastError()` it was changed not long ago with [1dfedae](1dfedae9030b18d6648d48fe613a1ade2af382e5) -- https://gitlab.winehq.org/wine/wine/-/merge_requests/730#note_7316
I don't write tests.
Then it's going to hard to convince the reviewer that this is correct.
Regarding `SetLastError()` it was changed not long ago with [1dfedae](/wine/wine/-/commit/1dfedae9030b18d6648d48fe613a1ade2af382e5)
That's on the unixlib side of win32u. This code is in user32, which is PE. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/730#note_7319
I'm not going to convince. I'm only proposed my solution. If someone really thinks it worth to check this 'very complicated' function with tests, I don't mind. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/730#note_7323
participants (3)
-
Andrey Gusev -
Andrey Gusev (@agusev) -
Huw Davies (@huw)