"Maxim S. Shatskih" <> wrote in message
news:...
> > But, you have to understand the difference between a normal WDM filter
> > driver and a bus filter driver. A bus filter is fairly complicated to
> > implement.
>
> Several lines of code in MN_QUERY_DEVICE_RELATIONS path, which will attach
the
> filter DOs to all PDOs in the relations list.
This is very simple.
> Proper destruction of these DOs is also a must.
The tricky part is removing these DOs, (when to remove/not to remove/delay
remove until something happen)
Auto loading filter for any PCI-PCI or AGP bridges FDOs is another trouble.
(just imagine someone hot plug in a PCI-PCI or AGP bridge and there're
devices behind that bridge)
Sometime ago, I did such a filter and it works great for PCI and usb stacks.
To the OP, instead of a bus filter, there may be an easier way to accomplish
this but that may required some undoc methods.
To send IRP_MN_READ/WRITE_CONFIG to the stack, all you need is the targeted
PDOs created by pci.sys. You basically need the DRIVER_OBJECT for pci.sys.
(do a google on ObReferenceObjectByName), then you will need
IoEnumerateDeviceObjectList (see IFS doc if you have). For each enumerated
DO, send a IRP_MN_QUERY_BUS_RELATIONS (target relation), you then can tell
PDO from FDO. Don't forget to deref objects in most of those steps.
I know this may be evil and I'm opening a can of worms, but it works
reasonably well for me, and it's solely for in-house test/prove-of-concept
purpose. You don't need to implement it as a PNP filter, just a legacy
driver will be fine, easy to load/unload.
Good luck,
Calvin
-
Calvin Guan Software Engineer
ATI Technologies Inc.
www.ati.com