Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50506 Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/user32/message.c | 1 + dlls/user32/rawinput.c | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/dlls/user32/message.c b/dlls/user32/message.c index 9af33c3291e..be178072e6f 100644 --- a/dlls/user32/message.c +++ b/dlls/user32/message.c @@ -2292,6 +2292,7 @@ static BOOL process_rawinput_message( MSG *msg, UINT hw_id, const struct hardwar
if (msg->message == WM_INPUT) { + thread_data->buffer->header.dwSize = RAWINPUT_BUFFER_SIZE; if (!rawinput_from_hardware_message( thread_data->buffer, msg_data )) return FALSE; thread_data->hw_id = hw_id; msg->lParam = (LPARAM)hw_id; diff --git a/dlls/user32/rawinput.c b/dlls/user32/rawinput.c index 115513ea144..efc736625d5 100644 --- a/dlls/user32/rawinput.c +++ b/dlls/user32/rawinput.c @@ -564,7 +564,7 @@ UINT WINAPI DECLSPEC_HOTPATCH GetRawInputBuffer(RAWINPUT *data, UINT *data_size, struct hardware_msg_data *msg_data; struct rawinput_thread_data *thread_data; RAWINPUT *rawinput; - UINT count = 0, rawinput_size, next_size, overhead; + UINT count = 0, remaining, rawinput_size, next_size, overhead; BOOL is_wow64; int i;
@@ -617,12 +617,15 @@ UINT WINAPI DECLSPEC_HOTPATCH GetRawInputBuffer(RAWINPUT *data, UINT *data_size, } SERVER_END_REQ;
+ remaining = *data_size; for (i = 0; i < count; ++i) { - rawinput_from_hardware_message(data, msg_data); + data->header.dwSize = remaining; + if (!rawinput_from_hardware_message(data, msg_data)) break; if (overhead) memmove((char *)&data->data + overhead, &data->data, data->header.dwSize - sizeof(RAWINPUTHEADER)); data->header.dwSize += overhead; + remaining -= data->header.dwSize; data = NEXTRAWINPUTBLOCK(data); msg_data = (struct hardware_msg_data *)((char *)msg_data + msg_data->size); }