Retrieves a byte array associated with a key. This method copies the array into a caller-allocated buffer.
SyntaxHRESULT GetBlob(
[in] REFGUID guidKey,
[out] UINT8 *pBuf,
[in] UINT32 cbBufSize,
[out] UINT32 *pcbBlobSize
);
Parameters
[in] guidKey
GUID that identifies which value to retrieve. The attribute type must be MF_ATTRIBUTE_BLOB.
[out] pBuf
Pointer to a buffer allocated by the caller. If the key is found and the value is a byte array, the method copies the array into this buffer. To find the required size of the buffer, call IMFAttributes::GetBlobSize.
[in] cbBufSize
The size of the pBuf buffer, in bytes.
[out] pcbBlobSize
Receives the size of the byte array. This parameter can be NULL.
Return valueThe method returns an HRESULT. Possible values include, but are not limited to, those in the following table.
Return code DescriptionYou can also use the IMFAttributes::GetAllocatedBlob method, which allocates the buffer to hold the byte array.
This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:
The following code example shows how to get an attribute whose value is a byte array.
HRESULT AttributeGetBlob(IMFAttributes *pAttributes)
{
HRESULT hr = S_OK;
UINT32 cbBlob = 0;
BYTE *pBlob = NULL;
hr = pAttributes->GetBlobSize(MY_ATTRIBUTE, &cbBlob);
if (SUCCEEDED(hr))
{
pBlob = new BYTE[cbBlob];
if (pBlob == NULL)
{
hr = E_OUTOFMEMORY;
}
}
if (SUCCEEDED(hr))
{
hr = pAttributes->GetBlob(MY_ATTRIBUTE, pBlob, cbBlob, &cbBlob);
}
if (pBlob)
{
delete [] pBlob;
}
return hr;
}
Requirements Requirement Value Minimum supported client Windows Vista [desktop apps | UWP apps] Minimum supported server Windows Server 2008 [desktop apps | UWP apps] Target Platform Windows Header mfobjects.h (include Mfidl.h) Library Mfuuid.lib See also
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4