Skip to content

SetBufferSize

Specifies the size of the I/O read and/or write buffers.

virtual HRESULT SetBufferSize(IoBufferMask eMask, long cbSize) sealed override;

eMask

[in] Specifies whether to set the size of the read buffer, the write buffer, or both buffers.

cbSize

[in] Desired size of the buffer(s) indicated by the eMask parameter.

Returns S_OK if successful, otherwise a failure HRESULT.

The default size of the read and write buffers is 4096 bytes.

The following example demonstrates use of the SetBufferSize function.

CoAcme4321.cpp
HRESULT Acme4321::OnFinalInitialize()
{
HRESULT hr = S_OK;
// Set both the read and write buffers to be 8K bytes
hr = io.SetBufferSize(IoReadAndWriteBuffers, 8192);
return hr;
}