If your intent is to fail the create based on file name, it would be much
better to do it in create dispatch, not in create completion. There are
good reasons to avoid IoCancelFileOpen unless there is no other way to
achieve your ends. See the archives of this list for details.
You cannot access FileObject->FileName in create completion. The ONLY time
this is guaranteed to be valid is in create dispatch.
You cannot blindly use FileObject->FileName, even in create
dispatch. There may be a related file object which describes the leading
portion of the name. FileObject->RelatedFileObject, again, is valid only
in create dispatch. and FileObject->RelatedFileObject->FileName cannot be
used. You must query the file system for the related name.
You should consider basing the case sensitivity of your filename comparison
on the case sensitivity of the create you have received. There is a
potential for your current comparison to match many distinct files.
At 02:50 PM 6/17/2005 +0530, you wrote:
Im cancellling the IRP_MJ_CREATE for a file (\Document.txt) in
postoperation in my filter driver. This is how im doing it
if(RtlCompareUnicodeString(&(pIrpSp->FileObject->FileName),&usConstName,TRUE
) == 0)
{
IoCancelFileOpen(devExt->NLExtHeader.AttachedToDeviceObject,pIrpSp->FileObje
ct);
Irp->IoStatus.Status = STATUS_ACCESS_DENIED;
Irp->IoStatus.Information = 0;
}
when im trying to open that file in wordpad im getting following msg: “An
unknown error occurred while accessing e:\document.txt” instead of: “Access
to e:\Document.txt was denied”.
What do u think is the problem? Is there anything im missing ?
Regards,
VC
Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17
You are currently subscribed to ntfsd as: xxxxx@privtek.com
To unsubscribe send a blank email to xxxxx@lists.osr.com