[PATCH 7/8] winexinput.sys: Return native product strings on some devices.

Zebediah Figura zfigura at codeweavers.com
Mon Sep 6 15:52:56 CDT 2021


On 9/6/21 1:34 PM, Rémi Bernon wrote:
> On 9/6/21 7:06 PM, Zebediah Figura wrote:
>> On 9/6/21 1:40 AM, Rémi Bernon wrote:
>>> +    case IOCTL_HID_GET_STRING:
>>> +        switch
>>> ((ULONG_PTR)stack->Parameters.DeviceIoControl.Type3InputBuffer)
>>> +        {
>>> +        case HID_STRING_ID_IPRODUCT:
>>> +            match_id = wcsrchr(impl->device_id, '\\') + 1;
>>> +            for (i = 0; i < ARRAY_SIZE(device_strings); ++i)
>>> +                if (!wcsicmp(device_strings[i].id, match_id))
>>> +                    break;
>>> +            if (i < ARRAY_SIZE(device_strings)) str =
>>> device_strings[i].product;
>>> +            break;
>>
>> Just a suggestion, really, but this might be cleaner as a helper function?
>>
> Well, I don't plan on adding anything more there, so maybe it could be
> split later if we need to.

I don't necessarily mean anything needs to be added, it's just that I 
really don't like the "for followed by if" pattern that this exemplifies.

> 
> Also AFAICS Windows gets the device product string from the driver inf
> file, and never calls IOCTL_HID_GET_STRING, so this could just go away
> when we have a similar implementation.
> 

If I had to guess, it's probably retrieving it from the DeviceDesc 
registry key.



More information about the wine-devel mailing list