Hi everyone
I'm writing a filter driver for a device, which I install a completion
routine so that I could do extra processing after the IRP has been processed
by the lower driver.
AFAIK, I've got two options for my CompletionRoutine
1. Do whatever I need to do inside the CompletionRoutine, then return with
STATUS_SUCCESS.
2. Queue a work item, which will later call IoCompleteReturn, and then
return STATUS_MORE_PROCESSING_REQUIRED.
I've tried successfully with method 1 (which is simpler). However, I'm not
sure if that's safe, since sometime my processing could take up 1-2 seconds
to do. Could anyone tell in which case should i use the 1st method, and
which case should I use the 2nd one? And the IRP being processed inside my
CompletionRoutine will never be canceled by anyone, right?
Another question, assuming that the lower driver completes the IRPs in its
work queue (PASSIVE_LEVEL) most of the time, am I safe to say that my
CompletionRoutine would be called in PASSIVE_LEVEL most of the time too, or
is it system dependent?
Thanks for your help
Hai.