Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50506 Signed-off-by: Rémi Bernon rbernon@codeweavers.com ---
v5: Add padding field to align hardware_msg_data on 8 bytes.
dlls/user32/rawinput.c | 2 +- server/protocol.def | 2 ++ server/queue.c | 15 ++++++++++----- 3 files changed, 13 insertions(+), 6 deletions(-)
diff --git a/dlls/user32/rawinput.c b/dlls/user32/rawinput.c index e4e7bad508f..115513ea144 100644 --- a/dlls/user32/rawinput.c +++ b/dlls/user32/rawinput.c @@ -624,7 +624,7 @@ UINT WINAPI DECLSPEC_HOTPATCH GetRawInputBuffer(RAWINPUT *data, UINT *data_size, data->header.dwSize - sizeof(RAWINPUTHEADER)); data->header.dwSize += overhead; data = NEXTRAWINPUTBLOCK(data); - msg_data++; + msg_data = (struct hardware_msg_data *)((char *)msg_data + msg_data->size); }
if (count == 0 && next_size == 0) *data_size = 0; diff --git a/server/protocol.def b/server/protocol.def index 4239be834d1..0c98ac31328 100644 --- a/server/protocol.def +++ b/server/protocol.def @@ -308,6 +308,8 @@ union rawinput struct hardware_msg_data { lparam_t info; /* extra info */ + data_size_t size; /* size of hardware message data */ + int __pad; unsigned int hw_id; /* unique id */ unsigned int flags; /* hook flags */ struct hw_msg_source source; /* message source */ diff --git a/server/queue.c b/server/queue.c index 5d65e030112..07d4c7e0885 100644 --- a/server/queue.c +++ b/server/queue.c @@ -367,6 +367,7 @@ static struct message *alloc_hardware_message( lparam_t info, struct hw_msg_sour
memset( msg_data, 0, sizeof(*msg_data) ); msg_data->info = info; + msg_data->size = msg->data_size; msg_data->source = source; return msg; } @@ -1794,6 +1795,7 @@ static int queue_mouse_message( struct desktop *desktop, user_handle_t win, cons
msg_data = &raw_msg.data; msg_data->info = input->mouse.info; + msg_data->size = sizeof(*msg_data); msg_data->flags = flags; msg_data->rawinput.type = RIM_TYPEMOUSE; msg_data->rawinput.mouse.x = x - desktop->cursor.x; @@ -1929,6 +1931,7 @@ static int queue_keyboard_message( struct desktop *desktop, user_handle_t win, c
msg_data = &raw_msg.data; msg_data->info = input->kbd.info; + msg_data->size = sizeof(*msg_data); msg_data->flags = input->kbd.flags; msg_data->rawinput.type = RIM_TYPEKEYBOARD; msg_data->rawinput.kbd.message = message_code; @@ -1996,6 +1999,7 @@ static void queue_custom_hardware_message( struct desktop *desktop, user_handle_
msg_data = &raw_msg.data; msg_data->info = 0; + msg_data->size = sizeof(*msg_data); msg_data->flags = 0; msg_data->rawinput = input->hw.rawinput;
@@ -3295,16 +3299,17 @@ DECL_HANDLER(get_rawinput_buffer) { struct message *msg = LIST_ENTRY( ptr, struct message, entry ); struct hardware_msg_data *data = msg->data; + data_size_t extra_size = data->size - sizeof(*data);
ptr = list_next( &input->msg_list, ptr ); if (msg->msg != WM_INPUT) continue;
- next_size = req->rawinput_size; + next_size = req->rawinput_size + extra_size; if (size + next_size > req->buffer_size) break; - if (cur + sizeof(*data) > buf + get_reply_max_size()) break; - if (cur + sizeof(*data) > buf + buf_size) + if (cur + data->size > buf + get_reply_max_size()) break; + if (cur + data->size > buf + buf_size) { - buf_size += buf_size / 2; + buf_size += buf_size / 2 + extra_size; if (!(tmp = realloc( buf, buf_size ))) { set_error( STATUS_NO_MEMORY ); @@ -3314,7 +3319,7 @@ DECL_HANDLER(get_rawinput_buffer) buf = tmp; }
- memcpy(cur, data, sizeof(*data)); + memcpy( cur, data, data->size ); list_remove( &msg->entry ); free_message( msg );
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50506 Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/user32/message.c | 1 + dlls/user32/rawinput.c | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/dlls/user32/message.c b/dlls/user32/message.c index 9af33c3291e..be178072e6f 100644 --- a/dlls/user32/message.c +++ b/dlls/user32/message.c @@ -2292,6 +2292,7 @@ static BOOL process_rawinput_message( MSG *msg, UINT hw_id, const struct hardwar
if (msg->message == WM_INPUT) { + thread_data->buffer->header.dwSize = RAWINPUT_BUFFER_SIZE; if (!rawinput_from_hardware_message( thread_data->buffer, msg_data )) return FALSE; thread_data->hw_id = hw_id; msg->lParam = (LPARAM)hw_id; diff --git a/dlls/user32/rawinput.c b/dlls/user32/rawinput.c index 115513ea144..efc736625d5 100644 --- a/dlls/user32/rawinput.c +++ b/dlls/user32/rawinput.c @@ -564,7 +564,7 @@ UINT WINAPI DECLSPEC_HOTPATCH GetRawInputBuffer(RAWINPUT *data, UINT *data_size, struct hardware_msg_data *msg_data; struct rawinput_thread_data *thread_data; RAWINPUT *rawinput; - UINT count = 0, rawinput_size, next_size, overhead; + UINT count = 0, remaining, rawinput_size, next_size, overhead; BOOL is_wow64; int i;
@@ -617,12 +617,15 @@ UINT WINAPI DECLSPEC_HOTPATCH GetRawInputBuffer(RAWINPUT *data, UINT *data_size, } SERVER_END_REQ;
+ remaining = *data_size; for (i = 0; i < count; ++i) { - rawinput_from_hardware_message(data, msg_data); + data->header.dwSize = remaining; + if (!rawinput_from_hardware_message(data, msg_data)) break; if (overhead) memmove((char *)&data->data + overhead, &data->data, data->header.dwSize - sizeof(RAWINPUTHEADER)); data->header.dwSize += overhead; + remaining -= data->header.dwSize; data = NEXTRAWINPUTBLOCK(data); msg_data = (struct hardware_msg_data *)((char *)msg_data + msg_data->size); }
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=91424
Your paranoid android.
=== debiant2 (64 bit WoW report) ===
user32: win.c:10381: Test failed: Expected foreground window 0000000000150128, got 0000000000B500EA win.c:10383: Test failed: GetActiveWindow() = 0000000000000000 win.c:10383: Test failed: GetFocus() = 0000000000000000 win.c:10384: Test failed: Received WM_ACTIVATEAPP(1), did not expect it. win.c:10385: Test failed: Received WM_ACTIVATEAPP(0), did not expect it. win.c:10393: Test failed: Expected foreground window 0000000000150128, got 0000000000000000 win.c:10395: Test failed: GetActiveWindow() = 0000000000000000 win.c:10395: Test failed: GetFocus() = 0000000000000000 win.c:10403: Test failed: Received WM_ACTIVATEAPP(1), did not expect it.
Without any HID report data for now.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50506 Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/user32/message.c | 9 +++++++++ dlls/user32/rawinput.c | 30 ++++++++++++++++++++++++++++++ dlls/user32/user_private.h | 2 ++ server/queue.c | 1 + server/trace.c | 1 + 5 files changed, 43 insertions(+)
diff --git a/dlls/user32/message.c b/dlls/user32/message.c index be178072e6f..886c10e36bd 100644 --- a/dlls/user32/message.c +++ b/dlls/user32/message.c @@ -3255,6 +3255,14 @@ NTSTATUS send_hardware_message( HWND hwnd, const INPUT *input, const RAWINPUT *r hid_usage_page = ((USAGE *)rawinput->data.hid.bRawData)[0]; hid_usage = ((USAGE *)rawinput->data.hid.bRawData)[1]; } + if (input->u.hi.uMsg == WM_INPUT) + { + if (!rawinput_device_get_usages( rawinput->header.hDevice, &hid_usage_page, &hid_usage )) + { + WARN( "unable to get HID usages for device %p\n", rawinput->header.hDevice ); + return STATUS_INVALID_HANDLE; + } + } }
SERVER_START_REQ( send_hardware_message ) @@ -3284,6 +3292,7 @@ NTSTATUS send_hardware_message( HWND hwnd, const INPUT *input, const RAWINPUT *r req->input.hw.lparam = MAKELONG( input->u.hi.wParamL, input->u.hi.wParamH ); switch (input->u.hi.uMsg) { + case WM_INPUT: case WM_INPUT_DEVICE_CHANGE: req->input.hw.rawinput.type = rawinput->header.dwType; switch (rawinput->header.dwType) diff --git a/dlls/user32/rawinput.c b/dlls/user32/rawinput.c index efc736625d5..87f7175a6c1 100644 --- a/dlls/user32/rawinput.c +++ b/dlls/user32/rawinput.c @@ -267,6 +267,21 @@ static struct device *find_device_from_handle(HANDLE handle) }
+BOOL rawinput_device_get_usages(HANDLE handle, USAGE *usage_page, USAGE *usage) +{ + struct device *device; + + *usage_page = *usage = 0; + + if (!(device = find_device_from_handle(handle))) return FALSE; + if (device->info.dwType != RIM_TYPEHID) return FALSE; + + *usage_page = device->info.u.hid.usUsagePage; + *usage = device->info.u.hid.usUsage; + return TRUE; +} + + struct rawinput_thread_data *rawinput_thread_data(void) { struct user_thread_info *thread_info = get_user_thread_info(); @@ -280,6 +295,8 @@ struct rawinput_thread_data *rawinput_thread_data(void)
BOOL rawinput_from_hardware_message(RAWINPUT *rawinput, const struct hardware_msg_data *msg_data) { + SIZE_T size; + rawinput->header.dwType = msg_data->rawinput.type; if (msg_data->rawinput.type == RIM_TYPEMOUSE) { @@ -371,6 +388,19 @@ BOOL rawinput_from_hardware_message(RAWINPUT *rawinput, const struct hardware_ms rawinput->data.keyboard.Message = msg_data->rawinput.kbd.message; rawinput->data.keyboard.ExtraInformation = msg_data->info; } + else if (msg_data->rawinput.type == RIM_TYPEHID) + { + size = msg_data->size - sizeof(*msg_data); + if (size > rawinput->header.dwSize - sizeof(*rawinput)) return FALSE; + + rawinput->header.dwSize = FIELD_OFFSET( RAWINPUT, data.hid.bRawData ) + size; + rawinput->header.hDevice = ULongToHandle( msg_data->rawinput.hid.device ); + rawinput->header.wParam = 0; + + rawinput->data.hid.dwCount = 0; + rawinput->data.hid.dwSizeHid = 0; + memcpy( rawinput->data.hid.bRawData, msg_data + 1, size ); + } else { FIXME("Unhandled rawinput type %#x.\n", msg_data->rawinput.type); diff --git a/dlls/user32/user_private.h b/dlls/user32/user_private.h index cb780f0c963..0838ba28b32 100644 --- a/dlls/user32/user_private.h +++ b/dlls/user32/user_private.h @@ -28,6 +28,7 @@ #include "winuser.h" #include "winreg.h" #include "winternl.h" +#include "hidusage.h" #include "wine/heap.h"
#define GET_WORD(ptr) (*(const WORD *)(ptr)) @@ -239,6 +240,7 @@ struct tagWND;
struct hardware_msg_data; extern BOOL rawinput_from_hardware_message(RAWINPUT *rawinput, const struct hardware_msg_data *msg_data); +extern BOOL rawinput_device_get_usages(HANDLE handle, USAGE *usage_page, USAGE *usage); extern struct rawinput_thread_data *rawinput_thread_data(void);
extern void keyboard_init(void) DECLSPEC_HIDDEN; diff --git a/server/queue.c b/server/queue.c index 07d4c7e0885..6c59b02a9b6 100644 --- a/server/queue.c +++ b/server/queue.c @@ -1990,6 +1990,7 @@ static void queue_custom_hardware_message( struct desktop *desktop, user_handle_
switch (input->hw.msg) { + case WM_INPUT: case WM_INPUT_DEVICE_CHANGE: raw_msg.foreground = NULL; raw_msg.desktop = NULL; diff --git a/server/trace.c b/server/trace.c index 6b5946c2bcf..5e1c7675b0a 100644 --- a/server/trace.c +++ b/server/trace.c @@ -440,6 +440,7 @@ static void dump_hw_input( const char *prefix, const hw_input_t *input ) dump_uint64( ",lparam=", &input->hw.lparam ); switch (input->hw.msg) { + case WM_INPUT: case WM_INPUT_DEVICE_CHANGE: dump_rawinput( ",rawinput=", &input->hw.rawinput ); }
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=91425
Your paranoid android.
=== debiant2 (64 bit WoW report) ===
user32: win.c:10374: Test failed: Expected foreground window 0000000000150128, got 0000000000000000 win.c:10381: Test failed: Expected foreground window 0000000000150128, got 0000000000B500EA win.c:10383: Test failed: GetActiveWindow() = 0000000000000000 win.c:10383: Test failed: GetFocus() = 0000000000000000 win.c:10384: Test failed: Received WM_ACTIVATEAPP(1), did not expect it. win.c:10385: Test failed: Received WM_ACTIVATEAPP(0), did not expect it. win.c:10393: Test failed: Expected foreground window 0000000000150128, got 0000000000000000 win.c:10395: Test failed: GetActiveWindow() = 0000000000000000 win.c:10395: Test failed: GetFocus() = 0000000000000000 win.c:10403: Test failed: Received WM_ACTIVATEAPP(1), did not expect it.
The RIM_TYPEHID messages will have to carry the variable length HID report.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50506 Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- server/queue.c | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-)
diff --git a/server/queue.c b/server/queue.c index 6c59b02a9b6..76ee469ffef 100644 --- a/server/queue.c +++ b/server/queue.c @@ -348,13 +348,13 @@ static int assign_thread_input( struct thread *thread, struct thread_input *new_
/* allocate a hardware message and its data */ static struct message *alloc_hardware_message( lparam_t info, struct hw_msg_source source, - unsigned int time ) + unsigned int time, data_size_t extra_size ) { struct hardware_msg_data *msg_data; struct message *msg;
if (!(msg = mem_alloc( sizeof(*msg) ))) return NULL; - if (!(msg_data = mem_alloc( sizeof(*msg_data) ))) + if (!(msg_data = mem_alloc( sizeof(*msg_data) + extra_size ))) { free( msg ); return NULL; @@ -363,9 +363,9 @@ static struct message *alloc_hardware_message( lparam_t info, struct hw_msg_sour msg->type = MSG_HARDWARE; msg->time = time; msg->data = msg_data; - msg->data_size = sizeof(*msg_data); + msg->data_size = sizeof(*msg_data) + extra_size;
- memset( msg_data, 0, sizeof(*msg_data) ); + memset( msg_data, 0, sizeof(*msg_data) + extra_size ); msg_data->info = info; msg_data->size = msg->data_size; msg_data->source = source; @@ -399,7 +399,7 @@ static void set_cursor_pos( struct desktop *desktop, int x, int y ) return; }
- if (!(msg = alloc_hardware_message( 0, source, get_tick_count() ))) return; + if (!(msg = alloc_hardware_message( 0, source, get_tick_count(), 0 ))) return;
msg->msg = WM_MOUSEMOVE; msg->x = x; @@ -1665,6 +1665,7 @@ struct rawinput_message unsigned int time; unsigned int message; struct hardware_msg_data data; + const void *hid_report; };
/* check if process is supposed to receive a WM_INPUT message and eventually queue it */ @@ -1676,6 +1677,7 @@ static int queue_rawinput_message( struct process* process, void *arg ) struct desktop *target_desktop = NULL, *desktop = NULL; struct thread *target_thread = NULL, *foreground = NULL; struct message *msg; + data_size_t report_size; int wparam = RIM_INPUT;
if (raw_msg->data.rawinput.type == RIM_TYPEMOUSE) @@ -1703,7 +1705,10 @@ static int queue_rawinput_message( struct process* process, void *arg ) wparam = RIM_INPUTSINK; }
- if (!(msg = alloc_hardware_message( raw_msg->data.info, raw_msg->source, raw_msg->time ))) + if (raw_msg->data.rawinput.type != RIM_TYPEHID || !raw_msg->hid_report) report_size = 0; + else report_size = raw_msg->data.size - sizeof(raw_msg->data); + + if (!(msg = alloc_hardware_message( raw_msg->data.info, raw_msg->source, raw_msg->time, report_size ))) goto done;
msg->win = device->target; @@ -1711,6 +1716,7 @@ static int queue_rawinput_message( struct process* process, void *arg ) msg->wparam = wparam; msg->lparam = 0; memcpy( msg->data, &raw_msg->data, sizeof(raw_msg->data) ); + if (report_size) memcpy( (struct hardware_msg_data *)msg->data + 1, raw_msg->hid_report, report_size );
if (raw_msg->message == WM_INPUT_DEVICE_CHANGE && raw_msg->data.rawinput.type == RIM_TYPEHID) { @@ -1792,6 +1798,7 @@ static int queue_mouse_message( struct desktop *desktop, user_handle_t win, cons raw_msg.source = source; raw_msg.time = time; raw_msg.message = WM_INPUT; + raw_msg.hid_report = NULL;
msg_data = &raw_msg.data; msg_data->info = input->mouse.info; @@ -1818,7 +1825,7 @@ static int queue_mouse_message( struct desktop *desktop, user_handle_t win, cons if (!(flags & (1 << i))) continue; flags &= ~(1 << i);
- if (!(msg = alloc_hardware_message( input->mouse.info, source, time ))) return 0; + if (!(msg = alloc_hardware_message( input->mouse.info, source, time, 0 ))) return 0; msg_data = msg->data;
msg->win = get_user_full_handle( win ); @@ -1928,6 +1935,7 @@ static int queue_keyboard_message( struct desktop *desktop, user_handle_t win, c raw_msg.source = source; raw_msg.time = time; raw_msg.message = WM_INPUT; + raw_msg.hid_report = NULL;
msg_data = &raw_msg.data; msg_data->info = input->kbd.info; @@ -1948,7 +1956,7 @@ static int queue_keyboard_message( struct desktop *desktop, user_handle_t win, c return 0; }
- if (!(msg = alloc_hardware_message( input->kbd.info, source, time ))) return 0; + if (!(msg = alloc_hardware_message( input->kbd.info, source, time, 0 ))) return 0; msg_data = msg->data;
msg->win = get_user_full_handle( win ); @@ -1997,6 +2005,7 @@ static void queue_custom_hardware_message( struct desktop *desktop, user_handle_ raw_msg.source = source; raw_msg.time = get_tick_count(); raw_msg.message = input->hw.msg; + raw_msg.hid_report = NULL;
msg_data = &raw_msg.data; msg_data->info = 0; @@ -2010,7 +2019,7 @@ static void queue_custom_hardware_message( struct desktop *desktop, user_handle_ return; }
- if (!(msg = alloc_hardware_message( 0, source, get_tick_count() ))) return; + if (!(msg = alloc_hardware_message( 0, source, get_tick_count(), 0 ))) return;
msg->win = get_user_full_handle( win ); msg->msg = input->hw.msg;
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50506 Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/user32/message.c | 5 ++++- dlls/user32/rawinput.c | 4 ++-- server/protocol.def | 3 +++ server/queue.c | 15 ++++++++++++++- server/trace.c | 4 ++-- tools/make_requests | 2 +- 6 files changed, 26 insertions(+), 7 deletions(-)
diff --git a/dlls/user32/message.c b/dlls/user32/message.c index 886c10e36bd..6f0f58a5f3f 100644 --- a/dlls/user32/message.c +++ b/dlls/user32/message.c @@ -3298,11 +3298,14 @@ NTSTATUS send_hardware_message( HWND hwnd, const INPUT *input, const RAWINPUT *r switch (rawinput->header.dwType) { case RIM_TYPEHID: - assert( rawinput->data.hid.dwCount <= 1 ); req->input.hw.rawinput.hid.device = HandleToUlong( rawinput->header.hDevice ); req->input.hw.rawinput.hid.param = rawinput->header.wParam; req->input.hw.rawinput.hid.usage_page = hid_usage_page; req->input.hw.rawinput.hid.usage = hid_usage; + req->input.hw.rawinput.hid.count = rawinput->data.hid.dwCount; + req->input.hw.rawinput.hid.length = rawinput->data.hid.dwSizeHid; + wine_server_add_data( req, rawinput->data.hid.bRawData, + rawinput->data.hid.dwCount * rawinput->data.hid.dwSizeHid ); break; default: assert( 0 ); diff --git a/dlls/user32/rawinput.c b/dlls/user32/rawinput.c index 87f7175a6c1..41d627c62c2 100644 --- a/dlls/user32/rawinput.c +++ b/dlls/user32/rawinput.c @@ -397,8 +397,8 @@ BOOL rawinput_from_hardware_message(RAWINPUT *rawinput, const struct hardware_ms rawinput->header.hDevice = ULongToHandle( msg_data->rawinput.hid.device ); rawinput->header.wParam = 0;
- rawinput->data.hid.dwCount = 0; - rawinput->data.hid.dwSizeHid = 0; + rawinput->data.hid.dwCount = msg_data->rawinput.hid.count; + rawinput->data.hid.dwSizeHid = msg_data->rawinput.hid.length; memcpy( rawinput->data.hid.bRawData, msg_data + 1, size ); } else diff --git a/server/protocol.def b/server/protocol.def index 0c98ac31328..65840bf5a86 100644 --- a/server/protocol.def +++ b/server/protocol.def @@ -302,6 +302,8 @@ union rawinput unsigned int param; /* rawinput message param */ unsigned short usage_page;/* HID usage page */ unsigned short usage; /* HID usage */ + unsigned int count; /* HID report count */ + unsigned int length; /* HID report length */ } hid; };
@@ -2034,6 +2036,7 @@ enum message_type user_handle_t win; /* window handle */ hw_input_t input; /* input data */ unsigned int flags; /* flags (see below) */ + VARARG(report,bytes); /* HID report data */ @REPLY int wait; /* do we need to wait for a reply? */ int prev_x; /* previous cursor position */ diff --git a/server/queue.c b/server/queue.c index 76ee469ffef..e4903bcb79f 100644 --- a/server/queue.c +++ b/server/queue.c @@ -1995,6 +1995,7 @@ static void queue_custom_hardware_message( struct desktop *desktop, user_handle_ struct hardware_msg_data *msg_data; struct rawinput_message raw_msg; struct message *msg; + data_size_t report_size = 0;
switch (input->hw.msg) { @@ -2007,9 +2008,21 @@ static void queue_custom_hardware_message( struct desktop *desktop, user_handle_ raw_msg.message = input->hw.msg; raw_msg.hid_report = NULL;
+ if (input->hw.rawinput.type == RIM_TYPEHID) + { + raw_msg.hid_report = get_req_data(); + report_size = input->hw.rawinput.hid.length * input->hw.rawinput.hid.count; + } + + if (report_size != get_req_data_size()) + { + set_error( STATUS_INVALID_PARAMETER ); + return; + } + msg_data = &raw_msg.data; msg_data->info = 0; - msg_data->size = sizeof(*msg_data); + msg_data->size = sizeof(*msg_data) + report_size; msg_data->flags = 0; msg_data->rawinput = input->hw.rawinput;
diff --git a/server/trace.c b/server/trace.c index 5e1c7675b0a..d84f4c9543a 100644 --- a/server/trace.c +++ b/server/trace.c @@ -408,9 +408,9 @@ static void dump_rawinput( const char *prefix, const union rawinput *rawinput ) rawinput->kbd.message, rawinput->kbd.vkey, rawinput->kbd.scan ); break; case RIM_TYPEHID: - fprintf( stderr, "%s{type=HID,device=%04x,param=%04x,page=%04hx,usage=%04hx}", + fprintf( stderr, "%s{type=HID,device=%04x,param=%04x,page=%04hx,usage=%04hx,count=%u,length=%u}", prefix, rawinput->hid.device, rawinput->hid.param, rawinput->hid.usage_page, - rawinput->hid.usage ); + rawinput->hid.usage, rawinput->hid.count, rawinput->hid.length ); break; default: fprintf( stderr, "%s{type=%04x}", prefix, rawinput->type ); diff --git a/tools/make_requests b/tools/make_requests index a70b29df3d2..1c4e5977c8b 100755 --- a/tools/make_requests +++ b/tools/make_requests @@ -52,7 +52,7 @@ my %formats = "luid_t" => [ 8, 4, "&dump_luid" ], "generic_map_t" => [ 16, 4, "&dump_generic_map" ], "ioctl_code_t" => [ 4, 4, "&dump_ioctl_code" ], - "hw_input_t" => [ 32, 8, "&dump_hw_input" ], + "hw_input_t" => [ 40, 8, "&dump_hw_input" ], );
my @requests = ();