What Windows pops up is Windows’ perogative, your “interface” to it is
how you complete the IRP. Generally speaking, if you complete it
unsuccessfully, windows is probably going to try to tell the user
something informative as to why. Otherwise how does the user know what
to do when things don’t work.
That said, from what you’ve described, you probably don’t want to try to
return STATUS_ACCESS_DENIED and restart the app that made the request
originally. Instead, you might look into notifying you user mode
service that it needs to do some work, queueing the IRP, and pending the
IRP by returning FLT_POSTOP_MORE_PROCESSING_REQUIRED. Then your
userland service does whatever, messages back the minifilter, and the
minifilter then dequeues the IRP and completes it appropriately. I
believe that’s more or less what the scanner sample does, though I
haven’t looked at it recently.
~Eric
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of
xxxxx@redbeardweb.com
Sent: Friday, April 11, 2008 4:01 PM
To: Windows File Systems Devs Interest List
Subject: [ntfsd] Silent return of STATUS_ACCESS_DENIED?
Is it possible to deny access to a file in the post create of a
IRP_MJ_CREATE without alerting the user? After some logic, I have the
following:
FltCancelFileOpen( FltObjects->Instance, FltObjects->FileObject
);
Data->IoStatus.Status = STATUS_ACCESS_DENIED;
Data->IoStatus.Information = 0;
returnStatus = FLT_POSTOP_FINISHED_PROCESSING;
This works as expected. Access to the file is denied but, it shows a
message box with the requested filename and path in the title and the
message “Windows cannot access the specified device, path, or file. You
may not have the appropriate permissions to access this item”. I want
to silently deny access and then have my user mode application do some
authentication/authorization and relaunch the application on success.
NTFSD is sponsored by OSR
For our schedule debugging and file system seminars (including our new
fs mini-filter seminar) visit:
http://www.osr.com/seminars
You are currently subscribed to ntfsd as: xxxxx@edsiohio.com To
unsubscribe send a blank email to xxxxx@lists.osr.com