Поделиться через


Initializing a Bundle of Miniport Instances

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.

NDIS calls a miniport driver's MiniportInitialize function once for each network adapter that the driver manages. To support LBFO, MiniportInitialize must determine if the miniport instance being initialized belongs to an existing bundle.

To determine if a miniport instance is a member of the bundle, MiniportInitializefirst calls the NdisOpenConfiguration function to obtain the handle for a registry key in which the miniport instance's configuration parameters are stored. Next, MiniportInitialize calls the NdisReadConfiguration function to retrieve the string value (REG_SZ) from the BundleId keyword under the miniport instance's registry key. Each miniport instance should copy the bundle-identifier value to its internal structure. This internal structure is also known as MiniportAdapterContext. Each miniport instance should also copy its MiniportAdapterHandle to its MiniportAdapterContext. NDIS uses the MiniportAdapterHandle to refer to the associated miniport instance.

After the miniport instance retrieves the bundle-identifier value, the miniport instance should search through the internal structures of miniport instances that have already been initialized to locate a miniport instance that has an identical bundle-identifier value. To perform this search, the miniport instance inspects each miniport instance's MiniportAdapterContext. The miniport driver sets the miniport instance to either the primary or a secondary role, as described following:

  • The miniport instance is the first miniport instance from the bundle to be initialized. In other words, the miniport instance could not locate an identical bundle-identifier value. In this situation, the miniport instance defaults to become the primary.

  • The miniport instance locates an identical bundle-identifier value. MiniportInitialize should call the NdisMSetMiniportSecondary function to set the miniport instance to the secondary role in relation to the primary miniport instance. In this call, the miniport instance passes its handle in the MiniportAdapterHandle parameter and the handle to the primary miniport instance that has already been initialized in the PrimaryMiniportAdapterHandle parameter. The miniport instance retrieves the handle to the primary miniport instance from the primary miniport instance's MiniportAdapterContext.

Multiple secondary miniport instances can exist in a bundle. MiniportInitialize can call NdisMSetMiniportSecondary for multiple miniport instances during the initialization of each instance to set them all to secondary roles in relation to the primary miniport instance.

MiniportInitialize can call NdisMSetMiniportSecondary only if the miniport instance can potentially belong to an existing bundle of miniport instances that were initialized by the same miniport driver. Before MiniportInitialize calls NdisMSetMiniportSecondary, the miniport instance cannot be considered as part of an existing bundle. A miniport instance becomes a secondary member of an existing bundle only after a successful call to NdisMSetMiniportSecondary.

 

 

Send comments about this topic to Microsoft