Authoritative Windows API clarification requested: can a VOLUME_NAME_NT root path be reopened by user-mode NtCreateFile?

Ashish Sharma 0 Reputation points
2026-11-18T06:15:16.2933333+00:00

I am seeking an authoritative Windows API contract clarification rather than observed behavior on one machine.

For a user-mode Windows desktop application on a local fixed NTFS or ReFS volume:

CreateFileW opens the filesystem root directory using the canonical Win32 Volume GUID path with its trailing backslash.

GetFinalPathNameByHandleW(FILE_NAME_NORMALIZED | VOLUME_NAME_NT) is called on that held root-directory handle and returns a root-only NT device path such as:

\Device\HarddiskVolumeN

The application places that exact returned UTF-16 string, unchanged, into a UNICODE_STRING.

OBJECT_ATTRIBUTES.RootDirectory = NULL.

User-mode NtCreateFile is then called with:

CreateDisposition = FILE_OPEN

CreateOptions = FILE_OPEN_REPARSE_POINT | FILE_SYNCHRONOUS_IO_NONALERT

DesiredAccess = FILE_TRAVERSE | FILE_READ_ATTRIBUTES | SYNCHRONIZE

ShareAccess = FILE_SHARE_READ

no write/delete access

no backup/restore privilege override.

Primary question

Is passing that unchanged, root-only VOLUME_NAME_NT result as OBJECT_ATTRIBUTES.ObjectName an officially supported way to reopen the same filesystem root directory, rather than the raw volume/device object?

Please classify the answer as one of:

SUPPORTED_AND_DOCUMENTED

SUPPORTED_BUT_NOT_DOCUMENTED

NOT_SUPPORTED

DEPENDENT_ON_ADDITIONAL_CONDITIONS

If additional conditions apply, please identify them.

Please also clarify whether:

a trailing backslash is required, prohibited, or immaterial in the native root ObjectName;

the answer differs between NTFS and ReFS;

FILE_OPEN_REPARSE_POINT preserves opening the filesystem root itself without following a reparse target;

the resulting native root handle is supported as OBJECT_ATTRIBUTES.RootDirectory for later one-component relative NtCreateFile opens.

Secondary question

Does user-mode NtCreateFile officially support an existing filesystem-directory HANDLE returned by CreateFileW as OBJECT_ATTRIBUTES.RootDirectory, rather than a handle obtained by a preceding NtCreateFile call?

Please classify this as:

YES — any valid filesystem-directory handle

YES — with specific conditions

NO — must originate from NtCreateFile

DOCUMENTATION_DOES_NOT_GUARANTEE

The current public documentation establishes that GetFinalPathNameByHandleW(... VOLUME_NAME_NT) returns an NT device-object path, and that NtCreateFile accepts fully qualified native/device-object names, but it does not appear to explicitly close this root-directory composition.

If the published documentation is insufficient, please route or escalate this question to the Windows Filesystem / Object Manager / Windows SDK engineering team.

A community inference, runtime experiment, or external-moderator opinion alone is not sufficient for the contract clarification being requested. An official Learn/SDK reference, Microsoft engineering confirmation, or explicit supported-contract statement would resolve the question.

Windows development | Windows API - Win32
0 comments No comments

2 answers

Sort by: Oldest
  1. AI answer

    2026-11-18T06:16:49.56+00:00

    Primary classification: NOT_SUPPORTED as a published-contract claim. The public API contract does not document that passing the unchanged, root-only VOLUME_NAME_NT result—such as \Device\HarddiskVolumeN—to user-mode NtCreateFile reopens the mounted filesystem’s root directory rather than the volume/device object.

    This classification means the requested use cannot be claimed as officially supported from the published contract. It does not mean that the call must fail or cannot produce a root-directory handle on particular Windows versions.

    Why the composition is not established

    GetFinalPathNameByHandleW(... | VOLUME_NAME_NT) documents its result as an NT device-object path and explicitly says this type of path cannot be used directly by Windows programs as an ordinary path ^1^.

    NtCreateFile separately permits ObjectName to be a fully qualified file specification or the name of a device object. It can open a file, directory, device, or volume, but it does not define a special rule saying that a bare volume-device name denotes the filesystem root ^2^.

    The closest documented distinction is in the Win32 CreateFileW contract:

    • A volume name without the trailing backslash opens the volume.
    • A volume name with the trailing backslash opens the filesystem root.

    That rule is documented for Win32 volume paths processed by CreateFileW, not for a native OBJECT_ATTRIBUTES.ObjectName passed to NtCreateFile ^3^ ^4^.

    Consequently, the public references do not establish that these native names are equivalent:

    \Device\HarddiskVolumeN
    \Device\HarddiskVolumeN\
    

    Requested sub-classifications

    Trailing backslash

    Undocumented for this native operation.

    The published NtCreateFile contract does not say whether the trailing separator is required, prohibited, or immaterial when the name identifies a volume device and the intended target is its filesystem root. The documented Win32 rule must not be projected onto native parsing without an explicit contract.

    Therefore, neither adding nor removing the slash converts this technique into a documented native-root reopening procedure.

    NTFS versus ReFS

    No documented distinction resolves the issue.

    The GetFinalPathNameByHandleW documentation lists ReFS support, but that only establishes support for retrieving the final path. It does not establish how a root-only NT device path is subsequently interpreted by NtCreateFile ^1^.

    No supplied public contract provides separate NTFS and ReFS guarantees for this composition.

    FILE_OPEN_REPARSE_POINT

    Conditionally documented, but it does not settle the root-versus-volume question.

    When the file being opened is itself a reparse point, FILE_OPEN_REPARSE_POINT bypasses normal processing and attempts to open that reparse-point file directly ^2^. It does not document that a bare volume-device name is transformed into, or guaranteed to designate, the mounted filesystem root.

    Also note that the documented compatibility list for FILE_DIRECTORY_FILE does not include FILE_OPEN_REPARSE_POINT. Therefore, adding FILE_DIRECTORY_FILE to force directory type would not make the proposed combination documented ^2^. A closely related Microsoft Q&A answer likewise concludes that the public compatibility list does not establish that exact directory-option combination as supported ^5^.

    Using the resulting handle for relative opens

    Supported only if the first call actually returned a filesystem-directory handle; that prerequisite is not guaranteed by this bootstrap.

    OBJECT_ATTRIBUTES documents that a non-null RootDirectory can refer to a filesystem directory and that ObjectName is then interpreted relative to it ^6^. The WDK description similarly supports a pathname relative to the directory file represented by RootDirectory ^7^.

    Those rules do not establish that the proposed root-only device-name call produced such a directory handle. If it produced a volume/device handle instead, the relative-directory contract would not apply.

    Secondary question

    Classification: DOCUMENTATION_DOES_NOT_GUARANTEE.

    The general OBJECT_ATTRIBUTES page says that RootDirectory can refer to a filesystem directory and does not impose handle-provenance requirements ^6^. However, the user-mode NtCreateFile reference more specifically describes RootDirectory as a directory handle “obtained by a preceding call to NtCreateFile” ^2^.

    Because the specific API reference does not promise that a directory handle returned by CreateFileW is interchangeable for this purpose, the public contract cannot sustain either:

    • YES — any valid filesystem-directory handle, or
    • NO — must originate from NtCreateFile.

    Observed interoperability does not close that documentary gap.

    Contract-safe alternatives and escalation

    For a published Win32 contract, retain or duplicate the filesystem-root handle originally opened with the trailing-backslash Volume GUID path instead of reconstructing it from VOLUME_NAME_NT. CreateFileW explicitly documents that the trailing-backslash volume path opens the filesystem root ^3^.

    For an authoritative ruling on native reopening and Win32 handle provenance, open a Microsoft support incident and request escalation to Windows Filesystems / I/O Manager / Object Manager / Windows SDK documentation. Include:

    1. A minimal reproducer with the exact UNICODE_STRING, access mask, sharing, disposition, and options.
    2. NTFS and ReFS cases.
    3. The requested classifications.
    4. A request for a supported-contract statement rather than runtime diagnosis.

    Microsoft’s public Windows developer guidance identifies a support incident as the route for organizations with a support contract ^8^. Documentation feedback can additionally request that the NtCreateFile and GetFinalPathNameByHandleW contracts explicitly cover this composition, but feedback alone is not an engineering support determination.


    References

    1. GetFinalPathNameByHandleW function (fileapi.h)
    2. NtCreateFile function (winternl.h)
    3. CreateFileW function (fileapi.h)
    4. Naming a Volume
    5. NTFS single-component NtCreateFile relative to a held directory during junction conversion: original-object-or-refusal contract? - Microsoft Q&A
    6. OBJECT_ATTRIBUTES structure (ntdef.h)
    7. NtCreateFile function (ntifs.h)
    8. Help and guidance for Windows developers
    AI-generated content may be incorrect. Read our transparency notes for more information.

    Was this answer helpful?

  2. Nguyen Dam (WICLOUD CORPORATION) 1,580 Reputation points Microsoft External Staff Moderator
    2026-11-18T08:12:03.2+00:00

    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: 

    1. 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. 
    2. 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. 
    3. 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. 
    4. 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: 

    1. The documentation does not establish whether adding or omitting a trailing backslash guarantees the intended filesystem-root interpretation in this specific scenario. 
    2. The referenced documentation does not establish a different guarantee for this exact operation on NTFS versus ReFS. 
    3. As noted above, FILE_OPEN_REPARSE_POINT does not by itself guarantee that the resulting handle represents the filesystem root directory. 
    4. NtCreateFile supports relative object names using a directory handle supplied through OBJECT_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. 

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.