註冊 ISR

驅動程式會使用 IoConnectInterruptEx 常式來註冊 ISR 以進行中斷。 IoConnectInterruptEx 是 Windows Vista 和更新版本的作業系統的一部分。 IoConnectInterruptEx 會採用單一 Parameters 參數,這是 IO_CONNECT_INTERRUPT_PARAMETERS 結構的指標。 針對 Windows Server 2003、Windows XP 和 Windows 2000,驅動程式可以使用 Windows Driver Kit (WDK) 中包含的 Iointex.lib 程式庫。

在 Windows Vista 和更新版本上, IoConnectInterruptEx 提供數種不同的方法來註冊 ISR。 針對Parameters-Version> 指定的值會決定 方法,如下所示:

在 Windows Vista 之前的作業系統上,您只能使用 CONNECT_FULLY_SPECIFIED。 如果您指定CONNECT_LINE_BASED或CONNECT_MESSAGE_BASED, IoConnectInterruptEx 會傳回錯誤。 您可以使用此行為來判斷您是否在 Windows Vista 或舊版系統上執行。 如需詳細資訊,請參閱 在 Windows Vista 之前使用 IoConnectInterruptEx