WdfInterruptSynchronize function (wdfinterrupt.h)

[Applies to KMDF and UMDF]

The WdfInterruptSynchronize method executes a specified callback function at the device's DIRQL while holding an interrupt object's spin lock.

For passive level interrupt objects, this method executes a specified callback function at passive level while holding an interrupt object's passive-level interrupt lock.

Syntax

BOOLEAN WdfInterruptSynchronize(
  [in] WDFINTERRUPT                  Interrupt,
  [in] PFN_WDF_INTERRUPT_SYNCHRONIZE Callback,
  [in] WDFCONTEXT                    Context
);

Parameters

[in] Interrupt

A handle to a framework interrupt object.

[in] Callback

A pointer to an EvtInterruptSynchronize callback function.

[in] Context

An untyped pointer to driver-supplied information that the framework passes to the EvtInterruptSynchronize callback function.

Return value

WdfInterruptSynchronize returns the Boolean status value that the EvtInterruptSynchronize callback function returns.

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

Remarks

If you want your driver to execute code that must run without being preempted and with servicing of device interrupts effectively disabled, you should place that code in an EvtInterruptSynchronize callback function. To schedule execution of the callback function, your driver must call WdfInterruptSynchronize.

The WdfInterruptSynchronize method returns after the EvtInterruptSynchronize callback function has finished executing.

Instead of calling WdfInterruptSynchronize, your driver can call WdfInterruptAcquireLock and WdfInterruptReleaseLock.

For more information about the WdfInterruptSynchronize method, see Synchronizing Interrupt Code.

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

For passive level interrupts, the driver must call WdfInterruptSynchronize at IRQL = PASSIVE_LEVEL.

Do not call WdfInterruptSynchronize from an arbitrary thread context, such as a request handler.

Examples

The following code example shows how to call WdfInterruptSynchronize to schedule execution of an EvtInterruptSynchronize callback function.

BOOLEAN synchronizeReturnValue;

synchronizeReturnValue = WdfInterruptSynchronize(
                                         WdfInterrupt,
                                         MyEvtInterruptSynchronize,
                                         CallbackContext
                                         );

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 <=DISPATCH_LEVEL
DDI compliance rules DriverCreate(kmdf), KmdfIrql(kmdf), KmdfIrql2(kmdf), KmdfIrqlExplicit(kmdf)

See also

EvtInterruptSynchronize

WdfInterruptAcquireLock

WdfInterruptReleaseLock