IMFMediaBuffer::SetCurrentLength Method

Sets the length of the valid data in the buffer.

Syntax

public:
HRESULT SetCurrentLength(
         DWORD cbCurrentLength
)  

Parameters

cbCurrentLength
Type: DWORD 

Length of the valid data, in bytes. This value cannot be greater than the allocated size of the buffer, which is returned by the IMFMediaBuffer::GetMaxLength method.

Return value

Type: HRESULT 

The method returns an HRESULT. Possible values include, but are not limited to, those in the following table.

Return codes
Return code Description
S_OK The method succeeded.
E_INVALIDARG The specified length is greater than the maximum size of the buffer.

Refer to Media Foundation return codes.

Remarks

Call this method if you write data into the buffer.

Requirements

Header: Declared in mfobjects.h (include mfidl.h).

Library: Use mfuuid.lib.