2.3  IRQLs

Every driver function called by NDIS runs at a system-determined IRQL, one of PASSIVE_LEVEL < DISPATCH_LEVEL < DIRQL. For instance, the initialization function, halt function, reset function, and sometimes the shutdown function run at PASSIVE_LEVEL. Interrupt code runs at DIRQL. All other NDIS driver functions run at DISPATCH_LEVEL.

The IRQL at which a driver runs affects which NDIS functions it can call. Certain functions can only be called at IRQL PASSIVE_LEVEL. Others can be called at DISPATCH_LEVEL or lower. A driver writer should check every NDIS function for IRQL restrictions.

Any driver function that shares resources with the driver's ISR must be able to raise its IRQL to DIRQL to prevent race conditions. NDIS provides such a mechanism.