NtCreateFile + OBJ_DONT_REPARSE: User-Mode Support and Leaf Reparse Point Handling

soner peker 0 Reputation points
2026-11-17T11:50:51.5+00:00

NtCreateFile: Is OBJ_DONT_REPARSE supported for user-mode, handle-relative directory opens, including the final path component?

We are evaluating a security-sensitive Windows directory traversal design and need clarification of the documented contract for NtCreateFile and OBJ_DONT_REPARSE.

This is a documentation and API-behavior question, not a request for a workaround that silently follows reparse points.

1. Documentation discrepancy

The Microsoft documentation for NtCreateFile (winternl.h) describes OBJECT_ATTRIBUTES.Attributes as accepting zero or OBJ_CASE_INSENSITIVE.

However, the OBJECT_ATTRIBUTES (ntdef.h) documentation defines OBJ_DONT_REPARSE, describing its behavior when a reparse point is encountered during name parsing.

The ZwCreateFile (wdm.h) documentation also describes directory-relative opening and normal reparse processing.

We would like to clarify how these documented behaviors apply together to user-mode NtCreateFile.

2. Exact intended call configuration

The proposed operation uses:

API: user-mode NtCreateFile

ObjectAttributes.RootDirectory: a valid, previously opened filesystem-directory handle

ObjectAttributes.ObjectName: exactly one relative child-directory name, without path separators or parent traversal components

ObjectAttributes.Attributes: OBJ_DONT_REPARSE, optionally combined with OBJ_CASE_INSENSITIVE

CreateOptions: FILE_DIRECTORY_FILE

CreateDisposition: FILE_OPEN

FILE_OPEN_REPARSE_POINT: not specified

The objective is to open an existing child directory relative to its parent handle, without following a symbolic link, junction, mount point, or other reparse redirection.

3. Questions requiring authoritative clarification

Q1 — Attribute admissibility

Is OBJ_DONT_REPARSE a documented and supported value for OBJECT_ATTRIBUTES.Attributes in user-mode NtCreateFile?

Is the zero/OBJ_CASE_INSENSITIVE description in the NtCreateFile documentation an exhaustive restriction, or does the general OBJECT_ATTRIBUTES documentation also apply?

Q2 — Final-component behavior

For the exact call configuration above, if the named child directory itself is a symbolic link, junction, mount point, or another reparse point, is OBJ_DONT_REPARSE guaranteed to prevent redirection?

In particular, does this guarantee apply when the relative ObjectName consists of only one component, making that child the final (leaf) component of the lookup?

Q3 — Interaction with normal reparse processing

The NtCreateFile documentation states that normal reparse processing occurs when FILE_OPEN_REPARSE_POINT is not specified.

Does OBJ_DONT_REPARSE override or otherwise prevent that processing in this exact configuration?

We are not proposing to add FILE_OPEN_REPARSE_POINT, because its compatibility with FILE_DIRECTORY_FILE and its security semantics require separate consideration.

Q4 — Result and applicability

If a reparse point is encountered, is STATUS_REPARSE_POINT_ENCOUNTERED the guaranteed failure status for this configuration?

Are there documented exceptions, alternative completion statuses, Windows version requirements, filesystem restrictions, or differences between user-mode and kernel-mode callers?

4. Requested form of answer

We would appreciate a reference to an authoritative Microsoft API contract, specification, or documentation passage addressing these questions.

If the exact combination is not supported or its behavior is not guaranteed, confirmation of that limitation would also be valuable.

We are specifically trying to avoid relying on undocumented behavior, third-party implementation observations, or runtime success alone as evidence of a supported security guarantee.

Thank you.

Windows development | Windows API - Win32
0 comments No comments

2 answers

Sort by: Oldest
  1. AI answer

    2026-11-17T11:51:22.4866667+00:00

    The published documentation does not provide a complete supported contract for that exact combination.

    OBJ_DONT_REPARSE is documented on OBJECT_ATTRIBUTES as a general object-attribute flag that prevents following reparse points during name parsing, but the NtCreateFile parameter page says OBJECT_ATTRIBUTES.Attributes “can be zero or OBJ_CASE_INSENSITIVE.” In the available public documentation, that leaves a documentation mismatch rather than an explicit NtCreateFile contract that fully lists OBJ_DONT_REPARSE for user-mode callers.

    For user-mode NtCreateFile with:

    • a non-NULL RootDirectory
    • a single relative child name
    • OBJ_DONT_REPARSE in OBJECT_ATTRIBUTES.Attributes
    • FILE_DIRECTORY_FILE
    • FILE_OPEN
    • no FILE_OPEN_REPARSE_POINT

    the public documentation available here does not expressly state all of the following as a supported guarantee:

    • that OBJ_DONT_REPARSE is supported for this exact user-mode, handle-relative directory-open shape
    • that it applies identically to a one-component relative name
    • that it blocks redirection when the final named child itself is the reparse point
    • that it overrides the normal reparse processing described for opens that do not specify FILE_OPEN_REPARSE_POINT
    • that STATUS_REPARSE_POINT_ENCOUNTERED is the guaranteed failure status for this exact configuration across supported Windows versions and file systems

    What is documented:

    • NtCreateFile supports relative naming through RootDirectory; if RootDirectory is non-NULL, ObjectName is interpreted relative to that directory handle.
    • If FILE_OPEN_REPARSE_POINT is specified and a file with a reparse point is opened, normal reparse processing does not occur and NtCreateFile attempts to directly open the reparse-point file.
    • If FILE_OPEN_REPARSE_POINT is not specified, normal reparse-point processing occurs.
    • Reparse-point support depends on the file system. NTFS and ReFS support reparse points; FAT does not.

    What is not established by the available public documentation:

    • an explicit statement that OBJ_DONT_REPARSE is supported by user-mode NtCreateFile for handle-relative opens
    • an explicit statement that the final path component is covered in this exact NtCreateFile scenario
    • an explicit precedence rule between OBJ_DONT_REPARSE and the documented normal reparse processing when FILE_OPEN_REPARSE_POINT is absent
    • a documented, version-qualified guarantee that the failure status is STATUS_REPARSE_POINT_ENCOUNTERED
    • documented user-mode versus kernel-mode differences for this exact combination

    A Microsoft Q&A answer in the available material reports tested behavior on Windows 11 build 26200 that OBJ_DONT_REPARSE is honored by user-mode NtCreateFile even with a directory-relative single-component name, and that encountering a reparse point returned STATUS_REPARSE_POINT_ENCOUNTERED. That same answer also states the governing OBJECT_ATTRIBUTES text appears broader than the NtCreateFile page and treats the NtCreateFile wording as stale. However, that is implementation evidence and interpretation, not a complete published API contract.

    So, for a security-sensitive design, the supported conclusion from the available documentation is:

    • relative naming via RootDirectory is documented
    • normal reparse processing without FILE_OPEN_REPARSE_POINT is documented
    • OBJ_DONT_REPARSE exists as a documented object-attribute flag
    • but the exact user-mode NtCreateFile combination and the requested leaf-component security guarantee are not fully established by the available public documentation

    References:

    AI-generated content may be incorrect. Read our transparency notes for more information.

    Was this answer helpful?

  2. soner peker 0 Reputation points
    2026-11-17T11:54:14.78+00:00

    Thank you for the detailed AI-generated response.

    For our security-sensitive directory traversal design, we need to distinguish observed implementation behavior from an officially supported API contract.

    Could a Microsoft Windows API or filesystem expert clarify the following?

    Is OBJ_DONT_REPARSE officially supported in OBJECT_ATTRIBUTES.Attributes for user-mode NtCreateFile, despite the narrower wording in the winternl.h documentation?

    For a single-component relative directory name opened through RootDirectory with FILE_DIRECTORY_FILE, does OBJ_DONT_REPARSE guarantee rejection of a leaf reparse point without following its target?

    If supported, what Windows versions, filesystem conditions, and NTSTATUS outcomes are covered by that guarantee?

    An authoritative Microsoft specification, documentation reference, or confirmation that the behavior is undocumented would be particularly helpful.

    We are not requesting an implementation workaround or relying on a successful runtime test as a substitute for a supported security contract.

    Thank you.

    Was this answer helpful?


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.