Bewerken

Delen via


EVT_WDF_INTERRUPT_WORKITEM callback function (wdfinterrupt.h)

[Applies to KMDF and UMDF]

A driver's EvtInterruptWorkItem event callback function processes interrupt information that the driver's EvtInterruptIsr callback function has stored.

Syntax

EVT_WDF_INTERRUPT_WORKITEM EvtWdfInterruptWorkitem;

void EvtWdfInterruptWorkitem(
  [in] WDFINTERRUPT Interrupt,
  [in] WDFOBJECT AssociatedObject
)
{...}

Parameters

[in] Interrupt

A handle to a framework interrupt object.

[in] AssociatedObject

A handle to the framework device object that the driver passed to WdfInterruptCreate.

Return value

None

Remarks

The EvtInterruptWorkItem callback function runs at IRQL = PASSIVE_LEVEL.

To register an EvtInterruptWorkItem callback function, your driver must place the callback function's address in a WDF_INTERRUPT_CONFIG structure before calling WdfInterruptCreate.

Most drivers use a single EvtInterruptWorkItem callback function for each type of interrupt.

To schedule execution of an EvtInterruptWorkItem callback function, the driver must call WdfInterruptQueueWorkItemForIsr from within the EvtInterruptIsr callback function.

If your driver creates multiple framework interrupt objects for each device, you might consider using a separate EvtInterruptWorkItem callback for each interrupt.

Drivers that implement either DIRQL interrupt handling or passive level interrupt handling can queue an EvtInterruptWorkItem callback.

A driver cannot queue both an EvtInterruptDpc and an EvtInterruptWorkItem callback.

If the driver has set the AutomaticSerialization member to TRUE in the interrupt's WDF_INTERRUPT_CONFIG structure, the framework synchronizes execution of the interrupt object's EvtInterruptWorkItem callback function with callback functions from other objects that are underneath the interrupt's parent object. For information about callback synchronization locks, see Using Framework Locks.

In general, if the driver needs to acquire the interrupt object's passive lock from within EvtInterruptWorkItem, the driver should set the AutomaticSerialization member of WDF_INTERRUPT_CONFIG to FALSE and then call WdfInterruptAcquireLock from within EvtInterruptWorkItem.

If AutomaticSerialization is set to TRUE, a driver's EvtInterruptWorkItem callback function should not call any of the following methods:

WdfInterruptAcquireLock WdfInterruptSynchronize WdfInterruptDisable WdfInterruptEnable For more information about handling interrupts in framework-based drivers, see Handling Hardware Interrupts.

Requirements

Requirement Value
Target Platform Universal
Minimum KMDF version 1.11
Minimum UMDF version 2.0
Header wdfinterrupt.h (include Wdf.h)
IRQL PASSIVE_LEVEL