NdisMRegisterUnloadHandler (Windows Embedded CE 6.0)

1/6/2010

This function registers an unload handler for a driver.

Syntax

VOID NdisMRegisterUnloadHandler(
  NDIS_HANDLE NdisWrapperHandle,
  PDRIVER_UNLOAD UnloadHandler
);

Parameters

  • UnloadHandler
    [in] Specifies the entry point for the driver's unload routine. An unload routine is declared as follows.

    VOID
    (*PDRIVER_UNLOAD) (
      IN struct _DRIVER_OBJECT *DriverObject
    );
    

Return Value

None.

Remarks

A driver calls NdisMRegisterUnloadHandler from its DriverEntry function after DriverEntry has called NdisMRegisterMiniport or NdisIMRegisterLayeredMiniport. NdisMRegisterUnloadHandler registers an unload handler for the driver.

The functionality of the unload handler is driver-specific. For example, an intermediate driver should register an unload handler that calls NdisDeregisterProtocol to deregister the protocol portion of the intermediate driver. The unload handler should also perform any necessary cleanup operations, such as deallocating resources used by the protocol portion of the driver.

A miniport, such as a load-balancing miniport driver, that monitors more than one miniport driver instance should register an unload handler that cleans up state information and deallocates resources after the miniport driver instances that it monitors are halted. Note that an unload handler differs from a MiniportHalt function: the unload handler has a more global scope, whereas the scope of the MiniportHalt function is restricted to a particular miniport instance.

Requirements

Header ndis.h
Library ndis.dll
Windows Embedded CE Windows CE .NET 4.0 and later

See Also

Reference

NDIS Library Functions
DriverEntry
MiniportHalt
NdisDeregisterProtocol
NdisMRegisterMiniport
NdisIMRegisterLayeredMiniport