MiniportCoCreateVc (NDIS 5.1) 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.

The MiniportCoCreateVc function is required for connection-oriented miniports. MiniportCoCreateVc is called by NDIS to indicate to the miniport driver that a new VC is being created.

Syntax

NDIS_STATUS MiniportCoCreateVc(
  _In_  NDIS_HANDLE  MiniportAdapterContext,
  _In_  NDIS_HANDLE  NdisVcHandle,
  _Out_ PNDIS_HANDLE MiniportVcContext
);

Parameters

  • MiniportAdapterContext [in]
    Specifies the handle to a miniport driver-allocated context area in which the miniport driver maintains state information about this instance of the adapter. The miniport driver provided this handle to NDIS by calling NdisMSetAttributes or NdisMSetAttributesEx from its MiniportInitialize function.

  • NdisVcHandle [in]
    Specifies a handle, supplied by NDIS, that uniquely identifies the VC being created. This handle is opaque to the miniport driver and reserved for NDIS library use.

  • MiniportVcContext [out]
    Specifies, on output, a handle to a miniport driver-supplied context area in which the miniport driver maintains state about the VC.

Return value

Return code Description
NDIS_STATUS_SUCCESS

Indicates that the miniport driver successfully allocated all necessary resources and prepared itself for handling requests for the newly created VC.

NDIS_STATUS_RESOURCES

Indicates that the call manager could not obtain dynamically allocated resources necessary for it to operate on the new VC.

 

Remarks

MiniportCoCreateVc must be written as a synchronous function and cannot, under any circumstances, return NDIS_STATUS_PENDING without causing a system-wide failure.

MiniportCoCreateVc allocates any necessary resources that the miniport driver requires to maintain state information about the VC. The resources could include, but are not limited to memory buffers, events, data structures, and other such similar resources.

After allocating all required resources the miniport driver should initialize the resources into a usable state and return a pointer to the state area in MiniportVcContext. The handle is set by dereferencing the handle and storing a pointer to the state buffer as the value of the handle. For example:

*MiniportVcContext = SomeBuffer ;

Miniport drivers must store the handle to the VC, NdisVcHandle, in their state area as it is a required parameter to other NDIS library routines that are subsequently called by the miniport driver.

Requirements

Target platform

Desktop

Version

See MiniportCoCreateVc.

Header

Ndis.h (include Ndis.h)

IRQL

<= DISPATCH_LEVEL

See also

MiniportInitialize

NdisMSetAttributes

NdisMSetAttributesEx

 

 

Send comments about this topic to Microsoft