Skip to main content
MFGetAttributeString function

Gets a string value from an attribute store.


HRESULT MFGetAttributeString(
  _In_  IMFAttributes *pAttributes,
  _In_  REFGUID       guidKey,
  _Out_ PWSTR         *ppsz


pAttributes [in]

A pointer to the IMFAttributes interface.

guidKey [in]

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

ppsz [out]

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

Return value

If this function succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.


This function is a wrapper for the IMFAttributes::GetAllocatedString method.


Minimum supported client

Windows 8 [desktop apps | UWP apps]

Minimum supported server

Windows Server 2012 [desktop apps | UWP apps]



See also

Media Foundation Functions