ZwCreateDirectoryObject function (wdm.h)
The ZwCreateDirectoryObject routine creates or opens an object-directory object.
NTSYSAPI NTSTATUS ZwCreateDirectoryObject( [out] PHANDLE DirectoryHandle, [in] ACCESS_MASK DesiredAccess, [in] POBJECT_ATTRIBUTES ObjectAttributes );
Pointer to a HANDLE variable that receives a handle to the object directory.
Specifies an ACCESS_MASK value that determines the requested access to the object. In addition to the access rights that are defined for all types of objects (see ACCESS_MASK), the caller can specify one or more of the following access rights, which are specific to object directories:
|ACCESS_MASK flag||Type of access|
|DIRECTORY_ALL_ACCESS||All of the preceding types|
ZwCreateDirectoryObject returns an NTSTATUS value. Possible return values include:
Once the handle pointed to by DirectoryHandle is no longer in use, the driver must call ZwClose to close it.
If the caller is not running in a system thread context, it must ensure that any handles it creates are private handles. Otherwise, the handle can be accessed by the process in whose context the driver is running. For more information, see Object Handles.
The system uses object directories to organize other types of objects, such as device objects. For more information, see Object Directories.
The system does not use object directory objects to represent file-system directories, which are represented instead as file objects.
If the call to this function occurs in user mode, you should use the name "NtCreateDirectoryObject" instead of "ZwCreateDirectoryObject".
For calls from kernel-mode drivers, the NtXxx and ZwXxx versions of a Windows Native System Services routine can behave differently in the way that they handle and interpret input parameters. For more information about the relationship between the NtXxx and ZwXxx versions of a routine, see Using Nt and Zw Versions of the Native System Services Routines.
|Header||wdm.h (include Wdm.h, Ntddk.h, Ntifs.h)|
|DDI compliance rules||HwStorPortProhibitedDDIs(storport), PowerIrpDDis(wdm)|