Assume a driver working with the same logic as the DDK Cancel sample
implements. Suppose that one routine just removed a pending irp from the
queue and then the Cleanup dispatch is called. Because the irp is not in the
queue anymore, Cleanup won't find it and the irp won't be cancelled.
In most cases this won't be a problem, the irp will be completed soon
enough. But in some devices it is possible that the irp can't be completed
for some reason. Then the irp would keep pending, possibly inserted again in
the cancel-safe queue. In extreme cases the irp might be never completed, and
it won't ever be cancelled either.
Am I missing something, or do I need to take special care if irps removed
from the queue might be not possible to complete?