From: "Rémi Bernon" Subject: Re: [PATCH 5/5] hidclass.sys: Send rawinput messages with HID report. Message-Id: Date: Wed, 10 Feb 2021 20:07:17 +0100 In-Reply-To: <20210210122335.516779-5-rbernon@codeweavers.com> References: <20210210122335.516779-1-rbernon@codeweavers.com> <20210210122335.516779-5-rbernon@codeweavers.com> On 2/10/21 1:23 PM, Rémi Bernon wrote: > Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50506 > Signed-off-by: Rémi Bernon > --- > dlls/hidclass.sys/device.c | 22 ++++++++++++++++++++++ > 1 file changed, 22 insertions(+) > > diff --git a/dlls/hidclass.sys/device.c b/dlls/hidclass.sys/device.c > index fc1dfd07db1..8d7bae5cafa 100644 > --- a/dlls/hidclass.sys/device.c > +++ b/dlls/hidclass.sys/device.c > @@ -26,6 +26,7 @@ > #include "winuser.h" > #include "setupapi.h" > > +#include "wine/server.h" > #include "wine/debug.h" > #include "ddk/hidsdi.h" > #include "ddk/hidtypes.h" > @@ -237,6 +238,25 @@ static NTSTATUS copy_packet_into_buffer(HID_XFER_PACKET *packet, BYTE* buffer, U > return STATUS_BUFFER_OVERFLOW; > } > > +static void HID_Device_sendRawInput(DEVICE_OBJECT *device, HID_XFER_PACKET *packet) > +{ > + BASE_DEVICE_EXTENSION *ext = device->DeviceExtension; > + > + SERVER_START_REQ(send_hardware_message) > + { > + req->win = 0; > + req->flags = 0; > + req->input.type = HW_INPUT_HID; > + req->input.hid.device = 0; /* FIXME */ > + req->input.hid.usage_page = ext->preparseData->caps.UsagePage; > + req->input.hid.usage = ext->preparseData->caps.Usage; > + req->input.hid.length = packet->reportBufferLen; > + wine_server_add_data(req, packet->reportBuffer, packet->reportBufferLen); > + wine_server_call(req); > + } > + SERVER_END_REQ; > +} > + > static void HID_Device_processQueue(DEVICE_OBJECT *device) > { > IRP *irp; > @@ -320,6 +340,7 @@ static DWORD CALLBACK hid_device_thread(void *args) > if (irp->IoStatus.u.Status == STATUS_SUCCESS) > { > RingBuffer_Write(ext->ring_buffer, packet); > + HID_Device_sendRawInput(device, packet); > HID_Device_processQueue(device); > } > > @@ -366,6 +387,7 @@ static DWORD CALLBACK hid_device_thread(void *args) > else > packet->reportId = 0; > RingBuffer_Write(ext->ring_buffer, packet); > + HID_Device_sendRawInput(device, packet); > HID_Device_processQueue(device); > } > > There's apparently some outstanding issue related to the HID report carried by WM_INPUT, possibly making this patch not entirely correct. I think it only impacts this last patch though, not the previous changes that are required to send WM_INPUT messages with HID data. -- Rémi Bernon