MINIPORT_CO_DELETE_VC callback function (ndis.h)

The MiniportCoDeleteVc function is required for connection-oriented miniports. MiniportCoDeleteVc indicates that a VC is being torn down and deleted by NDIS.

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

Syntax

MINIPORT_CO_DELETE_VC MiniportCoDeleteVc;

NDIS_STATUS MiniportCoDeleteVc(
  [in] NDIS_HANDLE MiniportVcContext
)
{...}

Parameters

[in] MiniportVcContext

Specifies the handle to a miniport driver-allocated context area in which the miniport driver maintains its per-VC state. The miniport driver supplied this handle to NDIS from its MiniportCoCreateVc function.

Return value

Return code Description
NDIS_STATUS_SUCCESS
Indicates that the miniport driver successfully freed all resources allocated for this VC.

Remarks

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

MiniportCoDeleteVc frees any resources allocated on a per-VC basis and stored in the context area MiniportVcContext . The miniport driver must also free the MiniportVcContext that is allocated in its MiniportCoCreateVc function.

Examples

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

MINIPORT_CO_DELETE_VC MyCoDeleteVc;

Then, implement your function as follows:

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

The MINIPORT_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 MINIPORT_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

Requirement Value
Minimum supported client Supported for NDIS 6.0 and NDIS 5.1 drivers (see MiniportCoDeleteVc (NDIS 5.1)) in Windows Vista. Supported for NDIS 5.1 drivers (see MiniportCoDeleteVc (NDIS 5.1)) in Windows XP.
Target Platform Windows
Header ndis.h (include Ndis.h)
IRQL <= DISPATCH_LEVEL

See also

MiniportCoCreateVc