WdfInterruptQueueDpcForIsr - NtDoc

Native API online documentation, based on the System Informer (formerly Process Hacker) phnt headers
// wdfinterrupt.h

BOOLEAN WdfInterruptQueueDpcForIsr(
  [in] WDFINTERRUPT Interrupt
);

View the official Windows Driver Kit DDI reference

NtDoc

No description available.

Windows Driver Kit DDI reference (nf-wdfinterrupt-wdfinterruptqueuedpcforisr)

WdfInterruptQueueDpcForIsr function

Description

[Applies to KMDF and UMDF]

The WdfInterruptQueueDpcForIsr method queues a framework interrupt object's EvtInterruptDpc callback function for execution.

Parameters

Interrupt [in]

A handle to a framework interrupt object.

Return value

WdfInterruptQueueDpcForIsr returns TRUE if it successfully queues the interrupt object's EvtInterruptDpc callback function. The method returns FALSE if the callback function was previously queued and has not executed.

A bug check occurs if the driver supplies an invalid object handle.

Remarks

Drivers typically call WdfInterruptQueueDpcForIsr from within an EvtInterruptIsr callback function.

An interrupt object's EvtInterruptDpc callback function can be queued only once before it executes. Therefore, if a call to WdfInterruptQueueDpcForIsr succeeds, subsequent calls will return FALSE until the framework dequeues the EvtInterruptDpc callback function.

The EvtInterruptDpc callback will run on the processor that enqueued it. If your driver calls WdfInterruptQueueDpcForIsr to queue another DPC while an EvtInterruptDpc callback function is already dequeued or running, the second EvtInterruptDpc callback might even run before the first one completes.

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

In KMDF 1.11 and later, a driver can call WdfInterruptQueueDpcForIsr from a passive-level ISR. Note that a driver can register a work item or a DPC but not both.

Examples

The following code example shows how an EvtInterruptIsr callback function should queue an EvtInterruptDpc callback function.

BOOLEAN
MyEvtInterruptIsr(
    IN WDFINTERRUPT Interrupt,
    IN ULONG  MessageID
    )
{
    BOOLEAN queueDpcSuccess;

    //
    // Save interrupt information for the
    // EvtInterruptDpc function.
    //
...
    //
    // Queue the EvtInterruptDpc function.
    //
    queueDpcSuccess = WdfInterruptQueueDpcForIsr(Interrupt);
...
}

See also

EvtInterruptDpc

EvtInterruptIsr

WdfInterruptCreate