Cancelling file open

During completion of create worker thread, I cancel file open using
IoCancelFileOpen and set ACCESS_DENIED in irp status and set zero for
information. I can see that ACCESS_DENIED while copying files thro’
explorer. But it ends up ZERO length file copied. Is there anything else
should I do.

I would appreciate your help.
Thanks
Ramaraj

“Ramaraj Pandian” wrote in message
news:xxxxx@ntfsd…
>
> During completion of create worker thread, I cancel file open using
> IoCancelFileOpen and set ACCESS_DENIED in irp status and set zero for
> information. I can see that ACCESS_DENIED while copying files thro’
> explorer. But it ends up ZERO length file copied. Is there anything else
> should I do.
>

IoCancelFileOpen will tell IoManager that open was unsuccessful and error
code will be propagated back to application.
But file system got IRP_MJ_CREATE and already processed it. If this create
request produces soem side effects you will see them.
If Disposition is FILE_CREATE new file will be created by file system. It is
probably your case.
IoCancelFileOpen is acually usefull only if disposition is FILE_OPEN or if
disposition is FILE_OPEN_IF and file was actually opened, not new file
created.
You need to use IoCancelFileOpen only if decision whether to fail request
depends on contents of the file or some other properties that you can get
only if file is opened.
If you want to prevent creation of new files - just complete IRP without
sending it down to the file system.

Alexei.

Thanks Alexei for clearing out.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of Alexei Jelvis
Sent: Tuesday, April 29, 2003 8:16 PM
To: File Systems Developers
Subject: [ntfsd] Re: Cancelling file open

“Ramaraj Pandian” wrote in message
news:xxxxx@ntfsd…
>
> During completion of create worker thread, I cancel file open using
> IoCancelFileOpen and set ACCESS_DENIED in irp status and set zero for
> information. I can see that ACCESS_DENIED while copying files thro’
> explorer. But it ends up ZERO length file copied. Is there anything else
> should I do.
>

IoCancelFileOpen will tell IoManager that open was unsuccessful and error
code will be propagated back to application.
But file system got IRP_MJ_CREATE and already processed it. If this create
request produces soem side effects you will see them.
If Disposition is FILE_CREATE new file will be created by file system. It is
probably your case.
IoCancelFileOpen is acually usefull only if disposition is FILE_OPEN or if
disposition is FILE_OPEN_IF and file was actually opened, not new file
created.
You need to use IoCancelFileOpen only if decision whether to fail request
depends on contents of the file or some other properties that you can get
only if file is opened.
If you want to prevent creation of new files - just complete IRP without
sending it down to the file system.

Alexei.


You are currently subscribed to ntfsd as: xxxxx@vormetric.com
To unsubscribe send a blank email to xxxxx@lists.osr.com