NdisIMInitializeDeviceInstance

NDIS_STATUS
NdisIMInitializeDeviceInstance(
IN NDIS_HANDLE DriverHandle,
IN PNDIS_STRING DeviceInstance
);

NdisIMInitializeDeviceInstance calls an NDIS intermediate driver's MiniportInitialize function to set up the driver's virtual NIC for I/O operations on an underlying NIC driver to which the intermediate driver is bound.

Parameters

DriverHandle

Specifies the handle returned by NdisIMRegisterLayeredMiniport.

DeviceInstance

Points to a buffered, caller-initialized counted string, in the system-default character set, naming the registry key in which the driver stores information about its virtual NIC and, possibly, binding-specific information. For Windows NT drivers, this string contains Unicode characters.

Return Value

NdisIMInitializeDeviceInstance propagates the status returned by the MiniportInitialize function.

Comments

An NDIS intermediate driver usually calls NdisIMInitializeDeviceInstance from its ProtocolBindAdapter function.

The driver's installation script created the key designated by DeviceInstance in the HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services registry tree.

Before it calls NdisIMInitializeDeviceInstance, ProtocolBindAdapter must make a successful call to NdisOpenAdapter, thereby binding the intermediate driver to the underlying NIC driver. Then, its subsequent call to NdisIMInitializeDeviceInstance allows the driver's MiniportInitialize function to allocate any resources the driver needs to carry out network I/O operations and to initialize the driver's virtual NIC, to which higher-level protocol drivers can bind themselves when the NDIS intermediate driver's initialization is complete.

Callers of NdisIMInitializeDeviceInstance run at IRQL PASSIVE_LEVEL.

See Also

MiniportInitialize, NdisIMDeInitializeDeviceInstance, NdisIMRegisterLayeredMiniport, NdisInitializeString, NdisOpenAdapter, ProtocolBindAdapter