3.1.5.2.2 Receiving a CPMCreateQueryIn Request

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

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

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

  3. Check whether the catalog associated with the client is in a state that allows a query to be processed (CICAT_READONLY or CICAT_WRITABLE). If this is not the case, the server MUST report a QUERY_S_NO_QUERY (0x8004160C) error.

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

  5. Save the search query in the state for the client.

  6. Make any preparations needed to serve rows to a client and associate the query with appropriate cursor (1) handles (depending on information passed in the CPMCreateQueryIn message).

  7. Add those handles to the client's list of cursor handles, and create lists of chapter handles and bookmarks.

  8. Initialize the list of chapter handles for every cursor in this query to DB_NULL_HCHAPTER.

  9. Mark the query as not monitored for changes.

  10. Initialize the number of rows to the currently calculated number of rows (which can be 0 if a query did not start to execute or some number if the query is in a process of execution), and initialize the numerator and denominator of query completion.

  11. Respond to the client with a CPMCreateQueryOut message.