I’ve got questions on IO reference counting again. So, as far as I
understood from a hint by Jamey Kirby, I can just increment (with
ObReferenceObject) my own device reference counter and target device counter
before sending a request to the underlying FSD and decrement it
(ObDereferenceObject) on request’s way back. In such case if I call
IoDeleteDevice in my FastIoDetachDevice routine it will not delete device as
far as reference counter is not 0. As soon as I call last
ObDereferenceObject on device object and it’s reference counter goes to 0
the device object will be deleted. Am I right?
-htfv