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 *
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))
......@@ -488,6 +488,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;
}
......
......@@ -1913,10 +1913,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);
......
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