winebus.sys: Add some buttons to HID mouse input report.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Rémi Bernon 2021-06-04 12:47:05 +02:00 committed by Alexandre Julliard
parent dc7547a84b
commit 318e5feda5
1 changed files with 4 additions and 3 deletions

View File

@ -476,12 +476,13 @@ static NTSTATUS mouse_get_reportdescriptor(DEVICE_OBJECT *device, BYTE *buffer,
{
TRACE("buffer %p, length %u.\n", buffer, length);
*ret_length = sizeof(REPORT_HEADER) + sizeof(REPORT_TAIL);
if (length < sizeof(REPORT_HEADER) + sizeof(REPORT_TAIL))
*ret_length = sizeof(REPORT_HEADER) + sizeof(REPORT_BUTTONS) + sizeof(REPORT_TAIL);
if (length < sizeof(REPORT_HEADER) + sizeof(REPORT_BUTTONS) + sizeof(REPORT_TAIL))
return STATUS_BUFFER_TOO_SMALL;
memcpy(buffer, REPORT_HEADER, sizeof(REPORT_HEADER));
memcpy(buffer + sizeof(REPORT_HEADER), REPORT_TAIL, sizeof(REPORT_TAIL));
add_button_block(buffer + sizeof(REPORT_HEADER), 1, 3);
memcpy(buffer + sizeof(REPORT_HEADER) + sizeof(REPORT_BUTTONS), REPORT_TAIL, sizeof(REPORT_TAIL));
buffer[IDX_HEADER_PAGE] = HID_USAGE_PAGE_GENERIC;
buffer[IDX_HEADER_USAGE] = HID_USAGE_GENERIC_MOUSE;