Module: wine Branch: master Commit: 7d152715ef69ba2dd9945466f04cc5e93c2e86b2 URL: https://source.winehq.org/git/wine.git/?a=commit;h=7d152715ef69ba2dd9945466f...
Author: Zebediah Figura z.figura12@gmail.com Date: Thu Nov 7 23:37:53 2019 -0600
setupapi: Set the device class in SetupDiBuildDriverInfoList().
This matches Windows XP behaviour. In Vista and later this appears to be done by UpdateDriverForPlugAndPlayDevices().
Signed-off-by: Zebediah Figura z.figura12@gmail.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/setupapi/devinst.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
diff --git a/dlls/setupapi/devinst.c b/dlls/setupapi/devinst.c index f0d75f90b8..6de26b943f 100644 --- a/dlls/setupapi/devinst.c +++ b/dlls/setupapi/devinst.c @@ -4545,6 +4545,20 @@ BOOL WINAPI SetupDiBuildDriverInfoList(HDEVINFO devinfo, SP_DEVINFO_DATA *device } }
+ if (device->driver_count) + { + WCHAR classname[MAX_CLASS_NAME_LEN], guidstr[39]; + GUID class; + + if (SetupDiGetINFClassW(device->drivers[0].inf_path, &class, classname, ARRAY_SIZE(classname), NULL)) + { + device_data->ClassGuid = device->class = class; + SETUPDI_GuidToString(&class, guidstr); + RegSetValueExW(device->key, L"ClassGUID", 0, REG_SZ, (BYTE *)guidstr, sizeof(guidstr)); + RegSetValueExW(device->key, L"Class", 0, REG_SZ, (BYTE *)classname, wcslen(classname) * sizeof(WCHAR)); + } + } + return TRUE; }