NdisMRegisterUnloadHandler (Windows CE 5.0)

Send Feedback

This function registers an unload handler for a driver.

VOID NdisMRegisterUnloadHandler(NDIS_HANDLENdisWrapperHandle,PDRIVER_UNLOADUnloadHandler);

Parameters

  • NdisWrapperHandle
    [in] Specifies the handle returned by NdisMInitializeWrapper.

  • 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 Values

None.

Remarks

A driver calls NdisMRegisterUnloadHandler from its DriverEntry function after DriverEntry has called NdisMInitializeWrapper. 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 de-allocating resources used by the protocol portion of the driver.

A miniport, such as a load-balancing miniport, that monitors more than one miniport instance should register an unload handler that cleans up state information and de-allocates resources after the miniport 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

OS Versions: Windows CE .NET 4.0 and later.
Header: Ndis.h.
Link Library: Ndis.dll.

See Also

DriverEntry | MiniportHalt | NdisDeregisterProtocol | NdisMInitializeWrapper

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.