NtPrepareComplete - NtDoc

Native API online documentation, based on the System Informer (formerly Process Hacker) phnt headers
#ifndef _NTTMAPI_H

NTSYSCALLAPI
NTSTATUS
NTAPI
NtPrepareComplete(
    _In_ HANDLE EnlistmentHandle,
    _In_opt_ PLARGE_INTEGER TmVirtualClock
    );

#endif

View code on GitHub
#ifndef _NTZWAPI_H

NTSYSCALLAPI
NTSTATUS
NTAPI
ZwPrepareComplete(
    _In_ HANDLE EnlistmentHandle,
    _In_opt_ PLARGE_INTEGER TmVirtualClock
    );

#endif

View code on GitHub
// wdm.h

__kernel_entry NTSYSCALLAPI NTSTATUS NtPrepareComplete(
  [in]           HANDLE         EnlistmentHandle,
  [in, optional] PLARGE_INTEGER TmVirtualClock
);
View the official Windows Driver Kit DDI reference
// wdm.h

NTSYSCALLAPI NTSTATUS ZwPrepareComplete(
  [in]           HANDLE         EnlistmentHandle,
  [in, optional] PLARGE_INTEGER TmVirtualClock
);
View the official Windows Driver Kit DDI reference

NtDoc

This function is documented in Windows Driver Kit here and here.

Windows Driver Kit DDI reference (nf-wdm-ntpreparecomplete)

NtPrepareComplete function

Description

The ZwPrepareComplete routine notifies KTM that the calling resource manager has finished preparing a transaction's data.

Parameters

EnlistmentHandle [in]

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.

TmVirtualClock [in, optional]

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

Return value

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

Return code Description
STATUS_OBJECT_TYPE_MISMATCH The specified handle is not a handle to an enlistment object.
STATUS_INVALID_HANDLE The object handle is invalid.
STATUS_TRANSACTION_NOT_REQUESTED The transaction or its enlistment is not in the correct state.
STATUS_ACCESS_DENIED The caller does not have appropriate access to the enlistment object.

The routine might return other NTSTATUS values.

Remarks

A resource manager must call ZwPrepareComplete after it has finished servicing a TRANSACTION_NOTIFY_PREPARE notification.

After a resource manager has called ZwPrepareComplete, it cannot roll back the transaction.

For more information about ZwPrepareComplete, see Handling Commit Operations.

NtPrepareComplete and ZwPrepareComplete are two versions of the same Windows Native System Services routine.

For calls from kernel-mode drivers, the Nt*Xxx* and Zw*Xxx* 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 Nt*Xxx* and Zw*Xxx* versions of a routine, see Using Nt and Zw Versions of the Native System Services Routines.

See also

TmPrepareComplete

Using Nt and Zw Versions of the Native System Services Routines

ZwCreateEnlistment

ZwOpenEnlistment

ZwPrePrepareComplete


Windows Driver Kit DDI reference (nf-wdm-zwpreparecomplete)

ZwPrepareComplete function

Description

The ZwPrepareComplete routine notifies KTM that the calling resource manager has finished preparing a transaction's data.

Parameters

EnlistmentHandle [in]

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.

TmVirtualClock [in, optional]

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

Return value

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

Return code Description
STATUS_OBJECT_TYPE_MISMATCH The specified handle is not a handle to an enlistment object.
STATUS_INVALID_HANDLE The object handle is invalid.
STATUS_TRANSACTION_NOT_REQUESTED The transaction or its enlistment is not in the correct state.
STATUS_ACCESS_DENIED The caller does not have appropriate access to the enlistment object.

The routine might return other NTSTATUS values.

Remarks

A resource manager must call ZwPrepareComplete after it has finished servicing a TRANSACTION_NOTIFY_PREPARE notification.

After a resource manager has called ZwPrepareComplete, it cannot roll back the transaction.

For more information about ZwPrepareComplete, see Handling Commit Operations.

NtPrepareComplete and ZwPrepareComplete are two versions of the same Windows Native System Services routine.

For calls from kernel-mode drivers, the Nt*Xxx* and Zw*Xxx* 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 Nt*Xxx* and Zw*Xxx* versions of a routine, see Using Nt and Zw Versions of the Native System Services Routines.

See also

TmPrepareComplete

Using Nt and Zw Versions of the Native System Services Routines

ZwCreateEnlistment

ZwOpenEnlistment

ZwPrePrepareComplete