Hello Ted,
A very good help, but I can’t find where to get “createDisposition”
value?
Other fields are found in stack location, but I can’t find this
field
–
Best regards,
Ðîìàí mailto:xxxxx@rbcmail.ru
Friday, July 16, 2004, 11:09:24 PM, you wrote:
TH> Hope the follow snippet helps shed some light on what you asked. You may not
TH> care about attribute modification vs. data modification in your application.
TH> The tricky ones are the truncation, supersede modes.
TH> /ted
TH> In preCREATE for any type of data/attribute modification:
TH> writeOperation = ((desiredAccess & (FILE_WRITE_DATA | //
TH> 0x0002
TH> FILE_WRITE_ATTRIBUTES |
TH> // 0x0100
TH> FILE_WRITE_EA |
TH> // 0x0010
TH> FILE_APPEND_DATA |
TH> // 0x0004
TH> DELETE |
TH> // 0x00010000
TH> WRITE_DAC |
TH> // 0x00040000
TH> WRITE_OWNER)) ||
TH> // 0x00080000
TH> (createDisposition != FILE_OPEN) || //
TH> Modes 0 & 2-5
TH> (createOptions & FILE_DELETE_ON_CLOSE)); //
TH> 0x00001000
TH> In postCreate check for the special case of FILE_OPEN_IF with no write
TH> access which creates a new file:
TH> if ((createDisposition == FILE_OPEN_IF) &&
TH> ((desiredAccess & (FILE_WRITE_DATA | FILE_WRITE_ATTRIBUTES |
TH> FILE_WRITE_EA |
TH> FILE_APPEND_DATA | DELETE | WRITE_DAC |
TH> WRITE_OWNER)) == 0) &&
TH> (Irp->IoStatus.Information != FILE_CREATED))
TH> {
TH> // Just a plain open of an existing file with no write access
TH> requested
TH> // Reset status set in PreCreate
TH> }
TH> And… Then there is SFM (Services For Macintosh) which diddles file
TH> attributes on RO FileObjects (sigh!)
TH> -----Original Message-----
TH> From: AFei [mailto:xxxxx@hotmail.com]
TH> Sent: Friday, July 16, 2004 2:37 PM
TH> To: Windows File Systems Devs Interest List
TH> Subject: [ntfsd] how to know “Open for write”?
TH> Hi,
TH> In a filesystem filter driver, is there a way to know the file was opened
TH> for write in IRP_MJ_CREATE? (mapping from GENERIC_WRITE flag).
TH> thx.
TH> AFei
TH> —
TH> Questions? First check the IFS FAQ at
TH> https://www.osronline.com/article.cfm?id=17
TH> You are currently subscribed to ntfsd as: xxxxx@livevault.com To unsubscribe
TH> send a blank email to xxxxx@lists.osr.com
TH> —
TH> Questions? First check the IFS FAQ at
TH> https://www.osronline.com/article.cfm?id=17
TH> You are currently subscribed to ntfsd as: xxxxx@rbcmail.ru
TH> To unsubscribe send a blank email to
TH> xxxxx@lists.osr.com