Commit 359ee2ec authored by Rémi Bernon's avatar Rémi Bernon Committed by Alexandre Julliard

user32: Return failure when rawinput has been overwritten.

parent 3a9edf9a
...@@ -459,7 +459,7 @@ UINT WINAPI GetRawInputData(HRAWINPUT rawinput, UINT command, void *data, UINT * ...@@ -459,7 +459,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", TRACE("rawinput %p, command %#x, data %p, data_size %p, header_size %u.\n",
rawinput, command, data, data_size, header_size); rawinput, command, data, data_size, header_size);
if (!ri) if (!ri || !ri->header.dwSize)
return ~0U; return ~0U;
if (header_size != sizeof(RAWINPUTHEADER)) if (header_size != sizeof(RAWINPUTHEADER))
...@@ -488,6 +488,7 @@ UINT WINAPI GetRawInputData(HRAWINPUT rawinput, UINT command, void *data, UINT * ...@@ -488,6 +488,7 @@ UINT WINAPI GetRawInputData(HRAWINPUT rawinput, UINT command, void *data, UINT *
if (*data_size < s) return ~0U; if (*data_size < s) return ~0U;
memcpy(data, ri, s); memcpy(data, ri, s);
ri->header.dwSize = 0;
return s; return s;
} }
......
...@@ -1913,11 +1913,8 @@ static LRESULT CALLBACK rawinputbuffer_wndproc(HWND hwnd, UINT msg, WPARAM wpara ...@@ -1913,11 +1913,8 @@ 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); ok(ri.data.mouse.lLastX == 6, "Unexpected rawinput data: %d\n", ri.data.mouse.lLastX);
} }
else else
{
todo_wine
ok(count == ~0U, "GetRawInputData succeeded\n"); ok(count == ~0U, "GetRawInputData succeeded\n");
} }
}
return DefWindowProcA(hwnd, msg, wparam, lparam); return DefWindowProcA(hwnd, msg, wparam, lparam);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment