共用方式為


KeSynchronizeExecution 函式 (wdm.h)

KeSynchronizeExecution 例程會同步執行指定的例程與指派給一或多個中斷物件的一組中斷服務例程 (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 TRUE。 否則,它會 FALSE傳回 。

言論

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

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

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

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

要求

要求 價值
最低支援的用戶端 從 Windows 2000 開始提供。
目標平臺 普遍
標頭 wdm.h (包括 Wdm.h、Ntddk.h、Ntifs.h)
連結庫 NtosKrnl.lib
DLL NtosKrnl.exe
IRQL <= DIRQL (請參閱一節)

另請參閱

IoConnectInterrupt

IoConnectInterruptEx