When we connect USB mass storage device, two entries are created in the Device Manager: one under Disk Drive and another under USB as USB Mass Storage.
HDEVINFO hDevInfo = SetupDiGetClassDevs(
(LPGUID) &GUID_DEVCLASS_DISKDRIVE, // USB Device Class
NULL,
NULL,
DIGCF_PRESENT);
This will list the entry under Disk Drive
HDEVINFO hDevInfo = SetupDiGetClassDevs(
(LPGUID) &GUID_DEVCLASS_USB, // USB Device Class
NULL,
NULL,
DIGCF_PRESENT);
This will list all the USB devices.
Is there any way to map the entries obtained from the above two calls.
I checked for device instance id of all the devices using SetupDiEnumDeviceInfo
,
but ids did not match
The reason I need to map these two entries is because I have to get the USB device location (Hub and Port) number
Thanks Praveen