PROTOCOL_CM_ACTIVATE_VC_COMPLETE callback function

The ProtocolCmActivateVcComplete function is required. This function indicates to the call manager that a previous call to NdisCoActivateVc has been completed by the miniport driver.

Note  You must declare the function by using the PROTOCOL_CM_ACTIVATE_VC_COMPLETE type. For more information, see the following Examples section.
 

Syntax


PROTOCOL_CM_ACTIVATE_VC_COMPLETE ProtocolCmActivateVcComplete;

VOID ProtocolCmActivateVcComplete(
  _In_ NDIS_STATUS         Status,
  _In_ NDIS_HANDLE         CallMgrVcContext,
  _In_ PCO_CALL_PARAMETERS CallParameters
)
{ ... }

Parameters

Status [in]

Specifies the final status, as indicated by the miniport driver, of the request by the call manager to activate a VC.

CallMgrVcContext [in]

Specifies the handle to a call manager-allocated context area in which the call manager maintains its per-VC state. The call manager supplied this handle from its ProtocolCoCreateVc function.

CallParameters [in]

Pointer to the call parameters as specified by the call manager in a call to NdisCmActivateVc.

Return value

None

Remarks

When other network components have completed their operations for activating a virtual connection, initiated when the call manager called NdisCmActivateVc, NDIS notifies the call manager that the VC has been activated by calling its ProtocolCmActivateVcComplete function. The status of the activation is found in Status . Possible values for Status include, but are not limited to:

NDIS_STATUS_SUCCESS

Indicates that the VC completed successfully and the call manager can continue operations on this VC as required by its media.

NDIS_STATUS_RESOURCES

Indicates that another component in the activation has failed to activate the virtual connection because of a lack of memory or an inability allocate another type of resource.

NDIS_STATUS_NOT_ACCEPTED

Indicates that an activation is currently pending on the virtual connection. Only one activation can be processed at a time for a virtual connection. The request to activate the VC should be tried again at a later time.

NDIS_STATUS_CLOSING

Indicates that a deactivation is pending on the VC and the VC is no longer available for network communication until the deactivation has been completed and a successful activation has taken place.

NDIS_STATUS_INVALID_DATA

Indicates that the miniport driver has rejected the call parameters at CallParameters as invalid for the adapter.

ProtocolCmActivateVcComplete must check the status returned in Status to ensure that the virtual connection has been activated successfully. The call manager must not attempt to communicate over the virtual connection if Status is not NDIS_STATUS_SUCCESS.

Call managers must complete any processing required by their network media to ensure that the virtual connection is ready for data transmission before returning control to NDIS.

If the call manager specified either ROUND_UP_FLOW or ROUND_DOWN_FLOW in the CallParameters -> MediaParameters->Flags, the call parameters returned in CallParameters can have been changed by the miniport driver. Call managers should examine the call parameters that were returned to ensure proper operation. If the new call parameters are unsatisfactory, the call manager should either call NdisCmActivateVc again with new call parameters or deactivate the VC with NdisCmDeactivateVc.

Examples

To define a ProtocolCmActivateVcComplete function, you must first provide a function declaration that identifies the type of function you're defining. Windows provides a set of function types for drivers. Declaring a function using the function types helps Code Analysis for Drivers, Static Driver Verifier (SDV), and other verification tools find errors, and it's a requirement for writing drivers for the Windows operating system.

For example, to define a ProtocolCmActivateVcComplete function that is named "MyCmActivateVcComplete", use the PROTOCOL_CM_ACTIVATE_VC_COMPLETE type as shown in this code example:


PROTOCOL_CM_ACTIVATE_VC_COMPLETE MyCmActivateVcComplete;

Then, implement your function as follows:


_Use_decl_annotations_
VOID
 MyCmActivateVcComplete(
    NDIS_STATUS  Status,
    NDIS_HANDLE  CallMgrVcContext,
    PCO_CALL_PARAMETERS  CallParameters
    )
  {...}

The PROTOCOL_CM_ACTIVATE_VC_COMPLETE function type is defined in the Ndis.h header file. To more accurately identify errors when you run the code analysis tools, be sure to add the _Use_decl_annotations_ annotation to your function definition. The _Use_decl_annotations_ annotation ensures that the annotations that are applied to the PROTOCOL_CM_ACTIVATE_VC_COMPLETE function type in the header file are used. For more information about the requirements for function declarations, see Declaring Functions by Using Function Role Types for NDIS Drivers. For information about _Use_decl_annotations_, see Annotating Function Behavior.

Requirements

Version

Supported for NDIS 6.0 and NDIS 5.1 drivers (see ProtocolCmActivateVcComplete (NDIS 5.1)) in Windows Vista. Supported for NDIS 5.1 drivers (see ProtocolCmActivateVcComplete (NDIS 5.1)) in Windows XP.

Header

Ndis.h (include Ndis.h)

IRQL

<= DISPATCH_LEVEL

See also

NdisCmActivateVc
NdisCmDeactivateVc
ProtocolCmMakeCall

 

 

Send comments about this topic to Microsoft

Show: