The ProtocolCmDeregisterSap function is required. This function is called by NDIS to request that a call manager deregister a SAP on behalf of a connection-oriented client.



NDIS_STATUS ProtocolCmDeregisterSap(
  NDIS_HANDLE CallMgrSapContext



Specifies the handle to a call manager-allocated context area in which the call manager maintains its per-SAP state information. The call manager supplied this handle to NDIS from its ProtocolCmRegisterSap function.

Return Value

ProtocolCmDeregisterSap returns the status of its operation(s) as one of the following:

Indicates that the call manager successfully removed the SAP registration and freed any resources allocated to maintain per-SAP information.
Indicates that the call manager will complete the request to deregister the SAP asynchronously. The call manager must call NdisCmDeregisterSapComplete to signal NDIS when the operation is complete.


ProtocolCmDeregisterSap communicates with network control devices or other media-specific agents, as necessary, to deregister the SAP on the network. Such actions could include, but are not limited to:

Communicating with a switching hardware

Communicating with a network control station

Communicating with other media-specific network agents

If a call manager is required to communicate with networking control agents, such as a network switch, it should use a virtual connection to the network control agent that it established in its ProtocolBindAdapterEx function. Stand-alone call managers communicate through the underlying miniport driver by calling NdisCoSendNetBufferLists. Miniport drivers that provide integrated call-management support never call NdisCoSendNetBufferLists. Instead, they transmit the data directly across the network.

In addition, ProtocolCmDeregisterSap must free any dynamically-allocated resources in its per-SAP area, provided at CallMgrSapContext, as well as freeing the state area itself before returning control to NDIS.

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

Then, implement your function as follows:

The PROTOCOL_CM_DEREGISTER_SAP 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_DEREGISTER_SAP 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.


Windows Driver kit version
Target platform Windows
Minimum KMDF version
Minimum UMDF version
Header ndis.h (include Ndis.h)
DDI compliance rules

See Also


Send comments about this topic to Microsoft