Freigeben über


NdisIMInitializeDeviceInstance function

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.

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

Syntax

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

Parameters

  • DriverHandle [in]
    Specifies the handle returned by NdisIMRegisterLayeredMiniport.

  • DeviceInstance [in]
    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 value

NdisIMInitializeDeviceInstance can return either of the following:

Return code Description
NDIS_STATUS_SUCCESS

NDIS initiated the initialization operation for the intermediate driver's virtual NIC.

NDIS_STATUS_NOT_ACCEPTED

NdisIMInitializeDeviceInstance failed because the device specified by DriverHandle has already been initialized.

 

Remarks

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.

Requirements

Target platform

Universal

Version

Not supported for NDIS 6.0 drivers in Windows Vista. Use NdisIMInitializeDeviceInstanceExinstead. Supported for NDIS 5.1 drivers in Windows Vista and Windows XP. Use NdisIMInitializeDeviceInstanceEx instead.

Header

Ndis.h (include Ndis.h)

Library

Ndis.lib

IRQL

PASSIVE_LEVEL

See also

ANSI_STRING

MiniportInitialize

NdisIMCancelInitializeDeviceInstance

NdisIMDeInitializeDeviceInstance

NdisIMInitializeDeviceInstanceEx

NdisIMRegisterLayeredMiniport

NdisInitializeString

NdisOpenAdapter

ProtocolBindAdapter

UNICODE_STRING

 

 

Send comments about this topic to Microsoft