Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

STATUS_ACCESS_DENIED causes file deletion (minifilter driver)

76 views
Skip to first unread message

Eugene

unread,
Dec 23, 2009, 10:47:02 AM12/23/09
to
Hi,
I’m developing filesystem minifilter driver to control access to files. In
some cases I need to prevent write access to file. To do so I return
STATUS_ACCESS_DENIED from the preoperation callback routine as follows:

Data->IoStatus.Status = STATUS_ACCESS_DENIED;
Data->IoStatus.Information = 0;
return FLT_PREOP_COMPLETE;

Unfortunately, as stated in the comment to WDK scanner minifilter sample,
"The effect of getting ERROR_ACCESS_DENIED for many apps to delete the file
they are trying to write usually". For instance, the file opened in the Far
manager internal editor will be deleted after an attempt to save changes if
the minifilter returns STATUS_ACCESS_DENIED.

Is there any way to prevent write access without deleting the file?
Thanks, Eugene

Maxim S. Shatskih

unread,
Dec 23, 2009, 1:12:34 PM12/23/09
to
> Is there any way to prevent write access without deleting the file?

Surely, fail create with write bits in DesiredAccess, do not fail writes.

--
Maxim S. Shatskih
Windows DDK MVP
ma...@storagecraft.com
http://www.storagecraft.com

Eugene

unread,
Dec 24, 2009, 4:49:01 AM12/24/09
to
> Surely, fail create with write bits in DesiredAccess, do not fail writes.
>

Thanks, Maxim!
It works well.
Eugene

0 new messages