This documentation is archived and is not being maintained.

ProtocolCmRegisterSap (NDIS 5.1) function

Note   NDIS 5. x has been deprecated and is superseded by NDIS 6. x. For new NDIS driver development, see Network Drivers Starting with Windows Vista. For information about porting NDIS 5. x drivers to NDIS 6. x, see Porting NDIS 5.x Drivers to NDIS 6.0.

The ProtocolCmRegisterSap function is a required function that is called by NDIS to request that a call manager register a SAP (service access point) on behalf of a connection-oriented client.


NDIS_STATUS ProtocolCmRegisterSap(
  _In_  NDIS_HANDLE  CallMgrAfContext,
  _In_  PCO_SAP      Sap,
  _In_  NDIS_HANDLE  NdisSapHandle,
  _Out_ PNDIS_HANDLE CallMgrSapContext


CallMgrAfContext [in]

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

Sap [in]

Pointer to a media-specific CO_SAP structure that contains the specific SAP that a connection-oriented client is registering.

NdisSapHandle [in]

Specifies a handle, supplied by NDIS, that uniquely identifies this SAP. This handle is opaque to the call manager and reserved for NDIS library use.

CallMgrSapContext [out]

On return, specifies the handle to a call manager-supplied context area in which the call manager maintains state about this SAP.

Return value

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

Return codeDescription

Indicates that the call manager successfully allocated and/or initialized any necessary resources to register and maintain the SAP. In addition, it also indicates that the SAP was registered successfully as required by the network media that the call manager supports.


Indicates that the call manager will complete the processing of this request asynchronously. Call managers must call NdisCmRegisterSapComplete when all processing has been completed to signal NDIS that the registration is finished.


Indicates that the call manager was unable to allocated and/or initialize its resources required to register the SAP on behalf of the connection-oriented client.


Indicates that the specification provided at Sap is invalid or cannot be supported.


Indicates that the call manager encountered an error in attempting to register the SAP for the connection-oriented client. The return code is appropriate to the error and could be a return code propagated from another NDIS library function.



ProtocolCmMakeCall communicates with network control devices or other media-specific agents, as necessary, to register the SAP, as specified at Sap, on the network for a connection-oriented client. Such actions could include, but are not limited to communicating with switching hardware, communicating with a network control station, or other actions that are appropriate to the network medium.

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

In addition, ProtocolCmRegisterSap should perform any necessary allocations of dynamic resources and structures that the call manager needs to maintain state information about the SAP on behalf of the connection-oriented client. Such resources include, but are not limited to, memory buffers, data structures, events, and other such similar resources. A call manager must also initialize any resources it allocates before returning control to NDIS. Call managers must store the NDIS-supplied handle identifying the SAP, provided at NdisSapHandle, in their context area for future use.

If ProtocolCmRegisterSap will return NDIS_STATUS_SUCCESS, it should, after allocating the per-SAP state area, set the address of this state area in CallMgrSapContext before returning control to NDIS. To do this, dereference CallMgrSapContext and store a pointer to the data area as the value of the handle. For example:

*CallMgrSapContext = SomeBuffer ;

If the given SAP that is already registered by another connection-oriented client, the call manager must fail the request and return NDIS_STATUS_INVALID_DATA.

After a call manager has registered a SAP on behalf of a connection-oriented client, it notifies that client of an incoming call offer directed to that SAP by calling NdisCmDispatchIncomingCall.


Target platform



See ProtocolCmRegisterSap.


Ndis.h (include Ndis.h)



See also




Send comments about this topic to Microsoft