Microsoft Windows CE 3.0  


This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

This function sets up a mapping between an NIC driver's MiniportISRand MiniportHandleInterruptfunctions, already registered with NdisMRegisterMiniport, and the bus-relative vector and level on which its NIC interrupts.

NDIS_STATUS NdisMRegisterInterrupt(


Pointer to caller-allocated resident memory containing an opaque interrupt object, which this function initializes and for which it returns a handle that the miniport uses in subsequent calls to the NdisMSynchronizeWithInterruptfunction.
Handle input to the MiniportInitializefunction.
Specifies the bus-relative vector number used by the NIC.
Specifies the bus-relative DIRQL for the interrupt. This value is almost always the same as that of InterruptVector.
Specifies TRUE if the MiniportISRfunction should be called each time the NIC interrupts. If the NIC can share an interrupt with other devices on the I/O bus, this parameter must be set to TRUE.
Specifies TRUE if other devices on the I/O bus can use this interrupt line. If this parameter is set to FALSE and another device has already claimed the specified interrupt vector in the registry, this function fails.
Specifies the type of interrupt that the NIC generates as one of the following values:
Value Description
NdisInterruptLatched Interrupts are triggered by a transition from low to high on the interrupt line.
NdisInterruptLevelSensitive Interrupts are active as long as the interrupt line is asserted.

Return Values

Returns one of the following values:

NDIS initialized the interrupt object and returned a valid Interrupthandle, claimed hardware resources in the registry for the NIC, such as the specified vector if the NIC does not share an IRQ, and set up the MiniportISRor MiniportDisableInterruptand associated MiniportHandleInterruptfunctions to be called when an interrupt occurs as requested in the call to this function.
An attempt to claim the vector or level in the registry has failed, possibly because another driver already claimed the interrupt for its device. This function logs an error if this occurs.
NDIS could not allocate sufficient memory to claim resources in the registry for the NIC.
The attempt to initialize the interrupt object failed, possibly due to another driver's prior claim on the InterruptVectoror InterruptLevelin the registry.


An NIC driver must call this function from its MiniportInitializefunction if its NIC generates interrupts. The driver of an NIC that does not generate interrupts calls the NdisMInitializeTimerand NdisMSetPeriodicTimerfunctions instead of this function.

MiniportInitializemust call NdisMSetAttributesor NdisMSetAttributesExbefore calling this function.

MiniportInitializeobtains the bus-relative values passed to this function either from the registry or by calling a bus-type-specific Ndis XXXconfiguration function.

If its call to this function fails, MiniportInitializereleases all resources that it already allocated for its NIC, and then fails initialization for that NIC.

This function distinguishes between the InterruptVectorand the InterruptLevel. The InterruptVectoris the interrupt line that the card asserts to interrupt the system, and the InterruptLevelis the hardware priority, that is, the DIRQL, of that interrupt assigned by the system. Usually, these values can be assumed to be equal unless the driver writer knows that they are different for a particular NIC or unless the miniport controls multiple NICs that share resources in the current platform.

If its NIC can share an IRQ with other devices on the I/O bus, the caller of this function must set both the SharedInterruptand RequestIsrparameters to TRUE. Such an NIC driver's MiniportISRfunction can be called when no interrupt for the NIC is outstanding. In these circumstances, MiniportISRreturns FALSE as soon as possible, indicating that the interrupt was not recognized and should leave interrupts enabled on its NIC.

When interrupts are enabled on the NIC, a driver's MiniportISRfunction can be called at any time following a successful call to this function, even during initialization. Such a driver's MiniportInitializefunction should not call this function until it has set up all state that the driver needs to handle an interrupt. The MiniportHandleInterruptfunction is not queued for subsequent execution if the driver's MiniportInitializefunction is currently executing and an interrupt occurs.

For most drivers of NICs that do not share an IRQ, MiniportISRseldom runs except, possibly, during driver initialization. Such a miniport sets RequestIsrto FALSE when MiniportInitializecalls this function, and such a driver has a MiniportDisableInterruptfunction and, possibly, a MiniportEnableInterruptfunction. The NDIS library then calls the driver's MiniportDisableInterruptfunction when an interrupt occurs on the NIC, and the driver's MiniportHandleInterruptfunction does most of the I/O processing for the interrupt. Before MiniportHandleInterruptreturns control, either NDIS calls MiniportEnableInterruptor MiniportHandleInterruptre-enables interrupts on the NIC itself.

Whether a miniport with an ISR sets RequestIsrto TRUE when it calls this function or not, NDIS acknowledges the interrupt to the operating system so that interrupts from other devices are not blocked.

If a miniport sets RequestIsrto TRUE when it calls this function, it must dismiss the interrupt on its NIC by setting the state of the NIC so that it no longer asserts the interrupt. Interrupts can remain enabled on the NIC following the dismissal of the interrupt, or they can be disabled, depending on the design of the driver. The timing of such a dismissal depends on the InterruptModespecified when the driver calls this function, as follows:

  • For NdisInterruptLevelSensitive interrupts, MiniportISRmust dismiss each interrupt as its NIC generates that interrupt. Otherwise, the interrupt is reasserted on the NIC as soon as MiniportISRreturns control. If MiniportISRdetermines that the NIC did not generate a particular interrupt, it returns control with FALSE as soon as possible so that the ISRs for other devices on the same bus can be called promptly to dismiss the interrupt on the device that actually generated that interrupt.
  • For NdisInterruptLatched interrupts, dismissing an interrupt on the NIC is not as time-critical as it is for shared interrupts. If the miniport is designed so that each call to MiniportISRcauses a subsequent call to the associated MiniportHandleInterruptfunction, MiniportHandleInterruptdismisses the interrupt on the NIC. As an alternative, such a driver can set RequestIsrto FALSE when it calls this function and supply a MiniportDisableInterruptfunction, which is called instead of MiniportISR,unless MiniportHaltor MiniportInitializeis currently executing.

    When a miniport supports full-duplex sends and receives, NDIS serializes calls to its MiniportISRor MiniportDisableInterruptfunction for sends. NDIS separately serializes calls to its MiniportISRor MiniportDisableInterruptfunction for all other operations that can cause an interrupt. Calls to the MiniportResetfunction are both synchronized and synchronous; NDIS prevents all other code paths in a full-duplex miniport from being entered while a device-reset operation is occurring.

    If a miniport does not support full-duplex sends and receives, NDIS serializes all calls to the MiniportISRor the MiniportDisableInterruptfunction for any NIC that the miniport controls. While such a driver's MiniportISRor MiniportDisableInterruptfunction is processing a particular NIC interrupt, it is not called to handle a second interrupt from the same NIC on another processor in a symmetric multiprocessor (SMP) platform.

    However, the ISR or MiniportDisableInterruptfunction of any driver that controls more than one device can run concurrently in SMP platforms if two of that driver's devices happen to generate interrupts almost simultaneously and interrupts are enabled on the NIC.

    If it is possible that an interrupt can occur while another driver function is accessing resources that can also be accessed from MiniportISRor MiniportDisableInterrupt, the other function must call NdisMSynchronizeWithInterruptto have the driver-supplied MiniportSynchronizeISRfunction access the shared resources at DIRQL.

    A driver that calls this function runs at IRQL PASSIVE_LEVEL.


    Runs on Versions Defined in Include Link to
    Windows CE OS 2.0 and later Ndis.h    
    Note   This API is part of the complete Windows CE OS package as provided by Microsoft. The functionality of a particular platform is determined by the original equipment manufacturer (OEM) and some devices may not support this API.

    See Also

    NdisMDeregisterInterrupt, NdisMInitializeTimer, NdisMPciAssignResources, NdisMSetAttributes, NdisMSetAttributesEx, NdisMSetPeriodicTimer, NdisMSynchronizeWithInterrupt, NdisOpenConfiguration, NdisReadPciSlotInformation

     Last updated on Tuesday, July 13, 2004

    © 2004 Microsoft Corporation. All rights reserved.