Previous Next

NdisIMInitializeDeviceInstance

An NDIS intermediate driver calls the NdisIMInitializeDeviceInstance function to initiate the initialization operation for a virtual NIC.

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

Parameters

DriverHandle
Specifies the handle returned by NdisIMRegisterLayeredMiniport.
DeviceInstance
Pointer to an NDIS_STRING type that describes a 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 2000 and later drivers, this string contains Unicode characters. That is, for Windows 2000 and later, NDIS defines the NDIS_STRING type as a UNICODE_STRING type.

Return Values

NdisIMInitializeDeviceInstanceEx can return either of the following:

NDIS_STATUS_SUCCESS
NDIS initiated the initialization operation for the intermediate driver's virtual NIC.
NDIS_STATUS_NOT_ACCEPTED
NdisIMInitializeDeviceInstanceEx failed because the device specified by DriverHandle has already been initialized.

Headers

Declared in Ndis.h. Include Ndis.h.

Comments

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

Before it calls NdisIMInitializeDeviceInstance, ProtocolBindAdapter should bind the intermediate driver to any underlying NIC drivers that the intermediate driver requires to function. 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.

Before NDIS calls an intermediate driver’s MiniportInitialize function, the driver can call NdisIMCancelInitializeDeviceInstance to cancel the initialization operation.

After NDIS calls an intermediate driver’s MiniportInitialize function, the driver must call NdisIMDeInitializeDeviceInstance to reverse the initialization operation.

Callers of NdisIMInitializeDeviceInstance run at IRQL = PASSIVE_LEVEL.

See Also

ANSI_STRING, MiniportInitialize, NdisIMCancelInitializeDeviceInstance, NdisIMDeInitializeDeviceInstance, NdisIMInitializeDeviceInstanceEx, NdisIMRegisterLayeredMiniport, NdisInitializeString, NdisOpenAdapter, ProtocolBindAdapter, UNICODE_STRING