3.1.5.2.11 Receiving a CPMCompareBmkIn Request
When the server receives a CPMCompareBmkIn message request from the client, the server MUST do the following:
Search the ConnectedClientsIdentifiers list for the HANDLE of the named pipe over which the server has received the CPMCompareBmkIn message. If it is not present, the server MUST report a STATUS_INVALID_PARAMETER (0xC000000D) error.
Call the ClientQueryHasCursorHandle abstract interface to the GSS with the HANDLE of the named pipe over which the server has received the CPMCompareBmkIn message as its QueryIdentifier argument and with the _hCursor handle as its CursorHandle argument. If the ContainsHandle output parameter is not true, the server MUST report an E_FAIL (0x80004005) error.
Prepare a CPMCompareBmkOut message.
If the bookmark handles are equal, dwComparison MUST be set to DBCOMPARE_EQ.
Otherwise, the server MUST do the following:
Find rows that are referred to by each bookmark handle in the query results: the server MUST retrieve the indices of both rows within the rowset by calling theĀ GetBookmarkPosition abstract interface twice, with the HANDLE of the named pipe over which the server has received the CPMCompareBmkIn message as its QueryIdentifier argument, with the _hCursor handle as its CursorHandle argument, and the bmkFirst and bmkSecond bookmark handles, respectively as the bmkHandle argument.
If the chapter handle in CPMCompareBmkIn is invalid, or if one or both of the rows are not in the given chapter, the behavior is undefined.
Otherwise, when both rows are in the same chapter, the server MUST then compare the position values obtained via a GetBookmarkPosition interface call and set dwComparison to DBCOMPARE_LT if the position of the first row is smaller than the position of the second row; otherwise, dwComparison MUST be set to DBCOMPARE_GT.
Respond to the client with the configured CPMCompareBmkOut message.
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.
Any other error code can be returned, but it will be treated as informative only.