Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/winebus.sys/main.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/dlls/winebus.sys/main.c b/dlls/winebus.sys/main.c index 99f834d2f40..a572d11f822 100644 --- a/dlls/winebus.sys/main.c +++ b/dlls/winebus.sys/main.c @@ -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;
Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/winebus.sys/controller.h | 3 ++- dlls/winebus.sys/main.c | 8 +++++--- 2 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/dlls/winebus.sys/controller.h b/dlls/winebus.sys/controller.h index a941b543c08..2f4a72a94cd 100644 --- a/dlls/winebus.sys/controller.h +++ b/dlls/winebus.sys/controller.h @@ -33,7 +33,7 @@ static const BYTE REPORT_HEADER[] = { #define IDX_HEADER_USAGE 3
static const BYTE REPORT_BUTTONS[] = { - USAGE_PAGE(1, HID_USAGE_PAGE_BUTTON), + USAGE_PAGE(1, /* placeholder */ HID_USAGE_PAGE_BUTTON), USAGE_MINIMUM(1, /* placeholder */ 1), USAGE_MAXIMUM(1, /* placeholder */ 3), LOGICAL_MINIMUM(1, 0), @@ -44,6 +44,7 @@ static const BYTE REPORT_BUTTONS[] = { REPORT_SIZE(1, 1), INPUT(1, Data|Var|Abs), }; +#define IDX_BUTTON_USAGE_PAGE 1 #define IDX_BUTTON_MIN_USAGE 3 #define IDX_BUTTON_MAX_USAGE 5 #define IDX_BUTTON_COUNT 15 diff --git a/dlls/winebus.sys/main.c b/dlls/winebus.sys/main.c index a572d11f822..a512015d478 100644 --- a/dlls/winebus.sys/main.c +++ b/dlls/winebus.sys/main.c @@ -546,12 +546,14 @@ static NTSTATUS keyboard_get_reportdescriptor(DEVICE_OBJECT *device, BYTE *buffe { 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), 0, 101); + buffer[sizeof(REPORT_HEADER) + IDX_BUTTON_USAGE_PAGE] = HID_USAGE_PAGE_KEYBOARD; + 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_KEYBOARD;