From 2ee3e8073fe5b5adc2b48f382eec50c21550fdbb Mon Sep 17 00:00:00 2001 From: Ludger Sprenker Date: Fri, 25 Jan 2013 00:05:15 +0100 Subject: [PATCH] windowscodecs: Implement IPropertyBag2::Read. --- dlls/windowscodecs/propertybag.c | 32 ++++++++++++++++++++++++++++++-- dlls/windowscodecs/tests/propertybag.c | 1 - 2 files changed, 30 insertions(+), 3 deletions(-) diff --git a/dlls/windowscodecs/propertybag.c b/dlls/windowscodecs/propertybag.c index f5729af9a34..02914ec375a 100644 --- a/dlls/windowscodecs/propertybag.c +++ b/dlls/windowscodecs/propertybag.c @@ -128,8 +128,36 @@ static LONG find_item(PropertyBag *This, LPCOLESTR name) static HRESULT WINAPI PropertyBag_Read(IPropertyBag2 *iface, ULONG cProperties, PROPBAG2 *pPropBag, IErrorLog *pErrLog, VARIANT *pvarValue, HRESULT *phrError) { - FIXME("(%p,%u,%p,%p,%p,%p): stub\n", iface, cProperties, pPropBag, pErrLog, pvarValue, phrError); - return E_NOTIMPL; + HRESULT res = S_OK; + ULONG i; + PropertyBag *This = impl_from_IPropertyBag2(iface); + + TRACE("(%p,%u,%p,%p,%p,%p)\n", iface, cProperties, pPropBag, pErrLog, pvarValue, phrError); + + for (i=0; i < cProperties; i++) + { + LONG idx; + if (pPropBag[i].dwHint && pPropBag[i].dwHint <= This->prop_count) + idx = pPropBag[i].dwHint-1; + else + idx = find_item(This, pPropBag[i].pstrName); + + if (idx > -1) + { + VariantInit(pvarValue+i); + res = VariantCopy(pvarValue+i, This->values+idx); + if (FAILED(res)) + break; + phrError[i] = res; + } + else + { + res = E_FAIL; + break; + } + } + + return res; } static HRESULT WINAPI PropertyBag_Write(IPropertyBag2 *iface, ULONG cProperties, diff --git a/dlls/windowscodecs/tests/propertybag.c b/dlls/windowscodecs/tests/propertybag.c index aa62c8cac76..b3cf191c46c 100644 --- a/dlls/windowscodecs/tests/propertybag.c +++ b/dlls/windowscodecs/tests/propertybag.c @@ -271,7 +271,6 @@ static void test_filled_propertybag(void) test_propertybag_write(property); -todo_wine test_propertybag_read(property); IPropertyBag2_Release(property); -- 2.11.4.GIT