forked from Mirrors/wine-wine
setupapi: Set device SPDRP_CLASS registry property in create_device().
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>stable
parent
014f61539b
commit
288a6625ad
|
@ -751,7 +751,9 @@ static struct device *create_device(struct DeviceInfoSet *set,
|
||||||
{
|
{
|
||||||
const DWORD one = 1;
|
const DWORD one = 1;
|
||||||
struct device *device;
|
struct device *device;
|
||||||
WCHAR guidstr[39];
|
WCHAR guidstr[MAX_GUID_STRING_LEN];
|
||||||
|
WCHAR class_name[MAX_CLASS_NAME_LEN];
|
||||||
|
DWORD size;
|
||||||
|
|
||||||
TRACE("%p, %s, %s, %d\n", set, debugstr_guid(class),
|
TRACE("%p, %s, %s, %d\n", set, debugstr_guid(class),
|
||||||
debugstr_w(instanceid), phantom);
|
debugstr_w(instanceid), phantom);
|
||||||
|
@ -796,6 +798,12 @@ static struct device *create_device(struct DeviceInfoSet *set,
|
||||||
SETUPDI_SetDeviceRegistryPropertyW(device, SPDRP_CLASSGUID,
|
SETUPDI_SetDeviceRegistryPropertyW(device, SPDRP_CLASSGUID,
|
||||||
(const BYTE *)guidstr, sizeof(guidstr));
|
(const BYTE *)guidstr, sizeof(guidstr));
|
||||||
|
|
||||||
|
if (SetupDiClassNameFromGuidW(class, class_name, ARRAY_SIZE(class_name), NULL))
|
||||||
|
{
|
||||||
|
size = (lstrlenW(class_name) + 1) * sizeof(WCHAR);
|
||||||
|
SETUPDI_SetDeviceRegistryPropertyW(device, SPDRP_CLASS, (const BYTE *)class_name, size);
|
||||||
|
}
|
||||||
|
|
||||||
TRACE("Created new device %p.\n", device);
|
TRACE("Created new device %p.\n", device);
|
||||||
return device;
|
return device;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1643,8 +1643,8 @@ todo_wine {
|
||||||
/* Have SPDRP_CLASS property */
|
/* Have SPDRP_CLASS property */
|
||||||
memset(buf, 0, sizeof(buf));
|
memset(buf, 0, sizeof(buf));
|
||||||
ret = SetupDiGetDeviceRegistryPropertyA(set, &device, SPDRP_CLASS, NULL, (BYTE *)buf, sizeof(buf), NULL);
|
ret = SetupDiGetDeviceRegistryPropertyA(set, &device, SPDRP_CLASS, NULL, (BYTE *)buf, sizeof(buf), NULL);
|
||||||
todo_wine ok(ret, "Failed to get property, error %#x.\n", GetLastError());
|
ok(ret, "Failed to get property, error %#x.\n", GetLastError());
|
||||||
todo_wine ok(!lstrcmpA(buf, "Display"), "Got unexpected value %s.\n", buf);
|
ok(!lstrcmpA(buf, "Display"), "Got unexpected value %s.\n", buf);
|
||||||
|
|
||||||
SetupDiDestroyDeviceInfoList(set);
|
SetupDiDestroyDeviceInfoList(set);
|
||||||
}
|
}
|
||||||
|
@ -1803,8 +1803,8 @@ todo_wine {
|
||||||
/* Have SPDRP_CLASS property */
|
/* Have SPDRP_CLASS property */
|
||||||
memset(buf, 0, sizeof(buf));
|
memset(buf, 0, sizeof(buf));
|
||||||
ret = SetupDiGetDeviceRegistryPropertyW(set, &device, SPDRP_CLASS, NULL, (BYTE *)buf, sizeof(buf), NULL);
|
ret = SetupDiGetDeviceRegistryPropertyW(set, &device, SPDRP_CLASS, NULL, (BYTE *)buf, sizeof(buf), NULL);
|
||||||
todo_wine ok(ret, "Failed to get property, error %#x.\n", GetLastError());
|
ok(ret, "Failed to get property, error %#x.\n", GetLastError());
|
||||||
todo_wine ok(!lstrcmpW(buf, L"Display"), "Got unexpected value %s.\n", wine_dbgstr_w(buf));
|
ok(!lstrcmpW(buf, L"Display"), "Got unexpected value %s.\n", wine_dbgstr_w(buf));
|
||||||
|
|
||||||
SetupDiDestroyDeviceInfoList(set);
|
SetupDiDestroyDeviceInfoList(set);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue