Commit 50a57f86 authored by Jactry Zeng's avatar Jactry Zeng Committed by Alexandre Julliard

mfplat: Implement IMFAttributes::DeleteItem().

parent 7edec69c
......@@ -837,9 +837,29 @@ static HRESULT WINAPI mfattributes_SetItem(IMFAttributes *iface, REFGUID key, RE
static HRESULT WINAPI mfattributes_DeleteItem(IMFAttributes *iface, REFGUID key)
{
FIXME("%p, %s.\n", iface, debugstr_attr(key));
struct attributes *attributes = impl_from_IMFAttributes(iface);
struct attribute *attribute;
size_t index = 0;
return E_NOTIMPL;
TRACE("%p, %s.\n", iface, debugstr_attr(key));
EnterCriticalSection(&attributes->cs);
if ((attribute = attributes_find_item(attributes, key, &index)))
{
size_t count;
PropVariantClear(&attribute->value);
attributes->count--;
count = attributes->count - index;
if (count)
memmove(&attributes->attributes[index], &attributes->attributes[index + 1], count * sizeof(*attributes->attributes));
}
LeaveCriticalSection(&attributes->cs);
return S_OK;
}
static HRESULT WINAPI mfattributes_DeleteAllItems(IMFAttributes *iface)
......
......@@ -583,7 +583,10 @@ static void test_MFCreateAttributes(void)
ok(hr == S_OK, "Failed to set item, hr %#x.\n", hr);
hr = IMFAttributes_DeleteItem(attributes, &DUMMY_GUID2);
todo_wine ok(hr == S_OK, "Failed to delete item, hr %#x.\n", hr);
ok(hr == S_OK, "Failed to delete item, hr %#x.\n", hr);
hr = IMFAttributes_DeleteItem(attributes, &DUMMY_GUID2);
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
hr = IMFAttributes_GetItem(attributes, &DUMMY_GUID3, &ret_propvar);
ok(hr == S_OK, "Failed to get item, hr %#x.\n", hr);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment