setupapi: Add a device ID member to DeviceInfo.

This commit is contained in:
Juan Lang 2007-10-11 13:25:29 -07:00 committed by Alexandre Julliard
parent 0d39a07eca
commit 732b968b22
1 changed files with 5 additions and 3 deletions

View File

@ -127,6 +127,7 @@ struct DeviceInfo
struct DeviceInfoSet *set; struct DeviceInfoSet *set;
HKEY key; HKEY key;
BOOL phantom; BOOL phantom;
DWORD devId;
LPWSTR instanceId; LPWSTR instanceId;
struct list interfaces; struct list interfaces;
}; };
@ -424,7 +425,7 @@ static HKEY SETUPDI_CreateDevKey(struct DeviceInfo *devInfo)
} }
static struct DeviceInfo *SETUPDI_AllocateDeviceInfo(struct DeviceInfoSet *set, static struct DeviceInfo *SETUPDI_AllocateDeviceInfo(struct DeviceInfoSet *set,
LPCWSTR instanceId, BOOL phantom) DWORD devId, LPCWSTR instanceId, BOOL phantom)
{ {
struct DeviceInfo *devInfo = HeapAlloc(GetProcessHeap(), 0, struct DeviceInfo *devInfo = HeapAlloc(GetProcessHeap(), 0,
sizeof(struct DeviceInfo)); sizeof(struct DeviceInfo));
@ -432,6 +433,7 @@ static struct DeviceInfo *SETUPDI_AllocateDeviceInfo(struct DeviceInfoSet *set,
if (devInfo) if (devInfo)
{ {
devInfo->set = set; devInfo->set = set;
devInfo->devId = devId;
devInfo->instanceId = HeapAlloc(GetProcessHeap(), 0, devInfo->instanceId = HeapAlloc(GetProcessHeap(), 0,
(lstrlenW(instanceId) + 1) * sizeof(WCHAR)); (lstrlenW(instanceId) + 1) * sizeof(WCHAR));
if (devInfo->instanceId) if (devInfo->instanceId)
@ -501,8 +503,8 @@ static BOOL SETUPDI_AddDeviceToSet(struct DeviceInfoSet *set,
SP_DEVINFO_DATA **dev) SP_DEVINFO_DATA **dev)
{ {
BOOL ret = FALSE; BOOL ret = FALSE;
struct DeviceInfo *devInfo = SETUPDI_AllocateDeviceInfo(set, instanceId, struct DeviceInfo *devInfo = SETUPDI_AllocateDeviceInfo(set, set->cDevices,
phantom); instanceId, phantom);
TRACE("%p, %s, %d, %s, %d\n", set, debugstr_guid(guid), devInst, TRACE("%p, %s, %d, %s, %d\n", set, debugstr_guid(guid), devInst,
debugstr_w(instanceId), phantom); debugstr_w(instanceId), phantom);