Does user-mode NtCreateFile support OBJ_DONT_REPARSE with RootDirectory for secure directory creation on Windows 11?

immobiliare savelli 0 Reputation points
2026-11-19T18:21:31.8133333+00:00

Dear Microsoft Windows Developer Support Team,

We are designing a local Windows service architecture that requires secure creation of a new directory inside an existing, verified filesystem directory.

Our target environment is Windows 11 Home 26H2, x64, build 26300.9974.

Before implementing the provisioning mechanism, we need clarification regarding the supported security contract for user-mode NtCreateFile.

Our intended design requires:

Creating a new directory using a single relative name and an already validated filesystem directory handle supplied through OBJECT_ATTRIBUTES.RootDirectory.

Using FILE_CREATE and FILE_DIRECTORY_FILE so that an existing file, directory, symbolic link or junction cannot be silently adopted.

Applying an explicit, protected security descriptor during creation.

Rejecting unapproved filesystem reparse points before any mutation outside the authorized parent.

Receiving an handle to the newly created directory and maintaining protection against unauthorized rename or movement from the moment of creation.

We would appreciate clarification on three questions.

Question 1 — OBJ_DONT_REPARSE

Is OBJ_DONT_REPARSE officially supported and guaranteed for user-mode NtCreateFile when RootDirectory refers to an existing filesystem directory handle and ObjectName contains a single relative component?

Does the guarantee cover filesystem junctions, symbolic links and other reparse points encountered during this operation?

Question 2 — Creation and mutation ordering

With FILE_CREATE | FILE_DIRECTORY_FILE, can the operation be guaranteed to fail before following an unexpected reparse destination or modifying an object outside the validated parent?

What restrictions apply to Windows versions, filesystems, filter drivers and security contexts?

Question 3 — Continuous protection of the created directory

Which documented combination of DesiredAccess and ShareAccess should be requested during creation to prevent another process from renaming or moving the newly created directory before its security descriptor and identity have been verified?

We are specifically interested in obtaining the required protection through the original creation handle, rather than opening a second handle after creation.

If these guarantees are not available through the proposed API combination, please identify the recommended, supported Windows API or provisioning architecture.

We are looking for an authoritative, documented security contract rather than behavior observed only on a particular Windows build.

No production deployment has been authorized while these questions remain unresolved.

Thank you for your assistance.

Windows development | Windows API - Win32
0 comments No comments

1 answer

Sort by: Most helpful
  1. Harry Nguyen (WICLOUD CORPORATION) 860 Reputation points Microsoft External Staff Moderator
    2026-11-20T03:39:44.22+00:00

    Hi @immobiliare savelli , 

    The public documentation covers some of what you need, mainly FILE_CREATE and share access. It does not establish OBJ_DONT_REPARSE as a user-mode NtCreateFile contract, so those guarantees would need to come from the Windows team. 

    On OBJ_DONT_REPARSE, the fail-on-reparse behavior is described only in the kernel-mode OBJECT_ATTRIBUTES reference. The user-mode NtCreateFile page lists only zero or OBJ_CASE_INSENSITIVE for Attributes. Because of that, I could not find a documented guarantee for this combination that covers junctions, symbolic links, or other reparse tags. 

    As for creation ordering, the same NtCreateFile page documents three points. FILE_CREATE fails if the name already exists and does not open the existing object. FILE_DIRECTORY_FILE fails if the target is not a directory. A security descriptor supplied in ObjectAttributes is applied at creation. What the page does not cover is when reparse processing happens relative to on-disk changes, or any restrictions by Windows version, file system, filter driver, or security context. 

    To protect the new directory through the original handle, the documented option is ShareAccess = 0, or at minimum omitting FILE_SHARE_DELETE. Combine it with directory rights such as READ_CONTROL | FILE_LIST_DIRECTORY | SYNCHRONIZE. With no share flags, other opens fail while your handle remains open. Without FILE_SHARE_DELETE, no other caller can obtain delete access, and rename requires that access, as described in CreateFileW and FILE_RENAME_INFORMATION. This protection applies to the directory itself. It is not documented to prevent a rename or move of its parent. 

    If you need an authoritative confirmation before deployment, you can open a case through Windows Developer Support. Including your target Windows builds, file systems, and filter-driver environment will help the team address each point directly. 

    If you feel the information has helped you move forward, you are welcome to follow this guide when convenient. You are also always welcome to add any confirmation you receive here. 

    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.