Updating the DriverEntry Routine for an NDIS 6.0 Miniport Driver

Like NDIS 5.x, NDIS 6.0 miniport drivers register with NDIS in the DriverEntry routine. In NDIS 6.0, the NdisMInitializeWrapper and NdisMRegisterUnloadHandler functions are eliminated, along with the NdisMRegisterMiniport function. To register the miniport driver with NDIS 6.0, call the NdisMRegisterMiniportDriver function.

NDIS 6.0 miniport drivers do not call NdisMRegisterUnloadHandler to register an unload function. Instead, NDIS 6.0 miniport drivers specify a MiniportDriverUnload entry point in the NDIS_MINIPORT_DRIVER_CHARACTERISTICS structure. Unlike NDIS 5.x miniport drivers, NDIS 6.0 miniport drivers must register an unload handler.

Like NdisMRegisterMiniport, the input parameters to NdisMRegisterMiniportDriver include the driver object, registry path, and the driver characteristics structure. In addition, NdisMRegisterMiniportDriver requires a pointer to an NDIS_HANDLE variable. NDIS provides the handle to identify the driver.

If an error occurs after a successful call to NdisMRegisterMiniportDriver, the driver must call the NdisMDeregisterMiniportDriver function before DriverEntry returns. NDIS 6.0 miniport drivers do not call the NdisTerminateWrapper function.

If the call to NdisMRegisterMiniportDriver succeeds, the miniport driver must later call the NdisMDeregisterMiniportDriver function. Call NdisMDeregisterMiniportDriver in the context of the miniport driver's MiniportDriverUnload function.

For more information about NDIS 6.0 driver initialization, see Initializing a Miniport Driver.