And for extra credit...

I always enjoy twisting people’s heads with this completion routine:

MyCompletionRoutine(…)

{

if (Irp->PendingReturned) IoMarkIrpPending(Irp); // assumes
return IoCallDriver from dispatch.

IoCompleteRequest(Irp, IO_NO_INCREMENT);

return STATUS_MORE_PROCESSING_REQUIRED;

}

This one often seems to confuse people, but does work (and gives interesting
insight into the whole POINT of the IRP and I/O completion model).

Hint: there is a relationship between recursion and iteration, and one can
be transformed to the other.

Regards,

Tony

Tony Mason

Consulting Partner

OSR Open Systems Resources, Inc.

http://www.osr.com http:</http:>