user32: Return failure when rawinput has been overwritten.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
3a9edf9aad
commit
359ee2ecc2
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue