ZwOpenSection

NTSTATUS
    ZwOpenSection(

        OUT PHANDLE  SectionHandle,
        IN ACCESS_MASK  DesiredAccess,
        IN POBJECT_ATTRIBUTES  ObjectAttributes
        );

ZwOpenSection opens a handle for an existing section object.

Parameters

SectionHandle
Points to a variable that will receive the section object handle if this call is successful.
DesiredAccess
Specifies a mask representing the requested access to the object. The set of system-defined DesiredAccess flags relevant to device and intermediate drivers are the following:

DesiredAccess Flags

Meaning

SECTION_MAP_WRITE

A mapped view can be written.

SECTION_MAP_READ

A mapped view can be read.

A caller can specify SECTION_ALL_ACCESS, which sets all of the defined flags ORed with the system-defined STANDARD_RIGHTS_REQUIRED.

ObjectAttributes
Points to the initialized object attributes of the section to be opened.

Return Value

ZwOpenSection can return one of the following values:

STATUS_SUCCESS
STATUS_ACCESS_DENIED
STATUS_INVALID_HANDLE

Comments

If the specified section does not exist or the access requested is not allowed, the operation fails.

Callers of ZwOpenSection must be running at PASSIVE_LEVEL.

See Also

InitializeObjectAttributes, ZwMapViewOfSection, ZwUnmapViewOfSection