windowscodecs: Implement IPropertyBag2::Read.

This commit is contained in:
Ludger Sprenker 2013-01-25 00:05:15 +01:00 committed by Alexandre Julliard
parent d27fe13ffb
commit 2ee3e8073f
2 changed files with 30 additions and 3 deletions

View File

@ -128,8 +128,36 @@ static LONG find_item(PropertyBag *This, LPCOLESTR name)
static HRESULT WINAPI PropertyBag_Read(IPropertyBag2 *iface, ULONG cProperties, static HRESULT WINAPI PropertyBag_Read(IPropertyBag2 *iface, ULONG cProperties,
PROPBAG2 *pPropBag, IErrorLog *pErrLog, VARIANT *pvarValue, HRESULT *phrError) PROPBAG2 *pPropBag, IErrorLog *pErrLog, VARIANT *pvarValue, HRESULT *phrError)
{ {
FIXME("(%p,%u,%p,%p,%p,%p): stub\n", iface, cProperties, pPropBag, pErrLog, pvarValue, phrError); HRESULT res = S_OK;
return E_NOTIMPL; 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, static HRESULT WINAPI PropertyBag_Write(IPropertyBag2 *iface, ULONG cProperties,

View File

@ -271,7 +271,6 @@ static void test_filled_propertybag(void)
test_propertybag_write(property); test_propertybag_write(property);
todo_wine
test_propertybag_read(property); test_propertybag_read(property);
IPropertyBag2_Release(property); IPropertyBag2_Release(property);