Commit 7133ed25 authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

devenum: Access the IPropertyBag interface directly in IMoniker::BindToObject().

parent 6cfd0924
...@@ -382,7 +382,6 @@ static HRESULT WINAPI moniker_BindToObject(IMoniker *iface, IBindCtx *bind_ctx, ...@@ -382,7 +382,6 @@ static HRESULT WINAPI moniker_BindToObject(IMoniker *iface, IBindCtx *bind_ctx,
{ {
struct moniker *moniker = impl_from_IMoniker(iface); struct moniker *moniker = impl_from_IMoniker(iface);
IPersistPropertyBag *persist_bag; IPersistPropertyBag *persist_bag;
IPropertyBag *prop_bag;
IUnknown *unk; IUnknown *unk;
CLSID clsid; CLSID clsid;
VARIANT var; VARIANT var;
...@@ -397,33 +396,21 @@ static HRESULT WINAPI moniker_BindToObject(IMoniker *iface, IBindCtx *bind_ctx, ...@@ -397,33 +396,21 @@ static HRESULT WINAPI moniker_BindToObject(IMoniker *iface, IBindCtx *bind_ctx,
VariantInit(&var); VariantInit(&var);
*out = NULL; *out = NULL;
if (FAILED(hr = IMoniker_BindToStorage(iface, NULL, NULL, &IID_IPropertyBag, (void **)&prop_bag)))
return hr;
V_VT(&var) = VT_BSTR; V_VT(&var) = VT_BSTR;
if (FAILED(hr = IPropertyBag_Read(prop_bag, L"CLSID", &var, NULL))) if (FAILED(hr = IPropertyBag_Read(&moniker->IPropertyBag_iface, L"CLSID", &var, NULL)))
{
IPropertyBag_Release(prop_bag);
return hr; return hr;
}
hr = CLSIDFromString(V_BSTR(&var), &clsid); hr = CLSIDFromString(V_BSTR(&var), &clsid);
VariantClear(&var); VariantClear(&var);
if (FAILED(hr)) if (FAILED(hr))
{
IPropertyBag_Release(prop_bag);
return hr; return hr;
}
if (FAILED(hr = CoCreateInstance(&clsid, NULL, CLSCTX_ALL, &IID_IUnknown, (void **)&unk))) if (FAILED(hr = CoCreateInstance(&clsid, NULL, CLSCTX_ALL, &IID_IUnknown, (void **)&unk)))
{
IPropertyBag_Release(prop_bag);
return hr; return hr;
}
if (SUCCEEDED(IUnknown_QueryInterface(unk, &IID_IPersistPropertyBag, (void **)&persist_bag))) if (SUCCEEDED(IUnknown_QueryInterface(unk, &IID_IPersistPropertyBag, (void **)&persist_bag)))
{ {
hr = IPersistPropertyBag_Load(persist_bag, prop_bag, NULL); hr = IPersistPropertyBag_Load(persist_bag, &moniker->IPropertyBag_iface, NULL);
IPersistPropertyBag_Release(persist_bag); IPersistPropertyBag_Release(persist_bag);
} }
...@@ -431,7 +418,6 @@ static HRESULT WINAPI moniker_BindToObject(IMoniker *iface, IBindCtx *bind_ctx, ...@@ -431,7 +418,6 @@ static HRESULT WINAPI moniker_BindToObject(IMoniker *iface, IBindCtx *bind_ctx,
hr = IUnknown_QueryInterface(unk, iid, out); hr = IUnknown_QueryInterface(unk, iid, out);
IUnknown_Release(unk); IUnknown_Release(unk);
IPropertyBag_Release(prop_bag);
return hr; return 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