Hello @Ashish Sharma , and thank you for reaching out.
While the available public documentation does not establish the guarantee you are requesting, I would still like to share the relevant documented behavior and clarify what can be determined from it:
- GetFinalPathNameByHandleW supports VOLUME_NAME_NT, which returns a path using the NT device namespace. The documentation also notes that this type of path cannot be used directly by Windows programs as an ordinary path.
- NtCreateFile accepts a fully qualified file specification or the name of a device object, and it can open an existing file, device, directory, or volume using FILE_OPEN.
- FILE_OPEN_REPARSE_POINT only changes how a reparse point is handled if the object being opened has one. It does not determine whether the name refers to the filesystem root directory or the volume device.
- FILE_DIRECTORY_FILE requires the opened object to be a directory. However, the documented list of options compatible with FILE_DIRECTORY_FILE does not include FILE_OPEN_REPARSE_POINT, so adding it to your parameters would not make this combination documented.
Even though the individual APIs support the documented operations described above, the available documentation does not establish that passing the unchanged, root-only VOLUME_NAME_NT result to NtCreateFile with your specified parameters necessarily reopens the same filesystem root directory rather than the volume device.
Regarding your additional questions:
- The documentation does not establish whether adding or omitting a trailing backslash guarantees the intended filesystem-root interpretation in this specific scenario.
- The referenced documentation does not establish a different guarantee for this exact operation on NTFS versus ReFS.
- As noted above, FILE_OPEN_REPARSE_POINT does not by itself guarantee that the resulting handle represents the filesystem root directory.
-
NtCreateFilesupports relative object names using a directory handle supplied throughOBJECT_ATTRIBUTES.RootDirectory. However, using the handle obtained through the proposed operation depends on whether that handle actually represents the intended directory.
For your secondary question, the general OBJECT_ATTRIBUTES documentation describes RootDirectory as a handle to a directory and does not state any requirement about how that handle was obtained. However, the user-mode NtCreateFile reference describes RootDirectory as a handle to a directory obtained by a preceding call to NtCreateFile. The public documentation therefore does not explicitly guarantee that a directory handle returned by CreateFileW is interchangeable for this purpose, nor does it explicitly prohibit it.
In summary, the documented APIs provide mechanisms for opening filesystem objects and performing directory-relative operations. However, the specific guarantee you are requesting concerning the interpretation of the unchanged root-only NT device path is not established by the referenced documentation.
Regarding your request for escalation to the Windows engineering team, I understand the need for further clarification. However, I don't have the necessary access or tools to initiate that escalation directly.
Since your question specifically requires an authoritative determination of this behavior, I recommend reviewing the available options through Windows Developer Support. If your organization has an applicable Microsoft support agreement, you may also submit a request through the Microsoft Engage Center. These channels can help determine whether further clarification from the appropriate Windows engineering team is available.
If you found my response helpful or informative, I would greatly appreciate it if you could follow this guide for your confirmation. Thank you.