Search code examples
windowswinapiwdk

Device Identification and setup api


Is there a way to obtain properties of devices that correspond or belong to the guid class namely ClassName "Sensor". I want to obtain information to filter out devices(sensors) that are not relevant. I believe you can enumerate devices with SetupDiEnumDeviceInfo but is there way to obtain more information about them?

I'm currently using SetupDiGetDeviceRegistryProperty to obtain registry value associated with the device but is this the correct way or is there an alternative way to accomplish this?

I would like to accomplish this in user-mode if possible.


Solution

  • The Windows Driver Kit (WDK) comes with the source/binaries to a utility called devcon which might be useful. There's a "listclass" option that will give you the hardware IDs of every device installed in a given class. For example:

    devcon listclass sensor
    

    This might give you what you need, albeit in a roundabout way.

    -scott