IoConnectInterrupt

NTSTATUS
IoConnectInterrupt(

OUT PKINTERRUPT *InterruptObject,
IN PKSERVICE_ROUTINE ServiceRoutine,
IN PVOID ServiceContext,
IN PKSPIN_LOCK SpinLock,/* optional */
IN ULONG Vector,
IN KIRQL Irql,
IN KIRQL SynchronizeIrql,
IN KINTERRUPT_MODE InterruptMode,
IN BOOLEAN ShareVector,
IN KAFFINITY ProcessorEnableMask,
IN BOOLEAN FloatingSave
);

IoConnectInterrupt registers a device driver’s ISR to be called when its device interrupts on any of a given set of processors.

Parameters

InterruptObject

Points to the address of driver-supplied storage for a pointer to a set of interrupt objects, which was obtained by calling HalGetInterruptVector. This pointer must be passed in subsequent calls to KeSynchronizeExecution.

ServiceRoutine

Points to the entry point for the driver-supplied ISR declared as follows:

BOOLEAN

(*PKSERVICE_ROUTINE)(

    IN PKINTERRUPT Interrupt,

    IN PVOID ServiceContext

    );

ServiceContext

Points to the driver-determined context with which the specified ISR will be called. The ServiceContext area must be in resident memory: in the device extension of a driver-created device object, in the controller extension of a driver-created controller object, or in nonpaged pool allocated by the device driver.

SpinLock

Points to an initialized spin lock, for which the driver supplies the storage, that will be used to synchronize access to driver-determined data shared by other driver routines. This parameter is required if the ISR handles more than one vector or if the driver has more than one ISR. Otherwise, the driver need not allocate storage for an interrupt spin lock and the input pointer is NULL.

Vector

Specifies the interrupt vector returned by the driver’s call to HalGetInterruptVector.

Irql

Specifies the DIRQL returned by HalGetInterruptVector for the Vector.

SynchronizeIrql

Specifies the DIRQL at which the ISR will execute. If the ISR handles more than one interrupt vector or the driver has more than one ISR, this value must be the highest of the Irql values returned by calls to HalGetInterruptVector for each vector. Otherwise, the Irql and SynchronizeIrql values are identical.

InterruptMode

Specifies whether the device interrupt is LevelSensitive or Latched.

ShareVector

Specifies whether the interrupt vector is sharable.

ProcessorEnableMask

Specifies the set of processors on which device interrupts can occur in this platform. This value also was returned by HalGetInterruptVector.

FloatingSave

Specifies whether to save the floating-point stack when the driver’s device interrupts. For X86-based platforms, this value must be set to FALSE.

Return Value

IoConnectInterrupt can return one of the following NTSTATUS values:

STATUS_SUCCESS
STATUS_INVALID_PARAMETER
STATUS_INSUFFICIENT_RESOURCES

Comments

If the driver supplies the storage for the SpinLock, it must call KeInitializeSpinLock before passing its interrupt spin lock to IoConnectInterrupt.

On return from a successful call to IoConnectInterrupt, the caller’s ISR can be called if interrupts are enabled on the driver’s device or if ShareVector was set to TRUE.

Callers of IoConnectInterrupt must be running at IRQL PASSIVE_LEVEL.

See Also

HalGetInterruptVector, KeInitializeSpinLock, KeSynchronizeExecution