CmCspDisconnect (Compact 7)
3/12/2014
This function is called by Connection Manager to disconnect an existing connection.
Syntax
CM_RESULT CmCspDisconnect(
__in_bcount(CM_CONNECTION_NAME_LENGTH) WCHAR* szConnection
);
Parameters
- [in] szConnection
[in] The connection name to disconnect.
Return Value
The following table shows the possible return values.
Value | Description |
---|---|
CMRE_SUCCESS |
The call succeeded. |
CMRE_CONNECTION_DOES_NOT_EXIST |
A connection name matching szConnection could not be found. |
CMRE_CONNECTION_NOT_ACQUIRED |
The connection could not be disconnected. |
CMRE_INVALID_CONNECTION |
The connection does not exist. |
CMRE_INVALID_PARAMETER |
One of the input parameters is invalid. |
CMRE_NOT_SUPPORTED |
Disconnection is not allowed. |
Remarks
This function is called by the Connection Manager and processed by the Connection Service Provider.
The Connection Manager will free all resources associated with the connection immediately after this call returns. Therefore, the Connection Service Provider must not return until all resources associated with the application are no longer used.
Before calling this function, the Connection Manager changes the CM_CONNECTION_STATE to CMCS_DISCONNECTING. When this function returns, the Connection Manager changes the CM_CONNECTION_STATE to CMCS_DISCONNECTED.
It is important that this function return as soon as possible, as delays will be apparent to other applications and to users.
The Connection Manager serializes calls to CmCspConnect, CmCspDisconnect and CmCspGetConnectionInfo.
Requirements
Header |
cmcsp.h |
See Also
Reference
Connection Service Provider Functions
CmCspConnect
CmCspDisconnect
CmCspGetConnectionInfo
CM_CONNECTION_STATE