Click or drag to resize

SetBufferSize

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


				virtual HRESULT SetBufferSize(IoBufferMask eMask, long cbSize) sealed override;
			
Parameters
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.

Return Value

Returns S_OK if successful, otherwise a failure HRESULT.

Remarks

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

Example

The following example demonstrates use of the SetBufferSize function.

C++
// 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;
}
See Also

Download a complete CHM version of this documentation here.