mfplat: Do not make a copy when returning GUID attributes (Valgrind).

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Nikolay Sivov 2019-11-26 13:35:29 +03:00 committed by Alexandre Julliard
parent 14e074b2a4
commit c091f9b7f6
1 changed files with 16 additions and 7 deletions

View File

@ -1349,14 +1349,23 @@ HRESULT attributes_GetDouble(struct attributes *attributes, REFGUID key, double
HRESULT attributes_GetGUID(struct attributes *attributes, REFGUID key, GUID *value)
{
PROPVARIANT attrval;
HRESULT hr;
struct attribute *attribute;
HRESULT hr = S_OK;
PropVariantInit(&attrval);
attrval.vt = VT_CLSID;
hr = attributes_get_item(attributes, key, &attrval);
if (SUCCEEDED(hr))
*value = *attrval.u.puuid;
EnterCriticalSection(&attributes->cs);
attribute = attributes_find_item(attributes, key, NULL);
if (attribute)
{
if (attribute->value.vt == MF_ATTRIBUTE_GUID)
*value = *attribute->value.u.puuid;
else
hr = MF_E_INVALIDTYPE;
}
else
hr = MF_E_ATTRIBUTENOTFOUND;
LeaveCriticalSection(&attributes->cs);
return hr;
}