WdfInterruptReportActive 函式 (wdfinterrupt.h)

[僅適用於 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
目標平台 Universal
最小 KMDF 版本 1.11
標頭 wdfinterrupt.h (包含 Wdf.h)
程式庫 Wdf01000.sys (請參閱 Framework Library Versioning.)
IRQL <=DISPATCH_LEVEL
DDI 合規性規則 DriverCreate (kmdf)

另請參閱

WdfInterruptReportInactive