Hi
Lets say I'm in PASSIVE IRQL in a dispatch function.
I mark my irp as pending. Later, I create a workitem that receives the
irp as a context and do some work in it. In the end of the workitem's
function, I complete the IRP.
Back to the dispatch routine - after allocating and queuing the
workitem, I return STATUS_PENDING.
Now, because I'm in PASSIVE level, there can be a context switch from
my dispatch routine to my workitem's function, so it will run and
complete the irp, before I return STATUS_PENDING from the dispatch
routine. (it means that when I return STATUS_PENDING, the irp is
already completed!)
Is there a problem with the above scenario? And if so, how should I
handle it?