views:

91

answers:

1

Within a Thread in IRQL 0 the completion routine, triggered from an IRP, for a WskSendTo call is sometimes in IRQL 2 and sometimes in IRQL 0. This seems mighty strange to me. Does anyone know if this is normal behaviour?

+2  A: 

This is normal behavior.

Completion Routines may be called directly in the call to the routine or from any other context.

See the MSDN for a description of IoCompletion routines.

Christopher
@Christopher: I owe you a beer. Because of this behaviour every context must be allocated in non-paged memory. And as IoAllocateMdl has no flag to achieve this one has to call MmBuildMdlForNonPagedPool afterwards.
Don Johe