18.104.22.168.1.2.2 rgbOut Output Buffer
As mentioned in section 22.214.171.124.1.1.2, the rgbOut parameter of the EcDoRpcExt2 method, as specified in section 126.96.36.199, can contain more than one extended buffer, each with an RPC_HEADER_EXT structure, as specified in section 188.8.131.52. 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 184.108.40.206), the RopReadStream ROP ([MS-OXCROPS] section 220.127.116.11), and the RopFastTransferSourceGetBuffer ROP ([MS-OXCROPS] section 18.104.22.168).
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 22.214.171.124), RopReadStream ROP ([MS-OXCROPS] section 126.96.36.199), or RopFastTransferSourceGetBuffer ROP ([MS-OXCROPS] section 188.8.131.52) 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 184.108.40.206.