FltEnlistInTransaction function (fltkernel.h)

The FltEnlistInTransaction routine enlists a minifilter driver in a given transaction.

Syntax

NTSTATUS FLTAPI FltEnlistInTransaction(
  [in] PFLT_INSTANCE     Instance,
  [in] PKTRANSACTION     Transaction,
  [in] PFLT_CONTEXT      TransactionContext,
  [in] NOTIFICATION_MASK NotificationMask
);

Parameters

[in] Instance

An opaque instance pointer for the caller. This parameter is required and cannot be NULL.

[in] Transaction

An opaque transaction pointer for the transaction.

[in] TransactionContext

A pointer to the minifilter driver's transaction context. This parameter is required and cannot be NULL.

[in] NotificationMask

Specifies the type of notifications that the filter manager is to send to the minifilter driver, as one or more of the values listed in the following table. This parameter is required and cannot be zero.

Value Meaning
TRANSACTION_NOTIFY_COMMIT This notification is sent when the transaction is being committed.
TRANSACTION_NOTIFY_COMMIT_FINALIZE For Windows Vista SP1 and later, this notification is sent when the transaction is fully committed (that is, when all of the resource managers associated with the transaction, such as TxF, have committed).
TRANSACTION_NOTIFY_PREPARE This notification is sent when the transaction has entered the prepare for commit phase.
TRANSACTION_NOTIFY_PREPREPARE This notification is sent when the transaction has entered the pre-prepare for commit phase.
TRANSACTION_NOTIFY_ROLLBACK This notification is sent when the transaction is being rolled back or aborted.
FLT_MAX_TRANSACTION_NOTIFICATIONS TRANSACTION_NOTIFY_COMMIT | TRANSACTION_NOTIFY_PREPARE | TRANSACTION_NOTIFY_PREPREPARE | TRANSACTION_NOTIFY_ROLLBACK

Return value

FltEnlistInTransaction returns STATUS_SUCCESS or an appropriate NTSTATUS value such as one of the following:

Return code Description
STATUS_FLT_ALREADY_ENLISTED
The caller is already enlisted in the transaction. This is an error code.
STATUS_FLT_DELETING_OBJECT
The instance specified in the Instance parameter is being torn down. This is an error code.
STATUS_INSUFFICIENT_RESOURCES
FltEnlistInTransaction encountered a pool allocation error. This is an error code.
STATUS_INVALID_PARAMETER
The caller did not register a TransactionNotificationCallback routine. This is an error code.
STATUS_INVALID_PARAMETER_4
The caller specified an invalid value for the NotificationMask parameter. This is an error code.

Remarks

A minifilter driver calls FltEnlistInTransaction to enlist in a transaction. Before calling FltEnlistInTransaction, the minifilter driver must have registered a TransactionNotificationCallback routine. Otherwise, the call to FltEnlistInTransaction will fail.

To register a TransactionNotificationCallback routine, a minifilter driver stores the address of a routine of type PFLT_TRANSACTION_NOTIFICATION_CALLBACK in the TransactionNotificationCallback member of the FLT_REGISTRATION structure that the minifilter driver passes as the Registration parameter of FltRegisterFilter.

To roll back or abort a transaction, call FltRollbackEnlistment.

To allocate a new transaction context, call FltAllocateContext.

To retrieve a transaction context, call FltGetTransactionContext.

To delete a transaction context, call FltDeleteTransactionContext or FltDeleteContext.

To set a transaction context, call FltSetTransactionContext.

Requirements

Requirement Value
Minimum supported client This routine is available on Windows Vista and later versions of Windows.
Target Platform Universal
Header fltkernel.h (include Fltkernel.h)
Library FltMgr.lib
DLL FltMgr.sys
IRQL <= APC_LEVEL

See also

FltAllocateContext

FltCommitComplete

FltDeleteContext

FltDeleteTransactionContext

FltGetTransactionContext

FltPrePrepareComplete

FltPrepareComplete

FltRegisterFilter

FltReleaseContext

FltRollbackComplete

FltRollbackEnlistment

FltSetTransactionContext

PFLT_TRANSACTION_NOTIFICATION_CALLBACK