Adding a NIC (NDIS 5.1)
Note NDIS 5. x has been deprecated and is superseded by NDIS 6. x. For new NDIS driver development, see Network Drivers Starting with Windows Vista. For information about porting NDIS 5. x drivers to NDIS 6. x, see Porting NDIS 5.x Drivers to NDIS 6.0.
The following description starts with the loading of the miniport driver. For the initial processing performed by the PnP manager when a NIC is added to a running system, see Steps 1-11 of Adding a PnP Device to a Running System.
If the miniport driver for the NIC is not already loaded, the PnP manager loads the driver and then calls the miniport driver's DriverEntry function. If the driver is already loaded, processing continues with Step 4.
From its DriverEntry function, the miniport driver calls:
- NdisMInitializeWrapper to associate itself with NDIS.
- NdisMRegisterMiniport to specify the NDIS version with which it is compatible and the entry points of the MiniportXxx functions that it exports.
- NdisMRegisterUnloadHandler to register an Unload routine with NDIS. (The call to AddDevice is optional.)
NDIS fills in the following entries in the driver object for the miniport driver:
- The entry point for the AddDevice routine.
- The DispatchXxx entry points for handling IRPs.
- The entry point for the Unload routine that the miniport driver registered with NdisMRegisterUnloadHandler.
The PnP manager calls NDIS's AddDevice routine. NDIS's AddDevice routine creates an FDO for the newly added NIC and attaches this FDO to the device stack for the NIC.
NDIS reads information from the registry to obtain configuration information for the NIC. This information includes binding information and the hardware attributes of the NIC.
The PnP manager assigns resources to the NIC, if necessary.