3.1.5.5 Receiving a CPMGetRowsIn Request

When the protocol server receives a CPMGetRowsIn message request from a protocol client, the protocol server MUST do the following:

  1. Check if the protocol client has a query associated with it. If this is not the case, the protocol server MUST report a STATUS_INVALID_PARAMETER (0xC000000D) error.

  2. Check if the cursor handle passed is in the list of the protocol client's cursor handles. If this is not the case, the protocol server MUST report an E_INVALIDARG (0x80070057) error.

  3. Check if the protocol client has a current set of bindings. If this is not the case, the protocol server MUST report an E_UNEXPECTED (0x8000FFFF) error.

  4. Prepare a CPMGetRowsOut message. The protocol server MUST position the cursor at the beginning of the query results. If this step fails for any reason, the protocol server MUST report the error encountered, which is an HRESULT or an NTSTATUS value (see section 1.8).

  5. Fetch as many rows as will fit in a buffer, the size of which is indicated by _cbReadBuffer, but not more than indicated by _cRowsToTransfer. When fetching rows, the protocol server MUST compare each selected column's property value type to the type that is specified in the protocol client's current set of bindings (see section 3.1.1). Store the actual number of rows fetched in _cRowsReturned.

  6. Store fetched rows in the Rows field (see section 2.2.3.7 on the structure of the Rows field).

  7. Respond to the protocol client with the CPMGetRowsOut message.