Deny write operation

You cannot do this at this point, you need to deny the create itself. The
bottom line is by the time you try to deny a write at the write operation it
is way too late, the data may be in cache other programs may be reading the
update data, etc.

This has been answered many times on this list, I suggest you check the
archives.


Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
http://www.windrvr.com
Remove StopSpam from the email to reply

“ganesh pashupathi” wrote in message
news:xxxxx@ntfsd…
Hi,

I want to deny write operation on a particular file. In my prewrite
operation callback I return STATUS_ACCESS_DENIED for the file. But in case
of some applications like wordpad editor the file size is set to 0 in the
create path itself as a result of which the previously saved contents are
destroyed.

~ganesh

Fail MJ_CREATE with “write” bit in DesiredAccess, not MJ_WRITE. Otherwise,
you will see “Lost Delayed Write Data” popups.

Also it is a good idea to filter the file attributes query and force “read
only” bit there, and also filter the set file attributes path and fail any
attempts to remove the “read only” bit.

Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

----- Original Message -----
From: “ganesh pashupathi”
To: “Windows File Systems Devs Interest List”
Sent: Thursday, September 14, 2006 7:56 PM
Subject: [ntfsd] Deny write operation

Hi,

I want to deny write operation on a particular file. In my prewrite
operation callback I return STATUS_ACCESS_DENIED for the file. But in case of
some applications like wordpad editor the file size is set to 0 in the create
path itself as a result of which the previously saved contents are destroyed.

~ganesh

Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17

You are currently subscribed to ntfsd as: unknown lmsubst tag argument: ‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com

To deny write operations on a file you should DENY opens for any type
of write access on that file.

Semantically access checks should always be done during open.

vik


From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of ganesh
pashupathi
Sent: Thursday, September 14, 2006 8:57 AM
To: Windows File Systems Devs Interest List
Subject: [ntfsd] Deny write operation

Hi,

I want to deny write operation on a particular file. In my prewrite
operation callback I return STATUS_ACCESS_DENIED for the file. But in
case of some applications like wordpad editor the file size is set to 0
in the create path itself as a result of which the previously saved
contents are destroyed.

~ganesh

http:ignature-home.htm/xxxxx@Middle5?PARTNER=3> — Questions? First
check the IFS FAQ at https://www.osronline.com/article.cfm?id=17 You are
currently subscribed to ntfsd as: unknown lmsubst tag argument: ‘’ To
unsubscribe send a blank email to xxxxx@lists.osr.com</http:>