Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/user32/rawinput.c | 3 ++- dlls/user32/tests/input.c | 3 --- 2 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/dlls/user32/rawinput.c b/dlls/user32/rawinput.c index fa0c5070b03..45f990b9726 100644 --- a/dlls/user32/rawinput.c +++ b/dlls/user32/rawinput.c @@ -452,7 +452,7 @@ UINT WINAPI GetRawInputData(HRAWINPUT rawinput, UINT command, void *data, UINT * TRACE("rawinput %p, command %#x, data %p, data_size %p, header_size %u.\n", rawinput, command, data, data_size, header_size);
- if (!ri) + if (!ri || !ri->header.dwSize) return ~0U;
if (header_size != sizeof(RAWINPUTHEADER)) @@ -481,6 +481,7 @@ UINT WINAPI GetRawInputData(HRAWINPUT rawinput, UINT command, void *data, UINT *
if (*data_size < s) return ~0U; memcpy(data, ri, s); + ri->header.dwSize = 0; return s; }
diff --git a/dlls/user32/tests/input.c b/dlls/user32/tests/input.c index 9c35b1e36bd..2db0e5ee515 100644 --- a/dlls/user32/tests/input.c +++ b/dlls/user32/tests/input.c @@ -1912,10 +1912,7 @@ static LRESULT CALLBACK rawinputbuffer_wndproc(HWND hwnd, UINT msg, WPARAM wpara ok(ri.data.mouse.lLastX == 6, "Unexpected rawinput data: %d\n", ri.data.mouse.lLastX); } else - { - todo_wine ok(count == ~0U, "GetRawInputData succeeded\n"); - } }
return DefWindowProcA(hwnd, msg, wparam, lparam);