IoCancelFileOpen and STATUS_MORE_PROCESSING_REQUIRED

In my create dispatch routine, I do the following:

IoSetCompletionRoutine //pass the event to completion routine
status = IoCallDriver(LowerFs, Irp);
If (status == STATUS_PENDING) {
KeWaitForSingleObject
}

//do further processing and decide to call cancel file open
IoCancelFileOpen(LowerFs, FileObject);
Irp->IoStatus.Status = STATUS_ACCESS_DENIED;
Irp->IoStatus.Information = 0;
IoCompleteRequest(Irp, IO_NO_INCREMENT);
return STATUS_ACCESS_DENIED;

In my create completion routine,
KeSetEvent(&event, IO_NO_INCREMENT, FALSE);
return STATUS_MORE_PROCESSING_REQUIRED;

It seems that if I wait for the create completion to return and do further
processing, the IoCancelFileOpen doesn’t do anything. The user app can still
open the file. What did I do wrong? Thanks for any information!

Regards,
Sin-Lam

> It seems that if I wait for the create completion to return and do further

processing, the IoCancelFileOpen doesn’t do anything. The user app can still
open the file. What did I do wrong? Thanks for any information!

It’s your bug.
Even if IoCancelFileOpen does not do anything, failing CREATE with STATUS_ACCESS_DENIED will do it.

I suspect the IoCancelFileOpen + STATUS_ACCESS_DENIED path is not executed at all due to some bugs in your logic.

Max

Yes, Max you are right. It is my bug. I just solved it this morning, very
tired last night to meet the project deadline. Thank you!

Regards,
Sin-Lam

----- Original Message -----
From: “Maxim S. Shatskih”
To: “File Systems Developers”
Sent: Tuesday, May 14, 2002 8:10 AM
Subject: [ntfsd] Re: IoCancelFileOpen and STATUS_MORE_PROCESSING_REQUIRED

> > It seems that if I wait for the create completion to return and do
further
> > processing, the IoCancelFileOpen doesn’t do anything. The user app can
still
> > open the file. What did I do wrong? Thanks for any information!
>
> It’s your bug.
> Even if IoCancelFileOpen does not do anything, failing CREATE with
STATUS_ACCESS_DENIED will do it.
>
> I suspect the IoCancelFileOpen + STATUS_ACCESS_DENIED path is not executed
at all due to some bugs in your logic.
>
> Max
>
>
>
> —
> You are currently subscribed to ntfsd as: xxxxx@lit.org.sg
> To unsubscribe send a blank email to %%email.unsub%%
>