[仅适用于 KMDF]
WdfInterruptReportActive 通知系统中断处于活动状态,并且驱动程序已准备好处理关联线路上的中断请求。
语法
VOID WdfInterruptReportActive(
  [in] WDFINTERRUPT Interrupt
);
参数
[in] Interrupt
框架中断对象的句柄。
返回值
无
备注
只有实现功能状态电源管理的驱动程序才调用 WdfInterruptReportActive。
驱动程序不需要在创建中断后立即调用 WdfInterruptReportActive 。 驱动程序应仅在之前调用 WdfInterruptReportInactive 之后调用 WdfInterruptReportActive。
通常,驱动程序从其 ComponentActiveConditionCallback 例程调用 WdfInterruptReportActive,或者在 State 为 0 时从 ComponentIdleStateCallback 调用 WdfInterruptReportActive, (指示完全处于 F0 状态) 。
如果驱动程序在早于 Windows 8 的操作系统上调用此方法,则框架的验证程序会报告错误。
有关详细信息,请参阅 支持功能电源状态。
示例
以下示例演示驱动程序如何从 KMDF 驱动程序的 ComponentIdleStateCallback 例程调用 WdfInterruptReportActive。 驱动程序通过调用 WdfDeviceWdmAssignPowerFrameworkSettings 注册单个组件。
VOID
MyComponentIdleStateCallback(
    _In_ PVOID Context,
    _In_ ULONG Component,
    _In_ ULONG State
    )
{
    PFDO_DEVICE_DATA deviceData;
    PINTERRUPT_CONTEXT interruptContext;
    deviceData = FdoGetData((WDFDEVICE)Context);
    interruptContext = InterruptGetData(deviceData->Interrupt);
    switch (State) {
        case 0:
            if (interruptContext->ReportedInactive) {
                //
                // the interrupt was reported inactive earlier. We need to report active now.
                //
                WdfInterruptReportActive(deviceData->Interrupt);
                interruptContext->ReportedInactive = FALSE;
                //
                // Enable interrupt generation at hardware.
                // 
                WdfInterruptAcquireLock(deviceData->Interrupt);
                EnableInterruptInHardware();
                WdfInterruptReleaseLock(deviceData->Interrupt);
            }
        break;
    …
}
要求
| 要求 | 值 | 
|---|---|
| 最低受支持的客户端 | Windows 8 | 
| 目标平台 | 通用 | 
| 最低 KMDF 版本 | 1.11 | 
| 标头 | wdfinterrupt.h (包括 Wdf.h) | 
| Library | Wdf01000.sys (请参阅框架库 Versioning.) | 
| IRQL | <=DISPATCH_LEVEL | 
| DDI 符合性规则 | DriverCreate (kmdf) |