[PATCH v2 3/4] server: Add HID length and report to rawinput union.

Alexandre Julliard julliard at winehq.org
Fri May 14 15:32:35 CDT 2021


Rémi Bernon <rbernon at codeweavers.com> writes:

> On 5/14/21 9:38 PM, Alexandre Julliard wrote:
>> Rémi Bernon <rbernon at codeweavers.com> writes:
>> 
>>> @@ -302,6 +302,9 @@ union rawinput
>>>           unsigned int   param;   /* rawinput message param */
>>>           unsigned short usage_page;/* HID usage page */
>>>           unsigned short usage;   /* HID usage */
>>> +        unsigned int   length;  /* HID report length */
>>> +        int            __pad;
>>> +        /* followed by length bytes of HID report data  */
>> That's not true in server requests, I don't think we should pretend
>> that
>> it is. The report data should be declared as a separate VARARG field in
>> the request, and use a separate pointer where necessary. The length can
>> probably be stored separately as well.
>> 
>
> Yes, I think I had it like that at some point, it probably got lost
> somewhere.
>
> I understand that this is only for the send_hardware_message request?
> I don't see how to do that for get_message request or
> get_rawinput_buffer, where the replied message data (or message
> buffer) is already a VARARG, and for which we reply a struct
> hardware_msg_data, followed by extra bytes for the hid report?

Yes, in the message data it would need to be packed in with the
rest. But even there it would follow the hardware_msg_data struct, not
the rawinput.hid field (right now it's the same, but that could change
if other fields are added).

-- 
Alexandre Julliard
julliard at winehq.org



More information about the wine-devel mailing list