PCI BUS device filter driver

Hi, I’m looking for adding the filter to modify the config space access. I tried to add the filter driver (tried checking with lower and upper) till the first one listed with the !pcitree.
But I ending up with 2 cases:

  1. Upper/Lower filter driver is always loading after the actual PCI device object created
    – Please confirm, is that the filter drivers would be loaded actual device driver?
  2. Before the first PDO been created (top one from the list !pcitree), when I tried to check with the config space of my device using !pci 121 able to notice that config space is already available through windbg
    – How the config space of the device is available with !pci command even before first PDO with the !pcitree been created?
    – How to capture the first config space read access? so that I can get opportunity to modify the values

What kind of filtering are you hoping to do? I suspect you have some major misunderstandings of how things actually work.

The configuration space for a PCI device is available as soon as power is applied. That’s an attribute of the hardware. The operating system is not involved.

Driver stacks are built from the bottom up. PDO, then lower filters, then FDO, then upper filters.

The PCI bus driver reads the configuration space directly, using one of several access methods. These are hardware operations. There is no way to get a filter driver involved.