IOMMU_REGISTER_INTERFACE_STATE_CHANGE_CALLBACK callback function (wdm.h)

Allows the caller to register a callback to be invoked whenever any state change related to a DMA_IOMMU_INTERFACE_EX occurs.

Syntax

IOMMU_REGISTER_INTERFACE_STATE_CHANGE_CALLBACK IommuRegisterInterfaceStateChangeCallback;

NTSTATUS IommuRegisterInterfaceStateChangeCallback(
  PIOMMU_INTERFACE_STATE_CHANGE_CALLBACK StateChangeCallback,
  PVOID Context,
  PIOMMU_DMA_DEVICE DmaDevice,
  PIOMMU_INTERFACE_STATE_CHANGE_FIELDS StateFields
)
{...}

Parameters

StateChangeCallback

[In] The IOMMU_INTERFACE_STATE_CHANGE_CALLBACK to be registered.

Context

[In, optional] An optional context that will be passed to the state change callback.

DmaDevice

[In] A pointer to an opaque token representing the IOMMU_DMA_DEVICE that will be linked to the callback.

StateFields

[In] A pointer to the states that a caller is registering to be notified about. See IOMMU_INTERFACE_STATE_CHANGE_FIELDS.

Return value

STATUS_SUCCESS if the operation is successful.

Possible error return values include the following status codes.

Return code Description
STATUS_UNSUCCESSFUL The routine failed to register the provided callback because the IOMMU_DMA_DEVICE has already been registered with a callback.
STATUS_INVALID_PARAMETER_4 The caller did not indicate interest in any interface state field in StateFields.

For more information, see NTSTATUS Values.

Remarks

Registration will always immediately invoke the callback to avoid race conditions with any notifications that invoke the callbacks. Callback owners should not assume the state when a callback is invoked and should always check that the state matches their needs.

Before disposing of a DMA_IOMMU_INTERFACE_EX or IOMMU_DMA_DEVICE, the owner is responsible for unregistering all its registered callbacks.

Only one callback can be registered per IOMMU_DMA_DEVICE.

Requirements

Requirement Value
Minimum supported server Windows Server 2022
Header wdm.h (include Wdm.h)

See also

DMA_IOMMU_INTERFACE_V2

DMA_IOMMU_INTERFACE_EX

IOMMU_INTERFACE_STATE_CHANGE_CALLBACK

IOMMU_INTERFACE_STATE_CHANGE_FIELDS

IOMMU_UNREGISTER_INTERFACE_STATE_CHANGE_CALLBACK