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?
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.