I was wondering if it is possible to get the USB device descriptor with the SetupAPI functions (like SetupDiGetDeviceRegistryProperty)?
Thank you!
EDIT
So far I am only able to receive the windows friendly name:
SetupDiGetDeviceRegistryProperty(hDevInfo, &DeviceInfoData, SPDRP_DEVICEDESC,
&dwPropertyRegDataType, (BYTE*)szDesc, sizeof(szDesc), &dwSize)
we need have/got string representing Device Instance ID of a device. with this we first obtains a device instance handle to the device node via
CM_Locate_DevNodeand then callCM_Get_DevNode_PropertywithDEVPKEY_NAME:if we have the string that identifies the device interface instance - we can obtaining the device instance identifier from it via call
CM_Get_Device_Interface_PropertywithDEVPKEY_Device_InstanceIdkey and then callPrintFriendlyNameByDeviceIDand at begin we have 2 choice: of just retrieves a list of device instance IDs via call
CM_Get_Device_ID_ListwithCM_GETIDLIST_FILTER_CLASS|CM_GETIDLIST_FILTER_PRESENTand use"{36fc9e60-c465-11cf-8056-444553540000}"as filter - this is string representation of well knownGUID_DEVCLASS_USBdefined indevguid.h:or enumerate device interfaces via CM_Get_Device_Interface_List and call
PrintFriendlyNameByInterfacefor every device interface.you can use say
GUID_DEVINTERFACE_USB_DEVICEthe result of methods (which devices /interfaces) will be listed can be different. say om my comp when enum by
GUID_DEVINTERFACE_USB_DEVICE:and when enum by
GUID_DEVCLASS_USBstring filter: