WdfInterruptQueueDpcForIsr function (wdfinterrupt.h)
[Applies to KMDF and UMDF]
The WdfInterruptQueueDpcForIsr method queues a framework interrupt object's EvtInterruptDpc callback function for execution.
Syntax
BOOLEAN WdfInterruptQueueDpcForIsr(
[in] WDFINTERRUPT Interrupt
);
Parameters
[in] Interrupt
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);
...
}
Requirements
Requirement | Value |
---|---|
Target Platform | Universal |
Minimum KMDF version | 1.0 |
Minimum UMDF version | 2.0 |
Header | wdfinterrupt.h (include Wdf.h) |
Library | Wdf01000.sys (KMDF); WUDFx02000.dll (UMDF) |
IRQL | <=DIRQL |
DDI compliance rules | DriverCreate(kmdf) |