Microsoft Windows CE 3.0  

MiniportHalt

Important:
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.

MiniportHaltis a required function that deallocates resources when the network adapter is removed and halts the network adapter.

VOID
MiniportHalt(
IN NDIS_HANDLE
MiniportAdapterContext
);

Parameters

MiniportAdapterContext

Specifies the handle to a miniport-allocated context area in which the driver maintains per-network adapter state, set up by MiniportInitialize.

Comments

MiniportHaltshould stop the network adapter, if it controls a physical network adapter, and must free all resources that the driver allocated for its network adapter before MiniportHaltreturns control. In effect, MiniportHaltundoes everything that was done by MiniportInitializefor a particular network adapter.

If the network adapter driver allocated memory, claimed an I/O port range, mapped on-board device memory to host memory, initialized timer(s) and/or spin lock(s), allocated map registers or claimed a DMA channel, and registered an interrupt, that driver must call the reciprocals of the Ndis XXXfunctions with which it originally allocated these resources.

As a general rule, a MiniportHaltfunction should call reciprocal Ndis XXXfunctions in inverse order to the calls the driver made from MiniportInitialize. That is, if a network adapter driver's MiniportInitializefunction called NdisMRegisterAdapterShutdownHandlerjust before it returned control, its MiniportHaltfunction would call NdisMDeregisterAdapterShutdownHandlerfirst.

If its network adapter generates interrupts or shares an IRQ, a network adapter driver's MiniportHaltfunction can be pre-empted by its MiniportISRor MiniportDisableInterruptfunction until MiniportHaltcalls NdisMDeregisterInterrupt. Such a driver's MiniportHaltfunction usually disables interrupts on the network adapter, if possible, and calls NdisMDeregisterInterruptas soon as it can.

If the driver has a MiniportTimerfunction associated with any timer object that might be in the system timer queue, MiniportHaltshould call NdisMCancelTimer.

Otherwise, it is unnecessary for the miniport to complete outstanding requests to its network adapter before MiniportHaltbegins releasing allocated resources. NDIS submits no further requests to the miniport for the network adapter designated by the MiniportAdapterContexthandle when NDIS has called MiniportHalt. On return from MiniportHalt, NDIS cleans up any state it was maintaining about this network adapter and about its driver if this miniport supports no other network adapters in the current machine.

An NDIS intermediate driver's call to NdisIMDeinitializeDeviceInstancecauses a call to its MiniportHaltfunction.

Requirements

Runs on Versions Defined in Include Link to
Windows CE OS 2.0 and later Ndis.h   Ndislib.lib
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

MiniportDisableInterrupt, MiniportInitialize, MiniportISR, NdisFreeMemory, NdisFreeSpinLock, NdisIMDeinitializeDeviceInstance, NdisMCancelTimer, NdisMDeregisterAdapterShutdownHandler, NdisMDeregisterInterrupt, NdisMDeregisterIoPortRange, NdisMFreeMapRegisters, NdisMRegisterAdapterShutdownHandler, NdisMUnmapIoSpace, ProtocolUnbindAdapter