Hi Kernel Heroes and Heroines,
Hope everyone is doing well today.
Just got quick question, I have been trying to list all installed devices in the system yet not managing to,
when I call
hDevInfo = SetupDiGetClassDevs(NULL, 0, 0, DIGCF_ALLCLASSES);
and then I enumerate with loop through both
SetupDiEnumDeviceInfo(hDevInfo, i, &DeviceInfoData)
&&
SetupDiEnumDeviceInterfaces(hDevInfo, &DeviceInfoData, &ClassGUID, i, &deviceInterfaceData);
to get deviceinfodata and deviceInterfaceData for devicepath, and deviceinstanceid and other fields from Device registry property codes.
I don’t get all of the devices installed in system, rather it returns very few, especially I noticed it doesn’t return devices from class Storage devices
so I wondered if there is any way I could list the whole of devices from all classes mentioned here
https://msdn.microsoft.com/en-us/library/windows/hardware/ff541389(v=vs.85).aspx
with one call ? is it possible ? because I managed reading all devices I needed but in two calls to the routine SetupDiGetClassDevs as following,
hDevInfo = SetupDiGetClassDevs(GUID_DEVINTERFACE_DISK, 0, 0, DIGCF_DEVICEINTERFACE);
hDevInfo = SetupDiGetClassDevs(GUID_DEVINTERFACE_STORAGEPORT, 0, 0, DIGCF_DEVICEINTERFACE);
As you notice both storageport and disk classes are part of Storage devices class,
so at the very worst scenario is it possible to list at least list all devices associated with Storage devices class .
Looking forward & thanks in advance.
Zakaria .