Bewerken

Delen via


WdfInterruptGetDevice function (wdfinterrupt.h)

[Applies to KMDF and UMDF]

The WdfInterruptGetDevice method returns a handle to the framework device object that is associated with a specified framework interrupt object.

Syntax

WDFDEVICE WdfInterruptGetDevice(
  [in] WDFINTERRUPT Interrupt
);

Parameters

[in] Interrupt

A handle to a framework interrupt object.

Return value

WdfInterruptGetDevice returns a handle to a framework device object.

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

Remarks

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

Examples

The following code example shows how an EvtInterruptIsr callback function can obtain a pointer to driver-defined context space for the device object that an interrupt object belongs to.

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

    devExt = GetMyDeviceContext(WdfInterruptGetDevice(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)

See also

EvtInterruptIsr