Initializing a Virtual Miniport
To initiate the initialization of a virtual miniport, an intermediate driver calls the NdisIMInitializeDeviceInstanceEx function. The intermediate driver usually makes this call from its ProtocolBindAdapterEx function. After the intermediate driver calls NdisIMInitializeDeviceInstanceEx and the Plug an Play manager requests NDIS to start the virtual device, NDIS calls the driver's MiniportInitializeEx function.
The call to MiniportInitializeEx can be in the context of NdisIMInitializeDeviceInstanceEx if the Plug and Play manager starts the virtual device before NdisIMInitializeDeviceInstanceEx returns. If the intermediate driver provides more than one virtual miniport, the driver must call NdisIMInitializeDeviceInstanceEx for each virtual miniport that it makes available.
NDIS passes initialization parameters to MiniportInitializeEx in an NDIS_MINIPORT_INIT_PARAMETERS structure at MiniportInitParameters . The IMDeviceInstanceContext member of the structure specifies a pointer to the context area for a virtual device. The driver passed this pointer to the NdisIMInitializeDeviceInstanceEx function at the DeviceContext parameter.
In MiniportInitializeEx, the intermediate driver performs the operations required to initialize a virtual miniport. This initialization is similar to the initialization of any other miniport adapter.