TmEnableCallbacks function (wdm.h)

The TmEnableCallbacks routine enables a callback routine that receives transaction notifications.

Syntax

NTSTATUS TmEnableCallbacks(
  [in]           PKRESOURCEMANAGER   ResourceManager,
  [in]           PTM_RM_NOTIFICATION CallbackRoutine,
  [in, optional] PVOID               RMKey
);

Parameters

[in] ResourceManager

A pointer to a resource manager object. To obtain this pointer, your component must call ObReferenceObjectByHandle and supply the object handle that a previous call to ZwCreateResourceManager or ZwOpenResourceManager provided.

[in] CallbackRoutine

A pointer to a ResourceManagerNotification routine.

[in, optional] RMKey

A caller-defined context value that uniquely identifies the resource manager. The caller's ResourceManagerNotification routine receives this value as input.

Return value

TmEnableCallbacks returns STATUS_SUCCESS if the operation succeeds. Otherwise, this routine might return the following value:

Return code Description
STATUS_UNSUCCESSFUL
The CallbackRoutine pointer is NULL.
 

The routine might return other NTSTATUS values.

Remarks

Your resource manager can call TmEnableCallbacks to enable a ResourceManagerNotification callback routine. Use TmEnableCallbacks to enable asynchronous notifications. Use ZwGetNotificationResourceManager to obtain notifications synchronously.

Resource managers can register one callback routine for each resource manager object.

For more information about the TmEnableCallbacks routine, see Creating a Resource Manager.

For information about when to use KTM's TmXxx routines instead of ZwXxx routines, see Using TmXxx Routines.

Requirements

Requirement Value
Minimum supported client 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
IRQL PASSIVE_LEVEL

See also

ObReferenceObjectByHandle

ResourceManagerNotification

ZwCreateResourceManager

ZwGetNotificationResourceManager

ZwOpenResourceManager