I have an upper bus filter driver, and the filter DO was created and attached
to the bus FDO without any problem.
But my primary interest is to filter the PDOs created by bus driver. The
filter DO above the bus FDO cannot see the IRPs to those PDOs.
I think I should create a filter DO and attach it to each PDO created by the
bus driver, but I am not sure where to attach my filter DO to the bus created
PDO.
Normally, AddDevice() is the place to create my filter DO and attach to the
driver stack, but when the bus PDO is indicated in query device relation, my
AddDevice() will not be called for those PDOs.
I tried to create my filter DO and attach to the driver stack in the
completion routine for bus FDO query device relation. Most of the PnP IRPs
work well, and the upper fucntion driver is loaded as well, but the
underlying bus driver failed with STATUS_INVALID_DEVICE_REQUEST during
handling IRP_MN_START_DEVICE.
I ran out of thoughts for reasons of this failure.
Anyone may shed any light ? Should I attach to bus created PDO in different
place ?
One more specific question, should I call ObReference() for my filter DO
when I created it in the completion routine for the query device relations,
as in the case for regular PDO creaation ?
Thanks
-Gary