OnInterruptEnable function

[Applies to UMDF 1.x only]

A driver's OnInterruptEnable event callback function enables a specified hardware interrupt.

Syntax


WUDF_INTERRUPT_ENABLE OnInterruptEnable;

HRESULT OnInterruptEnable(
  _In_  IWDFInterrupt *pInterrupt,
  _In_  IWDFDevice *pAssociatedDevice
)
{ ... }

Parameters

pInterrupt [in]

A pointer to the IWDFInterrupt interface.

pAssociatedDevice [in]

A pointer to the IWDFDevice interface that the driver used to call CreateInterrupt.

Return value

The callback function must return S_OK if the operation succeeds. Otherwise, the callback should return one of the error codes that are defined in Winerror.h.

Remarks

To register an OnInterruptEnable callback function, your driver must place the callback function's address in a WUDF_INTERRUPT_CONFIG structure before calling IWDFDevice::CreateInterrupt.

The framework calls the driver's OnInterruptEnable callback function each time the device enters its working (D0) state. Additionally, a driver can cause the framework to call the OnInterruptEnable callback function by calling IWDFInterrupt::Enable.

Before calling the OnInterruptEnable callback function, the framework acquires the user-mode interrupt lock.

After calling the OnInterruptEnable callback function, the framework calls the driver's OnD0EntryPostInterruptsEnabled event callback function.

For more information about handling interrupts in UMDF drivers, see Accessing Hardware and Handling Interrupts.

Examples

The function type is declared in Wudfinterrupt.h, as follows.


typedef
__drv_functionClass(WUDF_INTERRUPT_ENABLE)
HRESULT
WUDF_INTERRUPT_ENABLE(
    _In_
    IWDFInterrupt* Interrupt,
    _In_
    IWDFDevice* AssociatedDevice
    );

typedef WUDF_INTERRUPT_ENABLE *PFN_WUDF_INTERRUPT_ENABLE;

To define an OnInterruptEnable callback function that is named MyInterruptEnable, you must first provide a function declaration that SDV and other verification tools require, as follows:


WUDF_INTERRUPT_ENABLE  MyInterruptEnable;

Then, implement your callback function as follows:


HRESULT
  MyInterruptEnable (
    IN IWDFInterrupt* pInterrupt,
    IN IWDFDevice*  pAssociatedDevice
    )
  {…}


Requirements

End of support

Unavailable in UMDF 2.0 and later.

Minimum UMDF version

1.11

Header

Wudfinterrupt.h

See also

WUDF_INTERRUPT_CONFIG
IWDFDevice::CreateInterrupt
OnInterruptDisable

 

 

Send comments about this topic to Microsoft

Show:
© 2015 Microsoft