KeSynchronizeExecution 函式 (wdm.h)

KeSynchronizeExecution 例程會將指定的例程的執行與指派給一或多個中斷物件的一組 isR (ISR) 同步。

語法

BOOLEAN KeSynchronizeExecution(
  [in, out]      PKINTERRUPT            Interrupt,
  [in]           PKSYNCHRONIZE_ROUTINE  SynchronizeRoutine,
  [in, optional] __drv_aliasesMem PVOID SynchronizeContext
);

參數

[in, out] Interrupt

一組中斷物件的指標。 呼叫端從 IoConnectInterruptIoConnectInterruptEx 例程取得此指標。

[in] SynchronizeRoutine

指定呼叫端提供的 SynchCritSection 例程,其執行會與指派給中斷物件的 ISR 執行同步處理。

[in, optional] SynchronizeContext

呼叫時要傳遞至 SynchCritSection 例程之呼叫端提供之內容值的指標。

傳回值

如果作業成功,KeSynchronizeExecution 會傳回 TRUE。 否則會傳回 FALSE

備註

呼叫此例程時,會發生下列情況:

  1. IRQL 會引發至呼叫 IoConnectInterruptIoConnectInterruptEx 中指定的 SynchronizeIrql 值。
  2. 如果ISR在PASSIVE_LEVEL) 执行, 則 SynchronizeContext 的存取權會與指派的 ISR 同步處理,方法是取得相關聯的中斷物件微調鎖定 (或系統事件物件。
  3. 指定的 SynchCritSection 例程是以 SyncContext 值做為其參數呼叫。
如果ISR在 DIRQL >= DISPATCH_LEVEL執行, SynchCritSection 例程會在相同的 DIRQL 上執行,因此必須盡可能執行一段時間,以避免延遲其他高優先順序的工作。

KeSynchronizeExecution 的呼叫端必須在 IRQL <= DIRQL 執行;也就是說,在 IRQL 小於或等於呼叫端向 IoConnectInterruptEx 註冊 ISR 時所指定的 SynchronizeIrql 值值。

從 Windows 8 開始,驅動程式可以呼叫 KeSynchronizeExecution,以同步處理 SynchCritSection 例程的執行與在 IRQL = PASSIVE_LEVEL執行的 ISR。 在舊版的 Windows 中, KeSynchronizeExecution 只能與在 IRQL >= DISPATCH_LEVEL上執行的 ISR 同步執行。 如需詳細資訊,請參閱 使用 Passive-Level 中斷服務例程

規格需求

需求
最低支援的用戶端 從 Windows 2000 開始提供。
目標平台 Universal
標頭 wdm.h (包括 Wdm.h、Ntddk.h、Ntifs.h)
程式庫 NtosKrnl.lib
Dll NtosKrnl.exe
IRQL <= DIRQL (請參閱一節)

另請參閱

IoConnectInterrupt

IoConnectInterruptEx