[PATCH 3/3] winebus.sys: Parse product string from uevent HID_NAME.
Rémi Bernon
rbernon at codeweavers.com
Wed Oct 6 07:04:02 CDT 2021
Signed-off-by: Rémi Bernon <rbernon at codeweavers.com>
---
>From Proton, to support cases where udev doesn't report it properly.
dlls/winebus.sys/bus_udev.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/dlls/winebus.sys/bus_udev.c b/dlls/winebus.sys/bus_udev.c
index 1f563ebb56f..f780aac2785 100644
--- a/dlls/winebus.sys/bus_udev.c
+++ b/dlls/winebus.sys/bus_udev.c
@@ -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;
--
2.33.0
More information about the wine-devel
mailing list