ADAPTER_SHUTDOWN_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 MiniportShutdown function restores a NIC to its initial state when the system is shut down, whether by the user or because an unrecoverable system error occurred.

Syntax

ADAPTER_SHUTDOWN_HANDLER MiniportShutdown;

VOID MiniportShutdown(
  _In_ PVOID ShutdownContext
)
{ ... }

Parameters

  • ShutdownContext [in]
    Pointer to a context area supplied when the miniport driver's MiniportInitialize function called NdisMRegisterAdapterShutdownHandler. Usually, this input parameter is the NIC-specific MiniportAdapterContext pointer passed to other MiniportXxx functions.

Return value

None

Remarks

Every miniport driver should have a MiniportShutdown function. NDIS 5.1 miniport drivers and intermediate drivers must register a MiniportShutdown function.

MiniportShutdown does nothing more than restore the NIC to its initial state (before the miniport's DriverEntry function runs). However, this ensures that the NIC is in a known state and ready to be reinitialized when the machine is rebooted after a system shutdown occurs for any reason, including a crash dump.

An NDIS 5.0 miniport driver's or intermediate driver's MiniportInitialize function must call NdisMRegisterAdapterShutdownHandler to set up a MiniportShutdown function. The driver's MiniportHalt function must make a reciprocal call to NdisMDeregisterAdapterShutdownHandler.

An NDIS 5.1 miniport driver or intermediate driver, however, should register its MiniportShutdown function in the call to NdisMRegisterMiniport or NdisIMRegisterLayeredMiniport, respectively.

If MiniportShutdown is called due to a user-initiated system shutdown, it runs at IRQL = PASSIVE_LEVEL in a system-thread context. If it is called due to an unrecoverable error, MiniportShutdown runs at an arbitrary IRQL and in the context of whatever component raised the error. For example, MiniportShutdown might be run at high DIRQL in the context of an ISR for a device essential to continued execution of the system.

MiniportShutdown should call no NdisXxx functions.

Requirements

Target platform

Desktop

Version

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

Header

Ndis.h (include Ndis.h)

See also

MiniportHalt

MiniportInitialize

NdisIMRegisterLayeredMiniport

NdisMDeregisterAdapterShutdownHandler

NdisMRegisterAdapterShutdownHandler

NdisMRegisterMiniport

NdisRawReadPortBufferUchar

NdisRawReadPortBufferUlong

NdisRawReadPortBufferUshort

NdisRawReadPortUchar

NdisRawReadPortUlong

NdisRawReadPortUshort

NdisRawWritePortBufferUchar

NdisRawWritePortBufferUlong

NdisRawWritePortBufferUshort

NdisRawWritePortUchar

NdisRawWritePortUlong

NdisRawWritePortUshort

NdisReadRegisterUchar

NdisReadRegisterUlong

NdisReadRegisterUshort

NdisWriteRegisterUchar

NdisWriteRegisterUlong

NdisWriteRegisterUshort

 

 

Send comments about this topic to Microsoft