3.1.5 Processing and Sequencing Rules
Whenever an error occurs during processing of a message sent by a client, the server MUST report an error back to the client as follows:
Stop processing the message sent by the client.
Respond with the message header (only) of the message sent by the client, keeping the _msg field intact. The only exception to this is when an error occurs in the CPMConnectIn (section 2.2.3.2) request and the server cannot find a catalog. The response is a CPMConnectOut (section 2.2.3.3) message with the following possible errors.
Error
Meaning
DS_E_DATASOURCENOTAVAILABLE
Catalog not in ready state for queries.
DS_E_INVALIDDATASOURCE
Failed to specify catalog correctly.
CI_E_NO_CATALOG
Catalog not found.
Set the _status field to the error code value.
When a message arrives, the server MUST check the _msg field value to identify whether it is a known type (see section 2.2.2). If the type is not known, it MUST report a STATUS_INVALID_PARAMETER (0xC000000D) error.
The server MUST then validate the _ulChecksum field value if the message type is one of the following:
CPMConnectIn (0x000000C8)
CPMCreateQueryIn (0x000000CA)
CPMSetBindingsIn (0x000000D0)
CPMGetRowsIn (0x000000CC)
CPMFetchValueIn (0x000000E4)
To validate the _ulChecksum field value, the server MUST check the value that the client specified in the _iClientVersion field in the CPMConnectIn message.
If the value of the _iClientVersion field's last 2 bytes is 0x00000109 or greater and _ulChecksum is not equal to zero, the server MUST validate that the _ulChecksum field was calculated as specified in section 3.2.4. If the _ulChecksum value is invalid, the server MUST report a STATUS_INVALID_PARAMETER (0xC000000D) error.
Next, the server checks which state it is in. If its state is "not initialized", the server MUST report a CI_E_NOT_INITIALIZED (0x8004180B) error. If the state is "shutting down", the server MUST report a CI_E_SHUTDOWN (0x80041812) error.
After a header has been determined to be valid and the server to be in "running" state, further message-specific processing MUST be performed, as specified in the following subsections.
Some messages are valid only after a previous message has been sent. Typically, an ID or handle from the earlier message is required as input to the later message. These requirements are detailed in the following sections. The table below summarizes the relationship between messages.

Figure 5: Windows Search Protocol message sequence relationships