3.1.4.2.1.2.2 rgbOut Output Buffer

As mentioned in section 3.1.4.2.1.1.2, the rgbOut parameter of the EcDoRpcExt2 method, as specified in section 3.1.4.2, can contain more than one extended buffer, each with an RPC_HEADER_EXT structure, as specified in section 2.2.2.1. This concept is called packing. The server has the ability to "pack" additional response data into the rgbOut parameter based on whether the client has requested this functionality through passing the Chain flag in the pulFlags parameter and whether the ROP in the rgbIn request on the EcDoRpcExt2 method supports packing. The ROP commands that support packing are the RopQueryRows ROP ([MS-OXCROPS] section 2.2.5.4), the RopReadStream ROP ([MS-OXCROPS] section 2.2.9.2), and the RopFastTransferSourceGetBuffer ROP ([MS-OXCROPS] section 2.2.12.4).

When processing ROP requests, the server MUST NOT produce more than 32 KB worth of response data for all ROP requests. However, when the server finishes processing a RopQueryRows ROP ([MS-OXCROPS] section 2.2.5.4), RopReadStream ROP ([MS-OXCROPS] section 2.2.9.2), or RopFastTransferSourceGetBuffer ROP ([MS-OXCROPS] section 2.2.12.4) from the rgbIn parameter request and it was the last ROP command in the request and the client has requested packing through the Chain flag and there is residual room in the rgbOut parameter response, the server can add additional data to the rgbOut parameter response, each with its own RPC_HEADER_EXT header.

For the server to produce additional response data, it MUST build a response as if the client sent another request with only a RopQueryRows ROP, RopReadStream ROP, or RopFastTransferSourceGetBuffer ROP. The additional response data is also limited to 32 KB in size. The additional ROP response is placed into the rgbOut parameter buffer following the previous header and associated payload with its own RPC_HEADER_EXT structure. The server can then compress and/or obfuscate this payload if the client requests and set the Flags field of the RPC_HEADER_EXT structure to indicate how the payload has been altered. If more residual room remains in the rgbOut parameter, the server can continue to produce more response data until the rgbOut parameter does not have enough room to hold another response.

The server MUST stop adding additional packed responses to the rgbOut parameter response if the residual size of the rgbOut parameter response is less than 8 KB for the RopReadStream ROP and RopFastTransferSourceGetBuffer ROP and 32 KB for the RopQueryRows ROP. The server MUST NOT place more than 96 individual payloads into a single rgbOut parameter response.

When it adds additional response data, the server MUST alter its processing of the request to reflect what has already been done. For example, if the client requests to read 1,000 rows in the RopQueryRows ROP and the first payload contains 100 rows, the additional response data is processed as if the client requested only 900 rows. The server MUST NOT return more data to the client than the client originally requested.

For the RopQueryRows ROP, the server MUST adjust the row count when adding additional response data. For the RopReadStream ROP, the server MUST adjust the number of bytes to read when adding additional response data. There is no specific limit for the RopFastTransferSourceGetBuffer ROP, but the server MUST stop packing additional extended buffers that contain the RopFastTransferSourceGetBuffer ROP when there is no more data for the fast transfer stream. For the RopFastTransferSourceGetBuffer ROP, the client requests that the server return all the server data. For details about how to properly format the RopFastTransferSourceGetBuffer ROP in this way, see [MS-OXCROPS] section 2.2.12.4.