Signed-off-by: Jactry Zeng jzeng@codeweavers.com --- dlls/mfplat/main.c | 11 +++++++++-- dlls/mfplat/tests/mfplat.c | 12 ++++++------ 2 files changed, 15 insertions(+), 8 deletions(-)
diff --git a/dlls/mfplat/main.c b/dlls/mfplat/main.c index f897325502..c842f69cbe 100644 --- a/dlls/mfplat/main.c +++ b/dlls/mfplat/main.c @@ -903,9 +903,16 @@ static HRESULT WINAPI mfattributes_GetItemByIndex(IMFAttributes *iface, UINT32 i { mfattributes *This = impl_from_IMFAttributes(iface);
- FIXME("%p, %d, %p, %p\n", This, index, key, value); + TRACE("(%p, %d, %p, %p)\n", This, index, key, value);
- return E_NOTIMPL; + EnterCriticalSection(&This->lock); + + *key = This->attributes[index]->key; + PropVariantCopy(value, &This->attributes[index]->value); + + LeaveCriticalSection(&This->lock); + + return S_OK; }
static HRESULT WINAPI mfattributes_CopyAllItems(IMFAttributes *iface, IMFAttributes *dest) diff --git a/dlls/mfplat/tests/mfplat.c b/dlls/mfplat/tests/mfplat.c index 088a1d83a7..41b0ee85f8 100644 --- a/dlls/mfplat/tests/mfplat.c +++ b/dlls/mfplat/tests/mfplat.c @@ -782,9 +782,9 @@ static void test_IMFAttributes_item(void) hr = IMFAttributes_GetItemByIndex(attributes, 1, &key, &ret_propvar); else hr = IMFAttributes_GetItemByIndex(attributes, 0, &key, &ret_propvar); - todo_wine ok(hr == S_OK, "IMFAttributes_GetItemByIndex failed: 0x%08x.\n", hr); - todo_wine ok(!PropVariantCompareEx(&propvar, &ret_propvar, 0, 0), "got wrong property.\n"); - todo_wine ok(IsEqualIID(&key, &DUMMY_GUID3), "got wrong key: %s.\n", wine_dbgstr_guid(&key)); + ok(hr == S_OK, "IMFAttributes_GetItemByIndex failed: 0x%08x.\n", hr); + ok(!PropVariantCompareEx(&propvar, &ret_propvar, 0, 0), "got wrong property.\n"); + ok(IsEqualIID(&key, &DUMMY_GUID3), "got wrong key: %s.\n", wine_dbgstr_guid(&key)); PropVariantClear(&ret_propvar); PropVariantClear(&propvar); propvar.vt = MF_ATTRIBUTE_UINT64; @@ -793,9 +793,9 @@ static void test_IMFAttributes_item(void) hr = IMFAttributes_GetItemByIndex(attributes, 0, &key, &ret_propvar); else hr = IMFAttributes_GetItemByIndex(attributes, 1, &key, &ret_propvar); - todo_wine ok(hr == S_OK, "IMFAttributes_GetItemByIndex failed: 0x%08x.\n", hr); - todo_wine ok(!PropVariantCompareEx(&propvar, &ret_propvar, 0, 0), "got wrong property.\n"); - todo_wine ok(IsEqualIID(&key, &DUMMY_GUID1), "got wrong key: %s.\n", wine_dbgstr_guid(&key)); + ok(hr == S_OK, "IMFAttributes_GetItemByIndex failed: 0x%08x.\n", hr); + ok(!PropVariantCompareEx(&propvar, &ret_propvar, 0, 0), "got wrong property.\n"); + ok(IsEqualIID(&key, &DUMMY_GUID1), "got wrong key: %s.\n", wine_dbgstr_guid(&key));
hr = IMFAttributes_DeleteItem(attributes, &DUMMY_GUID2); ok(hr == S_OK, "IMFAttributes_DeleteItem failed: 0x%08x.\n", hr);