Partager via


CmCspClaimConnection (Compact 7)

3/12/2014

This function is called by the Connection Manager when an IP adapter that is not managed by any Connection Service Provider is discovered.

Syntax

CM_RESULT CmCspClaimConnection(
    __in WCHAR* szAdapter,
    __inout_bcount(CM_CONNECTION_NAME_LENGTH) WCHAR* szConnection
);

Parameters

  • [in] szAdapter
    The name of the physical network adapter.
  • [in,out] szConnection
    [in] The connection name.

    [out] Optional updated connection name.

Return Value

The function returns the following values:

Value Description

CMRE_SUCCESS

The call succeeded.

CMRE_CONNECTION_ALREADY_EXISTS

A connection with the same name as szConnection already exists.

CMRE_NOT_SUPPORTED

The Connection Service Provider cannot claim this connection.

CMRE_INVALID_CONNECTION

The connection does not exist.

CMRE_INVALID_PARAMETER

One of the input parameters is invalid.

CMRE_OUT_OF_MEMORY

Memory can not be allocated to complete the operation.

CMRE_UNEXPECTED

An unexpected failure occurred.

Remarks

This function is called by Connection Manager and processed by the Connection Service Provider.

Connection Manager calls each Connection Service Provider in the system until a Connection Service Provider returns CMRE_SUCCESS.

The typical scenario for this function is when an IP connection has been activated out-of-band. The Connection Service Provider should handle this call with this process:

IF the Connection Service Provider can service out-of-band connections

AND the Connection Service Provider recognizes the adapter as one that would be created as a result of connecting one of its configured connections

THEN the Connection Service Provider should

  • Accept the connection by returning CMRE_SUCCESS and the configured connection name associated with the adapter.
  • Subsequently, the Connection Service Provider should not allow this connection to be disconnected by the Connection Manager. That is, it should fail calls to CmCspDisconnect on this connection.

ELSE the Connection Service Provider should

reject the connection by returning CMRE_INVALID_CONNECTION.

Requirements

Header

cmcsp.h

See Also

Reference

Connection Service Provider Functions

Other Resources

Connection Service Provider Reference