3.1.5.2 Receiving a CPMCreateQueryIn Request

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

  1. Check if the protocol client is in the list of connected clients. If this is not the case, the protocol server MUST report a STATUS_INVALID_PARAMETER (0xC000000D) error.

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

  3. Parse the restriction set, sort orders, and groupings that are specified in the search query. If the protocol server encounters an error, it MUST report an appropriate error. If this step fails for any other reason, the protocol server MUST report the error encountered. For information about query server query errors, see [MSDN-QUERYERR].

  4. Save the search query in the state for the protocol client.

  5. Make any preparations required to serve rows to a protocol client and associate the search query with new cursor handles. The cursor handles MUST be returned to the protocol client in a CPMCreateQueryOut response.

  6. Initialize the number of rows to the currently calculated number of rows. This number can be zero if the search query did not start to execute, or some number if the search query is in a process of execution. Initialize the numerator and denominator of the search query completion.

  7. Respond to the protocol client with a CPMCreateQueryOut message.