Hi @동석 이 ,
Thank you for posting your questions.
Based on the currently published Microsoft documentation, I would not treat NtCreateFile + a filesystem RootDirectory + OBJ_DONT_REPARSE as a fully documented, version-stable user-mode security contract.
The individual pieces are documented, but their exact combination is not clearly established by the NtCreateFile documentation.
- Is
OBJ_DONT_REPARSEofficially supported withNtCreateFileandRootDirectory?
The OBJECT_ATTRIBUTES documentation defines OBJ_DONT_REPARSE as:
If this flag is set, no reparse points will be followed when parsing the name of the associated object.
It also documents that when RootDirectory is non-NULL, ObjectName is interpreted relative to that directory.
However, the user-mode NtCreateFile documentation describes OBJECT_ATTRIBUTES.Attributes more narrowly, saying that the value can be zero or OBJ_CASE_INSENSITIVE.
Therefore, although these documented behaviors appear compatible, I do not see a published Microsoft statement explicitly establishing OBJ_DONT_REPARSE as part of the supported user-mode NtCreateFile contract in this specific combination.
There has been testing showing that OBJ_DONT_REPARSE is honored with a directory RootDirectory on a particular Windows 11 build, but that demonstrates implementation behavior rather than a cross-version API guarantee.
- Does it reject intermediate reparse points?
The general OBJECT_ATTRIBUTES contract says that no reparse points will be followed while parsing the associated name, and that encountering one causes the operation to fail with STATUS_REPARSE_POINT_ENCOUNTERED.
That wording is not limited to the final component or to a particular reparse tag. However, because the applicability of OBJ_DONT_REPARSE to this exact user-mode NtCreateFile scenario is not explicitly established by the function documentation, I would avoid presenting this as a guaranteed behavior across all Windows versions, file systems, and filter drivers.
Also, this only concerns parsing performed for the current ObjectName. It does not establish how the existing RootDirectory handle itself was originally obtained.
- How should the documentation discrepancy be interpreted?
I would treat this as a documentation gap rather than assume that the broader structure documentation overrides the narrower function documentation.
The OBJECT_ATTRIBUTES page defines what OBJ_DONT_REPARSE means when applicable, while the user-mode NtCreateFile page does not explicitly list it as an accepted Attributes value.
Without an explicit Microsoft statement, it would be unsafe to turn that discrepancy into a security guarantee.
- Is
FILE_OPEN_REPARSE_POINTan alternative?
Not for the same requirement.
FILE_OPEN_REPARSE_POINT changes handling of a reparse point so that the reparse-point object itself can be opened rather than following its normal reparse processing. That is different from the documented semantics of OBJ_DONT_REPARSE, which are to fail when a reparse is encountered during name parsing.
Similarly, Win32 CreateFileW with FILE_FLAG_OPEN_REPARSE_POINT is useful when you need to open or inspect a reparse point itself, but its documentation does not provide the same documented guarantee of rejecting every intermediate reparse while resolving a path relative to an already-held directory handle.
I do not find a published Win32/user-mode NtCreateFile contract that clearly guarantees all three across supported Windows configurations.
If this behavior is going to be relied upon as a security boundary, I recommend treating the NtCreateFile/OBJ_DONT_REPARSE combination as an unresolved documentation-contract question rather than relying on behavior observed on an individual Windows build.
A definitive support statement for this API combination isn't something I can independently provide or validate through this forum. If you need an authoritative answer, you can open a case with Microsoft Support through Support.
If you found my support helpful, I’d really appreciate it if you could follow this guide so others with similar issue can benefit as well.
Thank you.