Thanks for the help on HardwareIds. Almost there… ![]()
Now I’m at a loss for understanding why I have added content in the
hardware id path. devcon reports:
VBUS\TEST_DEV_10\4&306CFD90&0&10
Name: Vbus virtual ethernet id = 10
Hardware IDs:
VBUS\test_dev_10
VBUS\TEST_DEV_11\4&306CFD90&0&11
Name: Vbus virtual ethernet id = 11
Hardware IDs:
VBUS\test_dev_11
2 matching device(s) found.
What is “4&306CFD90&0&10” all about? Interesting that the last two
digits are “10” and “11”, which are the InstanceIds I assign. But I do
not understand why my path was modified. I’d like to know.
I create my ids with the following:
DECLARE_CONST_UNICODE_STRING(deviceLocation, L"VBUS\");
DECLARE_UNICODE_STRING_SIZE(type, VBUS_MAX_DEVTYPE_LEN*2);
DECLARE_UNICODE_STRING_SIZE(hwid, VBUS_MAX_DEVTYPE_LEN*2);
/*
* Set DeviceType
*/
WdfDeviceInitSetDeviceType(init, FILE_DEVICE_NETWORK);
RtlInitAnsiString(&atype, d->type);
RtlAnsiStringToUnicodeString(&type, &atype, FALSE);
RtlUnicodeStringCat(&hwid, &deviceLocation);
RtlUnicodeStringCat(&hwid, &type);
/*
* Provide DeviceID, HardwareIDs and InstanceId
*/
rc = WdfPdoInitAssignDeviceID(init, &hwid);
if (!NT_SUCCESS(rc))
return rc;
rc = WdfPdoInitAddHardwareID(init, &hwid);
if (!NT_SUCCESS(rc))
return rc;
RtlUnicodeStringPrintf(&type, L"%d", d->id);
rc = WdfPdoInitAssignInstanceID(init, &type);
if (!NT_SUCCESS(rc))
return rc;
Am I missing something?
THanks,
-PWM