winebus.sys: Parse product string from uevent HID_NAME.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Rémi Bernon 2021-10-06 14:04:02 +02:00 committed by Alexandre Julliard
parent 2c0da82050
commit 57d99dcfb7

View file

@ -1048,6 +1048,7 @@ static void get_device_subsystem_info(struct udev_device *dev, char const *subsy
{
struct udev_device *parent = NULL;
const char *ptr, *next, *tmp;
char buffer[MAX_PATH];
DWORD bus = 0;
if (!(parent = udev_device_get_parent_with_subsystem_devtype(dev, subsystem, NULL))) return;
@ -1062,11 +1063,16 @@ static void get_device_subsystem_info(struct udev_device *dev, char const *subsy
if (!strncmp(ptr, "HID_UNIQ=", 9))
{
char buffer[MAX_PATH];
if (desc->serialnumber[0]) continue;
if (sscanf(ptr, "HID_UNIQ=%256s\n", buffer) == 1)
ntdll_umbstowcs(buffer, strlen(buffer) + 1, desc->serialnumber, ARRAY_SIZE(desc->serialnumber));
}
if (!strncmp(ptr, "HID_NAME=", 7))
{
if (desc->product[0]) continue;
if (sscanf(ptr, "HID_NAME=%256s\n", buffer) == 1)
ntdll_umbstowcs(buffer, strlen(buffer) + 1, desc->product, ARRAY_SIZE(desc->product));
}
if (!strncmp(ptr, "HID_PHYS=", 9) || !strncmp(ptr, "PHYS=\"", 6))
{
if (!(tmp = strstr(ptr, "/input")) || tmp >= next) continue;