PROTOCOL_CO_DELETE_VC callback function

The ProtocolCoDeleteVc function is required. This function tears down the client's or call manager's state for an established virtual connection that is being closed by the original creator of that VC.

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

Syntax


PROTOCOL_CO_DELETE_VC ProtocolCoDeleteVc;

NDIS_STATUS ProtocolCoDeleteVc(
  _In_ NDIS_HANDLE ProtocolVcContext
)
{ ... }

Parameters

ProtocolVcContext [in]

Specifies the handle to the client's or call manager's per-VC context area. The protocol originally supplied this handle from its ProtocolCoCreateVc function.

Return value

ProtocolCoDeleteVc can return one of the following:

Return codeDescription
NDIS_STATUS_SUCCESS

The protocol has released or prepared for reuse all the resources that it originally allocated for the VC.

NDIS_STATUS_NOT_ACCEPTED

The VC is still active and the protocol has outstanding operations pending on the VC so it could not be destroyed.

NDIS_STATUS_XXX

The protocol failed the VC deletion for a driver-determined reason.

 

Remarks

ProtocolCoDeleteVc is the reciprocal of the driver's ProtocolCoCreateVc function. In general, it releases any dynamic resources and structures that the call manager or client previously allocated to perform operations on the active VC.

When ProtocolCoDeleteVc returns control with NDIS_STATUS_SUCCESS, the NdisVcHandle that its ProtocolCoCreateVc function stored in the area at ProtocolVcContext becomes invalid.

ProtocolCoDeleteVc can return any driver-determined NDIS_STATUS_XXX to fail the deletion of the VC, but it cannot return NDIS_STATUS_PENDING. Calls to ProtocolCoDeleteVc are inherently synchronous in nature.

Examples

To define a ProtocolCoDeleteVc 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 ProtocolCoDeleteVc function that is named "MyCoDeleteVc", use the PROTOCOL_CO_DELETE_VC type as shown in this code example:


PROTOCOL_CO_DELETE_VC MyCoDeleteVc;

Then, implement your function as follows:


_Use_decl_annotations_
NDIS_STATUS
 MyCoDeleteVc(
    NDIS_HANDLE  ProtocolVcContext
    )
  {...}

The PROTOCOL_CO_DELETE_VC 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_CO_DELETE_VC 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 ProtocolCoDeleteVc (NDIS 5.1)) in Windows Vista. Supported for NDIS 5.1 drivers (see ProtocolCoDeleteVc (NDIS 5.1)) in Windows XP.

Header

Ndis.h (include Ndis.h)

IRQL

<= DISPATCH_LEVEL

See also

NdisClCloseCall
NdisCmDispatchIncomingCloseCall
NdisCoCreateVc
NdisCoDeleteVc
ProtocolCoCreateVc

 

 

Send comments about this topic to Microsoft

Show: