RE: OPEN_BY_FILE_ID (was Re: Best Method to get FullPathN- ame)

Curt,

An “open by ID” is always a relative open. The file name must either be 8
bytes (a 64 bit file ID) or 16 bytes (a 128 bit object ID). The related
file object only indicates the VOLUME on which the file is located and may
have nothing to do with the file being opened.

Open by ID is a rather interesting side-case. It does happen, but not very
often since there’s no simple Win32 mechanism for doing this. Best thing to
do is write a test program (since you have to use the native API and you
shouldn’t use that in anything EXCEPT a test program.) Open a file by name,
retrieve its file ID. Then, open a directory (oh, like the root directory.)
Using the directory handle, open the file by ID, specifying the ID as the
file name and indicating that this is the FILE_OPEN_BY_FILE_ID case.

Regards,

Tony

Tony Mason
Consulting Partner
OSR Open Systems Resources, Inc.
http://www.osr.com http:

-----Original Message-----
From: xxxxx@omnishift.com [mailto:xxxxx@omnishift.com]
Sent: Monday, April 30, 2001 2:34 PM
To: File Systems Developers
Subject: [ntfsd] OPEN_BY_FILE_ID (was Re: Best Method to get FullPathName)

Hi Tony:

This is off topic, but I’ve never seen the answer to this: If a Create
request comes in with Parameters.Create.Options having the
FILE_OPEN_BY_FILE_ID bit set, where will the ID be found? In the
FileObject’s FileName, by chance? Or somewhere else? Fat doesn’t implement
this Create option (though, strangely, they implement querying for internal
information).

One reason I haven’t implemented the FileInternalInformation query in my FSD
is that I don’t know how to find the file id coming back to me in a Create!

Thanks,
Curt

> -----Original Message-----
> From: Tony Mason [mailto:xxxxx@osr.com mailto:xxxxx]
> Sent: Monday, April 30, 2001 10:44 AM
> To: File Systems Developers
> Subject: [ntfsd] Re: Best Method to get FullPathName
>
>
> Jamey,
>
> In most cases this mechanism will work. However, if the file
> is “opened by
> ID” and the caller does not have traverse privilege, this
> call will fail
> when made to the NTFS file system. There is essentially no
> way to guarantee
> that you can extract the name of an arbitrary file,
> unfortunately. Yes,
> this technique works MOST of the time, but anyone using this
> routine needs
> to be prepared for it to fail (this code works if there is a
> failure, but
> callers must also be able to handle this problem as well!)
>
> Regards,
>
> Tony Mason
> Consulting Partner
> OSR Open Systems Resources, Inc.
> http://www.osr.com http:


You are currently subscribed to ntfsd as: xxxxx@osr.com
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntfsd as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com</http:></mailto:xxxxx></http:>