CmCspAddConnectionConfig (Compact 7)
3/12/2014
This function is called by Connection Manager to configure a new connection with a Connection Service Provider.
Syntax
CM_RESULT CmCspAddConnectionConfig(
__in_bcount(CM_CONNECTION_NAME_LENGTH) const WCHAR* szConnection,
__in CM_CONNECTION_TYPE Type,
__in_bcount(cbTypeSpecificInfo) const BYTE* pTypeSpecificInfo,
__in DWORD cbTypeSpecificInfo
);
Parameters
- [in] szConnection
[in] The connection name to assign to this connection.
- [in] Type
[in] A CM_CONNECTION_TYPE value indicating the Connection Service Provider that services this connection.
[in,out] pTypeSpecificInfo
[in] A pointer to a storage area to place the output.[out] A pointer to a structure that is specific to the Connection Service Provider.
[in] cbTypeSpecificInfo
[in] The number of bytes allocated to the pTypeSpecificInfo structure.[out] A pointer to the number of bytes required to hold the pTypeSpecificInfo structure, if the input parameter was not big enough.
Return Value
The following table describes the return values.
Value | Description |
---|---|
CMRE_SUCCESS |
The call succeeded. |
CMRE_CONNECTION_ALREADY_EXISTS |
A connection with the same name as szConnection already exists. |
CMRE_INVALID_CONNECTION |
The connection does not exist. |
CMRE_INVALID_PARAMETER |
One of the input parameters is invalid. |
CMRE_INSUFFICIENT_BUFFER |
cbTypeSpecificInfo was not large enough to contain the pTypeSpecificInfo. The output value of cbTypeSpecificInfo is a pointer to the minimum size for pTypeSpecificInfo. |
CMRE_OUT_OF_MEMORY |
Memory can not be allocated to complete the operation. |
CMRE_UNEXPECTED |
An unexpected failure occurred. |
Remarks
The Connection Manager guarantees that the szConnection name of the connection is unique within the system.
Requirements
Header |
cmcsp.h |