How does Windows categorize devices in "Device Manager"?

6,062

Solution 1

It's basically the device driver's responsibility. Windows represents devices by device objects. Each device object has a device type, which is stored in the DeviceType member of its DEVICE_OBJECT structure. The device type represents the type of underlying hardware for the driver. See the source page below as well as related MSDN documentation about kernel and user-mode drivers, the Windows Driver Model (WDM) architecture etc.

Source

Solution 2

Your understanding is incorrect - INF files do define the category where a device will go in Device Manager. Windows categorizes devices based on the Class and ClassGuid entries in the INF file used to install the device.

For example, go to Device Manager -> Keyboards -> HID Keyboard Device (assumed) -> right-click -> Properties -> Details tab -> Property dropdown -> Device class guid. You should see {4d36e96b-e325-11ce-bfc1-08002be10318} for the device class GUID. This matches the GUID for Keyboard in the MSDN link "System-Defined Device Setup Classes Available to Vendors" http://msdn.microsoft.com/en-us/library/ff553426%28v=vs.85%29.aspx

You can even create your own Device Manager categories. "Creating a New Device Setup Class" http://msdn.microsoft.com/en-us/library/ff540189%28VS.85%29.aspx But this is generally frowned upon, and you should use existing Class GUIDs where appropriate. For example, if you chose to use a different Class GUID for a keyboard, (I think) the OS would not recognize the keys that were pressed, even though the OS recognizes the device itself (i.e. it enumerated, it sends data, but the data doesn't go into the system's keyboard buffers)

Share:
6,062

Related videos on Youtube

lyrica
Author by

lyrica

Updated on September 18, 2022

Comments

  • lyrica
    lyrica about 1 year

    How does Windows determine device categorization in "Device Manager"?

    For instance, Device Manager lists such categories as "Imaging devices", "Keyboards", "Sound, video, and game controllers", etc. -- how does Windows "know" to put a device into any of these categories?

    How does Windows decide which device is which, and then file it under a category?

    For reference, I understand Windows uses hardware and vendor IDs to "know" what a device is, and that the visible naming of a device stems from the initial INF file. But from my understanding, INF files don't define the category or type of device, hence why I'm wondering how Windows is making the distinction.