FileObjects with OPEN_TARGET_DIRECTORY flag

If a file/dir is opened with the OPEN_TARGET_DIRECTORY flag, the resulting
FileObject represents the parent directory. My question is, can any
normal file system operations be performed on this FileObject (at least
any that are legal for the opened directory)? A quick pass through the
FAT code doesn’t indicate anything to prevent this.
From a more practical standpoint (abusive behavior aside) would a filter
expect to see anything other than rename operations that would reference
this FileObject? Thanks for any insights.

Pretty sure I’ve seen this flag specified for opens
that have nothing to do with renames.

Randy

xxxxx@the1vision.com wrote:

If a file/dir is opened with the
OPEN_TARGET_DIRECTORY flag, the resulting
FileObject represents the parent directory. My
question is, can any
normal file system operations be performed on this
FileObject (at least
any that are legal for the opened directory)? A
quick pass through the
FAT code doesn’t indicate anything to prevent this.
From a more practical standpoint (abusive behavior
aside) would a filter
expect to see anything other than rename operations
that would reference
this FileObject? Thanks for any insights.


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

You are currently subscribed to ntfsd as:
xxxxx@yahoo.com
To unsubscribe send a blank email to
xxxxx@lists.osr.com


Do you Yahoo!?
New Yahoo! Photos - easier uploading and sharing.
http://photos.yahoo.com/

During a Rename sequence (i.e., the entire sequence of IRPs that perform a
Rename), I’ve seen the SL_OPEN_TARGET_DIRECTORY flag used in a Create IRP to
open a file under it’s “new” name *before* the Rename request itself has
taken place. If the Create is successful, and if the dispostion (in
IoStatus.Information) is FILE_DOES_NOT_EXIST, then the caller *knows* that
the new name is free to use – and then it goes ahead and does the Rename.

The file object that is opened (successfully) with a disposition of “does
not exist” is then just closed by the caller, and thank you very much. I
haven’t seen it used for any other purpose. Yeah, the logic of this kind of
Create request is a bit strange – “yes, we have no bananas” – but that’s
NT.

  • Dale.

-----Original Message-----
From: xxxxx@the1vision.com [mailto:xxxxx@the1vision.com]
Sent: Friday, December 19, 2003 6:47 AM
To: Windows File Systems Devs Interest List
Subject: [ntfsd] FileObjects with OPEN_TARGET_DIRECTORY flag

If a file/dir is opened with the OPEN_TARGET_DIRECTORY flag, the resulting
FileObject represents the parent directory. My question is, can any
normal file system operations be performed on this FileObject (at least
any that are legal for the opened directory)? A quick pass through the
FAT code doesn’t indicate anything to prevent this.
From a more practical standpoint (abusive behavior aside) would a filter
expect to see anything other than rename operations that would reference
this FileObject? Thanks for any insights.


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

You are currently subscribed to ntfsd as: xxxxx@veritas.com
To unsubscribe send a blank email to xxxxx@lists.osr.com