IMFAttributes::GetAllocatedBlob Method

Retrieves a byte array associated with a key. This method allocates the memory for the array.

Syntax

public:
HRESULT GetAllocatedBlob(
         REFGUID guidKey,
          **ppBuf,
         UINT32 *pcbSize
)  

Parameters

guidKey
Type: REFGUID 

[in]

GUID that identifies which value to retrieve. The attribute type must be MF_ATTRIBUTE_BLOB.

ppBuf
Type:  **

If the key is found and the value is a byte array, this parameter receives a copy of the array. The caller must free the memory for the array by calling CoTaskMemFree.

pcbSize
Type: UINT32 *

[out]

Receives the size of the array, in bytes.

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.
MF_E_ATTRIBUTENOTFOUND The specified key was not found.
MF_E_INVALIDTYPE The attribute value is not a byte array.

Refer to Media Foundation return codes.

Remarks

To copy a byte array value into a caller-allocated buffer, use the IMFAttributes::GetBlob method.

Requirements

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

Library: Use Mfuuid.lib.