none
Is CM_DRP_DRIVER unique across the system? RRS feed

  • Question

  • If I have two devices, and they have the same CM_DRP_DRIVER registry property, are they the same device?

    As an example, I use the PnP Configuration Manager to walk the device tree. I call this function:

            cr = CM_Get_DevNode_Registry_Property(devInst,
                                                 CM_DRP_DRIVER,
                                                  NULL,
                                                  buf,
                                                  &len,
                                                  0);
    

    And I get values that look like this:

    {745a17a0-74d3-11d0-b6fe-00a0c90f57da}\0001
    {745a17a0-74d3-11d0-b6fe-00a0c90f57da}\0002
    {745a17a0-74d3-11d0-b6fe-00a0c90f57da}\0003

    It looks like they're not repeating. Does this mean that if I get a driver key from somewhere else, I can definitively determine the device it belongs to?

    Saturday, February 25, 2017 1:57 AM

Answers

  • It is not documented (and I don't remember this mentioned anywhere explicitly) but the "drivers" registry tree (aka "software") mirrors the "enum" tree (aka "hardware"). If any device instance under Enum tree has a PnP driver, the Driver property points to the dedicated instance of a driver. The relation between these instances always is one to one. So, in short, yes.

    -- pa

    • Marked as answer by Edward Falk Friday, March 3, 2017 2:11 AM
    Sunday, February 26, 2017 4:30 PM

All replies

  • It is not documented (and I don't remember this mentioned anywhere explicitly) but the "drivers" registry tree (aka "software") mirrors the "enum" tree (aka "hardware"). If any device instance under Enum tree has a PnP driver, the Driver property points to the dedicated instance of a driver. The relation between these instances always is one to one. So, in short, yes.

    -- pa

    • Marked as answer by Edward Falk Friday, March 3, 2017 2:11 AM
    Sunday, February 26, 2017 4:30 PM
  • It is not documented (and I don't remember this mentioned anywhere explicitly) but the "drivers" registry tree (aka "software") mirrors the "enum" tree (aka "hardware"). If any device instance under Enum tree has a PnP driver, the Driver property points to the dedicated instance of a driver. The relation between these instances always is one to one. So, in short, yes.

    -- pa

    Thank you. And given the amount of code I've encountered that depends on this property, I think you're very likely right.
    Friday, March 3, 2017 2:12 AM