From its DriverEntry function, a miniport driver calls NdisMInitializeWrapper to notify NDIS that the driver is about to register itself as a miniport driver. After NdisMInitializeWrapper successfully returns, the miniport driver calls either NdisMRegisterMiniport or NdisIMRegisterLayeredMiniport to register its entry points with NDIS.
If a miniport driver's call to NdisMRegisterMiniport or NdisIMRegisterLayeredMiniport does not return NDIS_STATUS_SUCCESS, the miniport driver must call NdisTerminateWrapper. Calling NdisTerminateWrapper causesNDIS to clean up the resources that it allocated when the miniport driver called NdisMInitializeWrapper.