I am writing a bus filter and I would like to call functions like:
IoGetDeviceProperty, IoQueryDevicePnpState and IoRequestDeviceEject
on pdo's that my filter sees in IRP_MN_QUERY_DEVICE_RELATIONS queries that
are sent to the bus I'm filtering.
The problem is that I attach to the bus long after it is started and I can't
know if this is the first time that the pdo is reported or if it was reported
a long time ago and maybe even started already.
Calling any of the functions I mentioned on a PDO that was not reported to
the pnp manager yet will generate a bugcheck.
My questions is: How can I know if the pnp manager already knows about the
PDO ? when exactly is it alright to call those functions with the pdo ?
I will also be very glad if someone can explain why do those functions
bugcheck when using an uninitialized pdo instead of just returning with a