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>
This commit is contained in:
Zebediah Figura 2019-11-07 23:37:53 -06:00 committed by Alexandre Julliard
parent 161a0c259a
commit 7d152715ef
1 changed files with 14 additions and 0 deletions

View File

@ -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;
}