NtOpenDirectoryObject - NtDoc

Native API online documentation, based on the System Informer (formerly Process Hacker) phnt headers
#ifndef _NTOBAPI_H
//
// Directory objects
//
#if (PHNT_MODE != PHNT_MODE_KERNEL)

/**
 * Opens an existing directory object.
 * 
 * @param DirectoryHandle A handle to the newly opened directory object.
 * @param DesiredAccess An ACCESS_MASK that specifies the requested access to the directory object.
 * @param ObjectAttributes The attributes for the directory object.
 * @return NTSTATUS Successful or errant status.
 * @sa https://learn.microsoft.com/en-us/windows/win32/devnotes/ntopendirectoryobject
 */
NTSYSCALLAPI
NTSTATUS
NTAPI
NtOpenDirectoryObject(
    _Out_ PHANDLE DirectoryHandle,
    _In_ ACCESS_MASK DesiredAccess,
    _In_ POBJECT_ATTRIBUTES ObjectAttributes
    );

#endif
#endif

View code on GitHub
#ifndef _NTZWAPI_H

NTSYSCALLAPI
NTSTATUS
NTAPI
ZwOpenDirectoryObject(
    _Out_ PHANDLE DirectoryHandle,
    _In_ ACCESS_MASK DesiredAccess,
    _In_ POBJECT_ATTRIBUTES ObjectAttributes
    );

#endif

View code on GitHub

This function is documented in Windows Driver Kit.


DirectoryObjectHandle

Pointer to HANDLE value representing opened Directory Object.

DesiredAccess

Access mask. See NtCreateDirectoryObject for possible values.

ObjectAttributes

Must contains valid Directory Object name.

Documented by

See also