다음을 통해 공유


MiniportDriverUnload (Compact 2013)

3/26/2014

NDIS calls a miniport driver's MiniportDriverUnload function to request the driver to release resources before the system completes a driver unload operation.

Syntax

VOID  MiniportDriverUnload(
    PDRIVER_OBJECT DriverObject
);

Parameters

  • DriverObject
    [in] A pointer to a DRIVER_OBJECT structure that is the driver's driver object.

Return Value

None.

Remarks

A driver specifies the MiniportDriverUnload entry point when it calls the NdisMRegisterMiniportDriver function.

The driver object that is associated with an NDIS miniport driver specifies an Unload routine. The operating system calls the Unload routine when all the devices the miniport driver services have been removed. NDIS provides the Unload routine for NDIS drivers. NDIS calls a miniport driver's MiniportDriverUnload function from the Unload routine.

The functionality of the Unload routine is driver-specific. Generally, MiniportDriverUnload should undo the operations that were performed in the driver's DriverEntry routine.

A miniport driver calls the NdisMDeregisterMiniportDriver function from MiniportDriverUnload.

In addition to NdisMDeregisterMiniportDriver, an intermediate driver also calls the NdisDeregisterProtocolDriver function to deregister the protocol interface of the driver. MiniportDriverUnload should also perform any necessary cleanup operations, such as deallocating any protocol driver interface resources.

If a miniport driver manages more than one device instance, such as a load-balancing driver, NDIS will not call MiniportDriverUnload until after NDIS calls the MiniportHaltEx function one time for each device instance.

NDIS calls MiniportDriverUnload at IRQL = PASSIVE_LEVEL.

See Also

Reference

NDIS Miniport Driver Functions
MiniportHaltEx
NdisDeregisterProtocolDriver
NdisMDeregisterMiniportDriver
NdisMRegisterMiniportDriver