AddDevice in P&P

Hey, so when a new device is detected at some point the PnP manager needs to construct the device stack, correct me if im wrong but it locates the FDO based on the DeviceId returned from the bus driver that identified the new device , by using that to find some registry keys. partly, those keys contain LowerFilters and UpperFilters list for the device that need to be loaded and attached 1. Is it the responsability of the pnp manager to load them? What if they are already loaded? 2. The attaching part , thats the responsibility of the AddDevice callback, correct? The PnP manager’s role is only to invoke that? 3. How do you register as a lower filter/ upper for a particular pnp device?

  1. The device manager basically says “if the driver is not already in memory, load it.” It then triggers an AddDevice.
  2. Yes, the driver is responsible for attaching to the lower device. In some cases, a filter doesn’t care about some particular device and will skip the attaching.
  3. In HKLM\System\CurrentControlSet\Enum, in the key that matches the hardware ID, there are registry values called “LowerFilters” and “UpperFilters” that contain the service names of the drivers to be used.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.