Clarification on OBJ_DONT_REPARSE and FILE_OPEN_REPARSE_POINT with user-mode NtCreateFile
Hello Microsoft Windows API team,
I am developing a controlled user-mode application that needs to safely open files and directories using NtCreateFile with RootDirectory-based relative paths.
Target environment:
- Windows 10 Home x64, version 22H2
OS build 19045.6456
Windows SDK 10.0.26100.0
The proposed approach opens exactly one relative path component per NtCreateFile call, using a previously opened directory handle as RootDirectory. Parent directory handles remain open throughout the operation.
OBJECT_ATTRIBUTES:
RootDirectory: previously opened directory handle
ObjectName: exactly one simple relative component
Attributes: OBJ_CASE_INSENSITIVE | OBJ_DONT_REPARSE
NtCreateFile parameters:
CreateDisposition: FILE_OPEN
ShareAccess: FILE_SHARE_READ
Directory DesiredAccess: FILE_READ_ATTRIBUTES | READ_CONTROL | SYNCHRONIZE
File DesiredAccess: GENERIC_READ
Proposed directory CreateOptions:
FILE_DIRECTORY_FILE | FILE_SYNCHRONOUS_IO_NONALERT | FILE_OPEN_REPARSE_POINT
Proposed file CreateOptions:
FILE_NON_DIRECTORY_FILE | FILE_SYNCHRONOUS_IO_NONALERT | FILE_OPEN_REPARSE_POINT
I have reviewed the official Microsoft documentation for NtCreateFile, OBJECT_ATTRIBUTES, reparse points and CreateFile.
I would appreciate clarification on three specific questions:
1. OBJ_DONT_REPARSE in user mode
Is OBJ_DONT_REPARSE officially supported in user-mode NtCreateFile calls when RootDirectory is non-NULL and ObjectName contains exactly one relative path component?
What documented NTSTATUS should be expected when that component is a reparse point?
2. FILE_OPEN_REPARSE_POINT with directory options
Are the following combinations documented and supported together?
FILE_DIRECTORY_FILE | FILE_SYNCHRONOUS_IO_NONALERT | FILE_OPEN_REPARSE_POINT
FILE_NON_DIRECTORY_FILE | FILE_SYNCHRONOUS_IO_NONALERT | FILE_OPEN_REPARSE_POINT
The documented compatible CreateOptions list for FILE_DIRECTORY_FILE does not explicitly include FILE_OPEN_REPARSE_POINT.
Is this omission intentional, or is the combination supported?
3. Combined behavior and precedence
When OBJ_DONT_REPARSE and FILE_OPEN_REPARSE_POINT are supplied simultaneously, what is the documented behavior for:
A reparse point in the final component.
A reparse point in an intermediate component.
An already opened RootDirectory handle.
A single relative path component.
Specifically, when should STATUS_REPARSE_POINT_ENCOUNTERED be returned, and when should the reparse object itself be opened?
Could you please clarify the documented contract and its applicability to Windows 10 version 22H2, build 19045?
I am looking for an authoritative API contract, including any limitations or version-specific behavior, rather than an experimental code example alone.
Thank you for your assistance.Hello Microsoft Windows API team,
I am developing a controlled user-mode application that needs to safely open files and directories using NtCreateFile with RootDirectory-based relative paths.
Target environment:
Windows 10 Home x64, version 22H2
OS build 19045.6456
Windows SDK 10.0.26100.0
The proposed approach opens exactly one relative path component per NtCreateFile call, using a previously opened directory handle as RootDirectory. Parent directory handles remain open throughout the operation.
OBJECT_ATTRIBUTES:
RootDirectory: previously opened directory handle
ObjectName: exactly one simple relative component
Attributes: OBJ_CASE_INSENSITIVE | OBJ_DONT_REPARSE
NtCreateFile parameters:
CreateDisposition: FILE_OPEN
ShareAccess: FILE_SHARE_READ
Directory DesiredAccess: FILE_READ_ATTRIBUTES | READ_CONTROL | SYNCHRONIZE
File DesiredAccess: GENERIC_READ
Proposed directory CreateOptions:
FILE_DIRECTORY_FILE | FILE_SYNCHRONOUS_IO_NONALERT | FILE_OPEN_REPARSE_POINT
Proposed file CreateOptions:
FILE_NON_DIRECTORY_FILE | FILE_SYNCHRONOUS_IO_NONALERT | FILE_OPEN_REPARSE_POINT
I have reviewed the official Microsoft documentation for NtCreateFile, OBJECT_ATTRIBUTES, reparse points and CreateFile.
I would appreciate clarification on three specific questions:
1. OBJ_DONT_REPARSE in user mode
Is OBJ_DONT_REPARSE officially supported in user-mode NtCreateFile calls when RootDirectory is non-NULL and ObjectName contains exactly one relative path component?
What documented NTSTATUS should be expected when that component is a reparse point?
2. FILE_OPEN_REPARSE_POINT with directory options
Are the following combinations documented and supported together?
FILE_DIRECTORY_FILE | FILE_SYNCHRONOUS_IO_NONALERT | FILE_OPEN_REPARSE_POINT
FILE_NON_DIRECTORY_FILE | FILE_SYNCHRONOUS_IO_NONALERT | FILE_OPEN_REPARSE_POINT
The documented compatible CreateOptions list for FILE_DIRECTORY_FILE does not explicitly include FILE_OPEN_REPARSE_POINT.
Is this omission intentional, or is the combination supported?
3. Combined behavior and precedence
When OBJ_DONT_REPARSE and FILE_OPEN_REPARSE_POINT are supplied simultaneously, what is the documented behavior for:
A reparse point in the final component.
A reparse point in an intermediate component.
An already opened RootDirectory handle.
A single relative path component.
Specifically, when should STATUS_REPARSE_POINT_ENCOUNTERED be returned, and when should the reparse object itself be opened?
Could you please clarify the documented contract and its applicability to Windows 10 version 22H2, build 19045?
I am looking for an authoritative API contract, including any limitations or version-specific behavior, rather than an experimental code example alone.
Thank you for your assistance.