IoCancelFileOpen

Is it safe to call IoCancelFileOpen in IRP_MJ_CREATE completion routine? I’m
asking because some upper level filter driver has not got control after
IRP_MJ_CREATE is complete. Is there a way to complete the request from
completion routine (for example by calling IoCompleteRequest and returning
STATUS_MORE_PROCESSING_REQUIRED)? Is there any other ways I can safely
cancel the create request?

-htfv

IoCancelFileOpen is only to be called during your CREATE completion
processing, but it is not safe to call at DPC. Therefore, if your
CREATE completion routine is called when IRQL >= DPC_LEVEL, you need to
do your completion processing in a worker thread or synchronize back to
your CREATE dispatch to get back to PASSIVE_LEVEL to be able to call
IoCancelFileOpen. In this case you return
STATUS_MORE_PROCESSING_REQUIRED from your CREATE completion routine.

When you are canceling an open in your filter, the filter is responsible
for calling IoCancelFileOpen to undo the success create with the file
system, fail the CREATE operation with an appropriate status and
continuing completion processing. If you are in your CREATE completion
routine, after callingIoCancelFileOpen you set the error status in the
Irp->IoStatus block, then return STATUS_SUCCESS. The IO manager will
then continue completion processing. If you have posted the CREATE
completion work to a worker thread or synchronized back to your CREATE
dispatch routine, you need to call IoCompleteRequest to initiate
completion processing again.

Molly Brown
Microsoft Corporation

This posting is provided “AS IS” with no implied warranties and confers
no rights.

-----Original Message-----
From: Alexey Logachyov [mailto:xxxxx@vba.com.by]
Sent: Thursday, September 12, 2002 2:13 AM
To: File Systems Developers
Subject: [ntfsd] IoCancelFileOpen

Is it safe to call IoCancelFileOpen in IRP_MJ_CREATE completion routine?
I’m asking because some upper level filter driver has not got control
after IRP_MJ_CREATE is complete. Is there a way to complete the request
from completion routine (for example by calling IoCompleteRequest and
returning STATUS_MORE_PROCESSING_REQUIRED)? Is there any other ways I
can safely cancel the create request?

-htfv


You are currently subscribed to ntfsd as: xxxxx@windows.microsoft.com
To unsubscribe send a blank email to %%email.unsub%%