[PATCH v5 3/5] winebus.sys: Implement get_string for linux event devices

Andrew Eikum aeikum at codeweavers.com
Mon Jan 22 09:35:55 CST 2018


Signed-off-by: Andrew Eikum <aeikum at codeweavers.com>

On Fri, Jan 19, 2018 at 07:42:43AM -0600, Aric Stewart wrote:
> 
> v5: Update from Andrew Eikum
> 
> Signed-off-by: Aric Stewart <aric at codeweavers.com>
> ---
>  dlls/winebus.sys/bus_udev.c | 25 ++++++++++++++++++++++++-
>  1 file changed, 24 insertions(+), 1 deletion(-)
> 
> 

> diff --git a/dlls/winebus.sys/bus_udev.c b/dlls/winebus.sys/bus_udev.c
> index 54d982727b..b700da1fbb 100644
> --- a/dlls/winebus.sys/bus_udev.c
> +++ b/dlls/winebus.sys/bus_udev.c
> @@ -862,7 +862,30 @@ static NTSTATUS lnxev_get_reportdescriptor(DEVICE_OBJECT *device, BYTE *buffer,
>  
>  static NTSTATUS lnxev_get_string(DEVICE_OBJECT *device, DWORD index, WCHAR *buffer, DWORD length)
>  {
> -    return STATUS_NOT_IMPLEMENTED;
> +    struct wine_input_private *ext = input_impl_from_DEVICE_OBJECT(device);
> +    char str[255] = {0};
> +
> +    switch (index)
> +    {
> +        case HID_STRING_ID_IPRODUCT:
> +            ioctl(ext->base.device_fd, EVIOCGNAME(sizeof(str)), str);
> +            break;
> +        case HID_STRING_ID_IMANUFACTURER:
> +            strcpy(str,"evdev");
> +            break;
> +        case HID_STRING_ID_ISERIALNUMBER:
> +            ioctl(ext->base.device_fd, EVIOCGUNIQ(sizeof(str)), str);
> +            break;
> +        default:
> +            ERR("Unhandled string index %i\n", index);
> +    }
> +
> +    if (str[0])
> +        MultiByteToWideChar(CP_ACP, 0, str, -1, buffer, length);
> +    else
> +        buffer[0] = 0;
> +
> +    return STATUS_SUCCESS;
>  }
>  
>  static NTSTATUS lnxev_begin_report_processing(DEVICE_OBJECT *device)
> 

> 




More information about the wine-devel mailing list