ZwOpenEnlistment

ZwOpenEnlistment routine

The ZwOpenEnlistment routine obtains a handle to an existing enlistment object.

Syntax


NTSTATUS ZwOpenEnlistment(
  _Out_    PHANDLE            EnlistmentHandle,
  _In_     ACCESS_MASK        DesiredAccess,
  _In_     HANDLE             RmHandle,
  _In_     LPGUID             EnlistmentGuid,
  _In_opt_ POBJECT_ATTRIBUTES ObjectAttributes
);

Parameters

EnlistmentHandle [out]

A pointer to a caller-allocated variable that receives a handle to an enlistment object if the call to ZwOpenEnlistment succeeds.

DesiredAccess [in]

An ACCESS_MASK-typed value that specifies the requested access to the enlistment object. For more information about how to specify this parameter, see the DesiredAccess parameter of ZwCreateEnlistment. This parameter cannot be zero.

RmHandle [in]

A handle to a resource manager object that was obtained by a previous call to ZwCreateResourceManager or ZwOpenResourceManager.

EnlistmentGuid [in]

A pointer to a GUID that identifies the enlistment. For more information, see the following Remarks section.

ObjectAttributes [in, optional]

A pointer to an OBJECT_ATTRIBUTES structure that specifies the object's attributes. Use the InitializeObjectAttributes routine to initialize this structure, but specify only that routine's InitializedAttributes and Attributes parameters. If the caller is not running in a system thread context, it must set the OBJ_KERNEL_HANDLE flag in the Attributes parameter. This parameter is optional and can be NULL.

Return value

ZwOpenEnlistment returns STATUS_SUCCESS if the operation succeeds. Otherwise, this routine might return one of the following values:

Return codeDescription
STATUS_INVALID_HANDLE

The object handle is invalid.

STATUS_ACCESS_DENIED

The caller does not have appropriate access to the enlistment object.

STATUS_INVALID_PARAMETER

The DesiredAccess parameter's value is zero, or the EnlistmentGuid parameter's value is NULL.

STATUS_ENLISTMENT_NOT_FOUND

The enlistment that the EnlistmentGuid parameter specifies does not exist for the resource manager that the RmHandle parameter specifies.

STATUS_ACCESS_DENIED

The value of the DesiredAccess parameter is invalid.

 

The routine might return other NTSTATUS values.

Remarks

Typically, a TPS component calls ZwOpenEnlistment after it receives an enlistment GUID from another TPS component that had previously called ZwCreateEnlistment. Most TPS designs do not require calling ZwOpenEnlistment.

A resource manager that calls ZwOpenEnlistment must eventually call ZwClose to close the object handle.

For more information about ZwOpenEnlistment, see Enlistment Objects.

Requirements

Target platform

Universal

Version

Available in Windows Vista and later operating system versions.

Header

Wdm.h (include Wdm.h or Ntifs.h)

Library

NtosKrnl.lib

DLL

NtosKrnl.exe

IRQL

PASSIVE_LEVEL

DDI compliance rules

PowerIrpDDis, HwStorPortProhibitedDDIs

See also

ACCESS_MASK
InitializeObjectAttributes
OBJECT_ATTRIBUTES
ZwClose
ZwCreateEnlistment
ZwCreateResourceManager
ZwOpenResourceManager
ZwQueryInformationEnlistment
ZwSetInformationEnlistment

 

 

Send comments about this topic to Microsoft

Show:
© 2016 Microsoft