views:

217

answers:

2

I need to:
1. Monitor operations on certain drives/paths
2. Prevent read and/or write operations on certain drives/paths
For example:

C://Users
D:

Can this be done using Windows Filesystem Minifilter Drivers ?

I am mostly interested in step 2. In other words can a minifilter cancel a IRP ?

+1  A: 

Yes this is all possible with a filesystem mini filter driver.

For #1 you don't need a mini filter driver you could use a Win32 API like ReadDirectoryChangesW.

For #2 you can not only do that but you can also modify what gets read/written, even of different size.

You can get started here.

Brian R. Bondy
ty. my reasons for using minifilters for 1. is that ReadDirectoryChangesW reports access operations delayed by 1d (xp) or 1h (vista+)
clyfe
A: 

Raymond Chen, who is a long-time Windows developer, addressed a version of this question on his blog - he would recommend using ACLs for preventing operations rather than trying to get code to run to stop it. See his post on this for some thoughts...

Mike Kelly
[professional sollutions](http://www.pgp.com/products/endpoint/index.html) seem to use divers. also setting ACLs on endpoints programmatically is [hard-ish](http://diaryproducts.net/about/operating_systems/windows/disable_usb_sticks), and setting ACLs on, say, USB Disks conditionally by serial number and other factors seems only doable by drivers.
clyfe