IRQL & IRP_MJ_CLEANUP

Hi,

If I understand well this discussion : http://www.osronline.com/showthread.cfm?link=258499,
I can’t do any I/O in this IRP if the current IRQL is >= APC_LEVEL, because FltQueueDeferredIoWorkItem insert the work in a system thread,
and FltDoCompletionProcessingWhenSafe immediately call the SafePostCallBack if the current IRQL is <= APC_LEVEL, or try to post it in a system worker thread if it’s > APC_LEVEL.

Is there a way to safely process IRP_MJ_CLEANUP at PASSIVE_LEVEL without switching in a system thread ?

Do I need to process my I/O in another thread and wait inside the Pre/Post callback for completion before returning CALLBACK_STATUS other than PENDING or MORE_PROCESSING_REQUIRED ?

IRP_MJ_CLEANUP is sent when someone calls ZwClose. ZwClose requires PASSIVE_LEVEL, so you should never see an IRP_MJ_CLEANUP at anything other than PASSIVE_LEVEL.

Simple as it is obvious,

Thank you scott !