NtReadOnlyEnlistment function

The ZwReadOnlyEnlistment routine sets a specified enlistment to be read-only.


NTSTATUS ZwReadOnlyEnlistment(
  _In_     HANDLE         EnlistmentHandle,
  _In_opt_ PLARGE_INTEGER TmVirtualClock



A handle to an enlistment object that was obtained by a previous call to ZwCreateEnlistment or ZwOpenEnlistment. The handle must have ENLISTMENT_SUBORDINATE_RIGHTS access to the object.


A pointer to a virtual clock value. This parameter is optional and can be NULL.

Return Value

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

Return code Description
The specified handle is not a handle to an enlistment object.
The object handle is invalid.
The transaction or its enlistment is not in the correct state. For example, an enlistment cannot be read-only if the ENLISTMENT_SUPERIOR flag was specified to ZwCreateEnlistment.
The caller does not have appropriate access to the enlistment object.

The routine might return other NTSTATUS values.


Your component cannot call ZwReadOnlyEnlistment for a superior enlistment.

For more information about ZwReadOnlyEnlistment, see Creating a Read-Only Enlistment.

NtReadOnlyEnlistment and ZwReadOnlyEnlistment are two versions of the same Windows Native System Services routine.

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.


Windows version Available in Windows Vista and later operating system versions. Available in Windows Vista and later operating system versions.
Target Platform Universal
Header wdm.h (include Wdm.h, Ntddk.h, Ntifs.h)
Library NtosKrnl.lib
DLL NtosKrnl.exe
DDI compliance rules PowerIrpDDis, HwStorPortProhibitedDDIs

See Also

Using Nt and Zw Versions of the Native System Services Routines



Send comments about this topic to Microsoft