ole32: Lock item container on BindToStorage().
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
25ad349d30
commit
0187babcc6
|
@ -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 (FAILED(hr = set_container_lock(container, pbc)))
|
||||||
|
WARN("Failed to lock container, hr %#x.\n", hr);
|
||||||
|
|
||||||
if (SUCCEEDED(res)){
|
hr = IOleItemContainer_GetObjectStorage(container, moniker->itemName, pbc, riid, ppvResult);
|
||||||
|
IOleItemContainer_Release(container);
|
||||||
res=IOleItemContainer_GetObjectStorage(poic,This->itemName,pbc,riid,ppvResult);
|
|
||||||
|
|
||||||
IOleItemContainer_Release(poic);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return res;
|
return hr;
|
||||||
}
|
}
|
||||||
|
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
|
|
|
@ -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
|
||||||
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);
|
||||||
|
|
Loading…
Reference in New Issue