3.1.5.2.1 Receiving a CPMConnectIn Request

When the server receives a CPMConnectIn request from a client, the server MUST do the following.

  1. Search the ConnectedClientsIdentifiers list for the handle of the named pipe over which the server has received the CPMConnectIn message. If it is present, the server MUST report a STATUS_INVALID_PARAMETER (0xC000000D) error. If _fClientIsRemote is not set to 0x00000001 the server MUST report a STATUS_INVALID_PARAMETER (0xC000000D) error.

  2. Call the IsCatalogAvailable abstract interface. Provide the DBPROP_CI_CATALOG_NAME property value from the CPMConnectIn request message as the sole argument. Report a MSS_E_CATALOGNOTFOUND (0x80042103) error if the result of the IsCatalogAvailable abstract interface call to the GSS is not true. <25>

  3. If the value of the _iClientVersion field is larger than 0x00000109, then validate the checksum of the CPMConnectIn request as described in section 3.2.4.

  4. Add the handle of the named pipe over which the server received the CPMConnectIn message to the ConnectedClientsIdentifiers list. Call the StoreClientInformation abstract interface to the GSS with the query identifier that uniquely identifies the query to the server, the CPMConnectIn message as the ConnectMessage argument, and the HANDLE of the named pipe over which the server has received the CPMConnectIn message as the NamedPipeHandle argument. This helps the GSS later assess whether the user identified here has access to returned results.

  5. Store the _iClientVersion field in the ConnectedClientVersions list under the same index as the index in the ConnectedClientsIdentifiers list of the handle of the named pipe over which the server received this message.

  6. Call the GetServerVersions abstract interface of the GSS. Fill in the _serverVersion field using the _serverVersion output argument obtained from the GetServerVersions abstract interface. If supportsVersioningInfo is true, fill in the dwWinVerMajor, dwWinVerMinor, dwNLSVerMajor, and dwNLSVerMinor fields with the values returned by GetServerVersions. Otherwise, in order to indicate that versioning is not supported (see section 3.2.4.2.1), the server MUST copy four DWORDs at the offset starting after _iClientVersion in the CPMConnectIn message to the same location in the CPMConnectOut reply (the offset right after _serverVersion).

  7. Respond to the client with the CPMConnectOut message.

  8. Report any errors encountered during message preparation or during any abstract interface call to the GSS. Errors that are specific to this request:

    • E_OUTOFMEMORY: Generated by any resource allocation failure on the server or service side.

    • STATUS_INVALID_PARAMETER: Generated when any of the parameters passed in by the client is invalid. Invalid parameters are those that do not obey the corresponding data structure layout as defined for their types in this document.

    • STATUS_INVALID_PARAMETER_MIX: Generated when the client version as passed in this message is smaller than 0x102.

    • DS_E_DATASOURCENOTAVAILABLE: Generated when the catalog requested is not in a ready state for queries.

    • DS_E_ INVALIDDATASOURCE or ERROR_INVALID_PARAMETER: Generated when the catalog was not specified correctly.

    • CI_E_NO_CATALOG:  Generated when the catalog requested was not found.

      Any other error code can be returned, but it will be treated as informative only.