Proposed category: Windows development / Windows SDK, subject to confirmation of available Microsoft Q&A tags.
I'm seeking clarification of the documented Windows native API contract for NtCreateFile when called from user mode to create a filesystem directory.
The proposed operation uses:
API: NtCreateFile
CreateDisposition: FILE_CREATE
CreateOptions: FILE_DIRECTORY_FILE | FILE_SYNCHRONOUS_IO_NONALERT (0x00000021)
DesiredAccess: Includes SYNCHRONIZE
OBJECT_ATTRIBUTES.RootDirectory: An already-open parent-directory handle
OBJECT_ATTRIBUTES.Attributes: Includes OBJ_DONT_REPARSE
OBJECT_ATTRIBUTES.SecurityDescriptor: A valid security descriptor containing an explicitly supplied, protected, non-null DACL
The objective is to apply the intended DACL as part of directory creation, rather than creating the directory with a default DACL and subsequently replacing it.
Primary question
For this specific user-mode NtCreateFile operation, which security-descriptor representations are supported through OBJECT_ATTRIBUTES.SecurityDescriptor?
Absolute security descriptor only?
Self-relative security descriptor only?
Both representations?
Additional clarification
Does the supported representation depend on Windows version, filesystem or other documented conditions?
Is a valid protected DACL supplied through this field applied during creation without an intermediate default-DACL exposure?
Are there relevant documented limitations involving object-relative creation or OBJ_DONT_REPARSE?
Is there an official Microsoft specification or API reference explicitly establishing these guarantees?
I'm looking for the supported interface contract, rather than a workaround or a conclusion based solely on observed behavior.
An answer referencing official Microsoft documentation would be particularly helpful.
Thank you.
NtCreateFile: Does OBJECT_ATTRIBUTES.SecurityDescriptor accept absolute or self-relative security descriptors for directory creation?
Proposed category: Windows development / Windows SDK, subject to confirmation of available Microsoft Q&A tags.
I'm seeking clarification of the documented Windows native API contract for NtCreateFile when called from user mode to create a filesystem directory.
The proposed operation uses:
API: NtCreateFile
CreateDisposition: FILE_CREATE
CreateOptions: FILE_DIRECTORY_FILE | FILE_SYNCHRONOUS_IO_NONALERT (0x00000021)
DesiredAccess: Includes SYNCHRONIZE
OBJECT_ATTRIBUTES.RootDirectory: An already-open parent-directory handle
OBJECT_ATTRIBUTES.Attributes: Includes OBJ_DONT_REPARSE
OBJECT_ATTRIBUTES.SecurityDescriptor: A valid security descriptor containing an explicitly supplied, protected, non-null DACL
The objective is to apply the intended DACL as part of directory creation, rather than creating the directory with a default DACL and subsequently replacing it.
Primary question
For this specific user-mode NtCreateFile operation, which security-descriptor representations are supported through OBJECT_ATTRIBUTES.SecurityDescriptor?
Absolute security descriptor only?
Self-relative security descriptor only?
Both representations?
Additional clarification
Does the supported representation depend on Windows version, filesystem or other documented conditions?
Is a valid protected DACL supplied through this field applied during creation without an intermediate default-DACL exposure?
Are there relevant documented limitations involving object-relative creation or OBJ_DONT_REPARSE?
Is there an official Microsoft specification or API reference explicitly establishing these guarantees?
I'm looking for the supported interface contract, rather than a workaround or a conclusion based solely on observed behavior.
An answer referencing official Microsoft documentation would be particularly helpful.
Thank you.