Commit 0187babc authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

ole32: Lock item container on BindToStorage().

parent 25ad349d
...@@ -462,33 +462,31 @@ static HRESULT WINAPI ItemMonikerImpl_BindToObject(IMoniker* iface, ...@@ -462,33 +462,31 @@ static HRESULT WINAPI ItemMonikerImpl_BindToObject(IMoniker* iface,
/****************************************************************************** /******************************************************************************
* ItemMoniker_BindToStorage * ItemMoniker_BindToStorage
******************************************************************************/ ******************************************************************************/
static HRESULT WINAPI ItemMonikerImpl_BindToStorage(IMoniker* iface, static HRESULT WINAPI ItemMonikerImpl_BindToStorage(IMoniker *iface, IBindCtx *pbc, IMoniker *pmkToLeft, REFIID riid,
IBindCtx* pbc, void **ppvResult)
IMoniker* pmkToLeft,
REFIID riid,
VOID** ppvResult)
{ {
ItemMonikerImpl *This = impl_from_IMoniker(iface); ItemMonikerImpl *moniker = impl_from_IMoniker(iface);
HRESULT res; IOleItemContainer *container;
IOleItemContainer *poic=0; HRESULT hr;
TRACE("(%p,%p,%p,%s,%p)\n",iface,pbc,pmkToLeft,debugstr_guid(riid),ppvResult); TRACE("%p, %p, %p, %s, %p.\n", iface, pbc, pmkToLeft, debugstr_guid(riid), ppvResult);
*ppvResult=0; *ppvResult = 0;
if(pmkToLeft==NULL) if (!pmkToLeft)
return E_INVALIDARG; return E_INVALIDARG;
res=IMoniker_BindToObject(pmkToLeft,pbc,NULL,&IID_IOleItemContainer,(void**)&poic); hr = IMoniker_BindToObject(pmkToLeft, pbc, NULL, &IID_IOleItemContainer, (void **)&container);
if (SUCCEEDED(hr))
if (SUCCEEDED(res)){ {
if (FAILED(hr = set_container_lock(container, pbc)))
res=IOleItemContainer_GetObjectStorage(poic,This->itemName,pbc,riid,ppvResult); WARN("Failed to lock container, hr %#x.\n", hr);
IOleItemContainer_Release(poic); hr = IOleItemContainer_GetObjectStorage(container, moniker->itemName, pbc, riid, ppvResult);
IOleItemContainer_Release(container);
} }
return res; return hr;
} }
/****************************************************************************** /******************************************************************************
......
...@@ -380,7 +380,7 @@ static HRESULT WINAPI test_item_container_GetObject(IOleItemContainer *iface, LP ...@@ -380,7 +380,7 @@ static HRESULT WINAPI test_item_container_GetObject(IOleItemContainer *iface, LP
static HRESULT WINAPI test_item_container_GetObjectStorage(IOleItemContainer *iface, LPOLESTR item, static HRESULT WINAPI test_item_container_GetObjectStorage(IOleItemContainer *iface, LPOLESTR item,
IBindCtx *pbc, REFIID riid, void **obj) IBindCtx *pbc, REFIID riid, void **obj)
{ {
return E_NOTIMPL; return 0x8bee0001;
} }
static HRESULT WINAPI test_item_container_IsRunning(IOleItemContainer *iface, LPOLESTR item) static HRESULT WINAPI test_item_container_IsRunning(IOleItemContainer *iface, LPOLESTR item)
...@@ -2235,6 +2235,9 @@ todo_wine ...@@ -2235,6 +2235,9 @@ todo_wine
hr = IMoniker_BindToStorage(moniker, bindctx, NULL, &IID_IUnknown, (void **)&unknown); hr = IMoniker_BindToStorage(moniker, bindctx, NULL, &IID_IUnknown, (void **)&unknown);
ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr); ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
hr = IMoniker_BindToStorage(moniker, bindctx, &container_moniker->IMoniker_iface, &IID_IUnknown, (void **)&unknown);
ok(hr == 0x8bee0001, "Unexpected hr %#x.\n", hr);
/* ParseDisplayName() */ /* ParseDisplayName() */
hr = IMoniker_ParseDisplayName(moniker, bindctx, NULL, displayname, &eaten, &moniker2); hr = IMoniker_ParseDisplayName(moniker, bindctx, NULL, displayname, &eaten, &moniker2);
ok(hr == MK_E_SYNTAX, "Unexpected hr %#x.\n", hr); ok(hr == MK_E_SYNTAX, "Unexpected 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