Registering an ISR
Drivers use the IoConnectInterruptEx routine to register an ISR for an interrupt. IoConnectInterruptEx is part of Windows Vista and later operating systems. IoConnectInterruptEx takes a single Parameters parameter, which is a pointer to an IO_CONNECT_INTERRUPT_PARAMETERS structure. For Windows Server 2003, Windows XP, and Windows 2000, drivers can use the Iointex.lib library that is included in the Windows Driver Kit (WDK).
On Windows Vista and later, IoConnectInterruptEx provides several different methods for registering an ISR. The value specified for Parameters->Version determines the method, as follows:
Use CONNECT_LINE_BASED to register an InterruptService routine for all of a device's line-based interrupts. (Devices usually have at most one line-based interrupt.) The system automatically detects any line-based interrupts assigned to the device. For more information, see Using the CONNECT_LINE_BASED Version of IoConnectInterruptEx.
Use CONNECT_MESSAGE_BASED to register an InterruptMessageService routine for all of a device's message-signaled interrupts. You can also specify a fallback InterruptService routine—if the device only has line-based interrupts, IoConnectInterruptEx registers the InterruptService routine instead. The system automatically detects any message-signaled interrupts assigned to the device. For more information, see Using the CONNECT_MESSAGE_BASED Version of IoConnectInterruptEx.
Use CONNECT_FULLY_SPECIFIED to register an InterruptService routine for each interrupt separately. You can use this to specify an InterruptService routine for either a line-based or a message-signaled interrupt, but you must manually specify the interrupt using information passed by the PnP manager. For more information, see Using the CONNECT_FULLY_SPECIFIED Version of IoConnectInterruptEx.
On operating systems prior to Windows Vista, you can only use CONNECT_FULLY_SPECIFIED. If you specify CONNECT_LINE_BASED or CONNECT_MESSAGE_BASED, IoConnectInterruptEx returns an error. You can use this behavior to determine if you are running on Windows Vista or an earlier system. For more information, see Using IoConnectInterruptEx Prior to Windows Vista.