[PATCH v2 4/6] hidclass.sys: Send rawinput messages with HID report.
Alexandre Julliard
julliard at winehq.org
Fri Mar 5 11:03:45 CST 2021
Rémi Bernon <rbernon at codeweavers.com> writes:
> @@ -237,6 +238,34 @@ 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;
> + UCHAR report_id;
> +
> + SERVER_START_REQ(send_hardware_message)
> + {
> + req->win = 0;
> + req->flags = 0;
> + req->input.type = HW_INPUT_HID;
> + req->input.hid.usage_page = ext->preparseData->caps.UsagePage;
> + req->input.hid.usage = ext->preparseData->caps.Usage;
> + req->input.hid.length = 0;
> +
> + if (!(report_id = ext->preparseData->reports[0].reportID))
> + {
> + wine_server_add_data(req, &report_id, sizeof(report_id));
> + req->input.hid.length++;
> + }
> +
> + wine_server_add_data(req, packet->reportBuffer, packet->reportBufferLen);
> + req->input.hid.length += packet->reportBufferLen;
> +
> + wine_server_call(req);
> + }
> + SERVER_END_REQ;
> +}
It would be better to find a way to do this using exported APIs. I don't
think we want to have even more modules make direct server calls (the
goal is for all server calls to be done on the Unix side of the syscall
interface).
--
Alexandre Julliard
julliard at winehq.org
More information about the wine-devel
mailing list