The MiniportCoDeactivateVc function is required for connection-oriented miniports. MiniportCoDeactivateVc is called by NDIS to indicate that a VC is being marked as unusable.

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



NDIS_STATUS MiniportCoDeactivateVc(
  NDIS_HANDLE MiniportVcContext



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

Return Value

Return code Description
Indicates that the miniport driver successfully halted any communication across the VC and marked it as unusable.
Indicates that the miniport driver will complete the request to halt the VC asynchronously. When the miniport driver has completed halting the VC, it must then call NdisMCoDeactivateVcComplete to signal NDIS that this operation has been completed.


MiniportCoDeactivateVc communicates with its network adapter to terminate all communication across this VC (in other words, deprogramming receive or send buffers on the adapter). The miniport driver should also mark the VC, it its context area, as being inactive to prevent any further communication across the VC.

There is not a one-to-one relationship between calls to MiniportCoActivateVc and MiniportCoDeactivateVc. While NDIS may call MiniportCoActivateVc multiple times on a single VC, only one call to MiniportCoDeactivateVc is made to shut down a virtual connection. For example, a VC can be reused for different calls possibly causing multiple calls to MiniportCoActivateVc.


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

Then, implement your function as follows:
    NDIS_HANDLE  MiniportVcContext
The MINIPORT_CO_DEACTIVATE_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_DEACTIVATE_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.


Minimum supported client Supported for NDIS 6.0 and NDIS 5.1 drivers (see MiniportCoDeactivateVc (NDIS 5.1)) in Windows Vista. Supported for NDIS 5.1 drivers (see MiniportCoDeactivateVc (NDIS 5.1)) in Windows XP.
Target Platform Windows
Header ndis.h (include Ndis.h)

See Also