W_CHECK_FOR_HANG_HANDLER callback function

Note NDIS 5. x has been deprecated and is superseded by NDIS 6. x. For new NDIS driver development, see Network Drivers Starting with Windows Vista. For information about porting NDIS 5. x drivers to NDIS 6. x, see Porting NDIS 5.x Drivers to NDIS 6.0.

The MiniportCheckForHang function is an optional function that reports the state of the NIC, or monitors the responsiveness of an underlying device driver.



BOOLEAN MiniportCheckForHang(
  _In_ NDIS_HANDLE MiniportAdapterContext
{ ... }


  • MiniportAdapterContext [in]
    Specifies the handle to a miniport driver-allocated context area in which the driver maintains per-NIC state, set up by MiniportInitialize.

Return value

MiniportCheckForHang returns TRUE if the driver determines that its NIC is not operating or if an intermediate driver determines that the underlying device driver is unresponsive.


In NIC drivers, MiniportCheckForHang does nothing more than check the internal state of the NIC and return TRUE if it detects that the NIC is not operating correctly.

In intermediate drivers, MiniportCheckForHang can periodically check the state of the driver's virtual NIC to determine whether the underlying device driver appears to be hung.

By default, the NDIS library calls MiniportCheckForHang approximately every two seconds.

If MiniportCheckForHang returns TRUE, NDIS then calls the driver's MiniportReset function.

If a NIC driver has no MiniportCheckForHang function and NDIS judges the driver unresponsive as, for example, when NDIS holds many pending sends and requests queued to the miniport driver for a time-out interval, NDIS calls the driver's MiniportReset function. The NDIS library's default time-out interval for queued sends and requests is around four seconds. However, a NIC driver's MiniportInitialize function can extend NDIS's time-out interval by calling NdisMSetAttributesEx from MiniportInitialize to avoid unnecessary resets.

The MiniportInitialize function of an intermediate driver should disable NDIS's time-out interval with NdisMSetAttributesEx because such a driver can neither control nor estimate a reasonable completion interval for the underlying device driver.

MiniportCheckForHang can be preempted by an interrupt.


Target platform



Not supported for NDIS 6.0 drivers in Windows Vista. Use MiniportCheckForHangEx instead. Supported for NDIS 5.1 drivers in Windows Vista and Microsoft Windows XP.


Ndis.h (include Ndis.h)



See also




Send comments about this topic to Microsoft