[PATCH 3/3] user32: Use HID ioctls directly.

Rémi Bernon rbernon at codeweavers.com
Wed May 18 01:45:39 CDT 2022


On 5/18/22 05:12, Zebediah Figura wrote:
> @@ -760,9 +764,9 @@ UINT WINAPI GetRawInputDeviceInfoW(HANDLE handle, UINT command, void *data, UINT
>           break;
>   
>       case RIDI_PREPARSEDDATA:
> -        if (!(preparsed = (struct hid_preparsed_data *)device->data)) len = 0;
> -        else len = preparsed->caps_size + FIELD_OFFSET(struct hid_preparsed_data, value_caps[0]) +
> -                   preparsed->number_link_collection_nodes * sizeof(struct hid_collection_node);
> +        if (!device->data) len = 0;
> +        else len = device->data->caps_size + FIELD_OFFSET(struct hid_preparsed_data, value_caps[0]) +
> +                   device->data->number_link_collection_nodes * sizeof(struct hid_collection_node);
>   
>           if (device->data && len <= data_len && data)
>               memcpy(data, device->data, len);


Imho the local variable is still making this easier to read, double 
indirections are ugly. It could then be used more consistently below.

-- 
Rémi Bernon <rbernon at codeweavers.com>



More information about the wine-devel mailing list