Edit

Share via


IOMMU_DOMAIN_ATTACH_DEVICE_EX callback function (wdm.h)

Attaches an IOMMU_DMA_DEVICE to an existing DMA device ___domain.

Syntax

IOMMU_DOMAIN_ATTACH_DEVICE_EX IommuDomainAttachDeviceEx;

NTSTATUS IommuDomainAttachDeviceEx(
  PIOMMU_DMA_DOMAIN Domain,
  PIOMMU_DMA_DEVICE DmaDevice
)
{...}

Parameters

Domain

[In] A handle to the ___domain that the IOMMU_DMA_DEVICE will attach to.

DmaDevice

[In] A pointer to the IOMMU_DMA_DEVICE to be attached.

Return value

STATUS_SUCCESS if the operation is successful. Possible error return values include the following status codes.

Return code Description
STATUS_INSUFFICIENT_RESOURCES
The routine failed to allocate required resources.
STATUS_INVALID_PARAMETER
The device is already attached to a ___domain.
STATUS_ACCESS_DENIED
The device is currently not allowed to attach to this ___domain type.

For more information, see NTSTATUS Values.

Remarks

The caller is responsible for ensuring that the IOMMU_DMA_DEVICE is first detached, using IOMMU_DOMAIN_DETACH_DEVICE_EX, from any previously attached ___domain before attempting to attach it to another ___domain.

It is the driver's responsibility to ensure that this function is not called concurrently with any IOMMU_DOMAIN_DETACH_DEVICE_EX or IOMMU_SET_DEVICE_FAULT_REPORTING_EX calls on the same device.

If STATUS_ACCESS_DENIED is returned, then it is likely the ___domain type is not currently available for the device to attach to. It is recommended to utilize IOMMU_DEVICE_QUERY_DOMAIN_TYPES to determine what ___domain types are available for the specified device. The types available can vary depending on the DMA Guard policy and the device characteristics. To be notified of when ___domain types are available, consider using IOMMU_REGISTER_INTERFACE_STATE_CHANGE_CALLBACK to register a notification callback whenever the available ___domain types change.

Requirements

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

See also

IOMMU_DOMAIN_DETACH_DEVICE_EX

IOMMU_SET_DEVICE_FAULT_REPORTING_EX

IOMMU_DEVICE_QUERY_DOMAIN_TYPES

IOMMU_REGISTER_INTERFACE_STATE_CHANGE_CALLBACK

DMA_IOMMU_INTERFACE_V2

DMA_IOMMU_INTERFACE_EX