Commit 5e32397c authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

comsvcs: Implement BindToObject() for "new" moniker.

parent 9f90994b
...@@ -551,9 +551,42 @@ static HRESULT WINAPI new_moniker_GetSizeMax(IMoniker *iface, ULARGE_INTEGER *si ...@@ -551,9 +551,42 @@ static HRESULT WINAPI new_moniker_GetSizeMax(IMoniker *iface, ULARGE_INTEGER *si
static HRESULT WINAPI new_moniker_BindToObject(IMoniker *iface, IBindCtx *pbc, IMoniker *pmkToLeft, static HRESULT WINAPI new_moniker_BindToObject(IMoniker *iface, IBindCtx *pbc, IMoniker *pmkToLeft,
REFIID riid, void **ret) REFIID riid, void **ret)
{ {
FIXME("%p, %p, %p, %s, %p.\n", iface, pbc, pmkToLeft, debugstr_guid(riid), ret); struct new_moniker *moniker = impl_from_IMoniker(iface);
IClassActivator *activator;
IClassFactory *factory;
BIND_OPTS2 bindopts;
MULTI_QI qi;
HRESULT hr;
return E_NOTIMPL; TRACE("%p, %p, %p, %s, %p.\n", iface, pbc, pmkToLeft, debugstr_guid(riid), ret);
bindopts.cbStruct = sizeof(bindopts);
if (FAILED(hr = IBindCtx_GetBindOptions(pbc, (BIND_OPTS *)&bindopts)))
return hr;
if (!pmkToLeft)
{
qi.pIID = riid;
qi.pItf = NULL;
qi.hr = S_OK;
hr = CoCreateInstanceEx(&moniker->clsid, NULL, bindopts.dwClassContext, bindopts.pServerInfo, 1, &qi);
*ret = qi.pItf;
}
else
{
if (SUCCEEDED(hr = IMoniker_BindToObject(pmkToLeft, pbc, NULL, &IID_IClassActivator, (void **)&activator)))
{
hr = IClassActivator_GetClassObject(activator, &moniker->clsid, bindopts.dwClassContext, bindopts.locale, riid, ret);
IClassActivator_Release(activator);
}
else if (SUCCEEDED(hr = IMoniker_BindToObject(pmkToLeft, pbc, NULL, &IID_IClassFactory, (void **)&factory)))
{
hr = IClassFactory_CreateInstance(factory, NULL, riid, ret);
IClassFactory_Release(factory);
}
}
return hr;
} }
static HRESULT WINAPI new_moniker_BindToStorage(IMoniker *iface, IBindCtx *pbc, IMoniker *pmkToLeft, REFIID riid, static HRESULT WINAPI new_moniker_BindToStorage(IMoniker *iface, IBindCtx *pbc, IMoniker *pmkToLeft, REFIID riid,
......
...@@ -352,10 +352,8 @@ todo_wine ...@@ -352,10 +352,8 @@ todo_wine
ok(hr == MK_E_UNAVAILABLE, "Unexpected hr %#x.\n", hr); ok(hr == MK_E_UNAVAILABLE, "Unexpected hr %#x.\n", hr);
hr = IMoniker_BindToObject(moniker, bindctx, NULL, &IID_IUnknown, (void **)&obj); hr = IMoniker_BindToObject(moniker, bindctx, NULL, &IID_IUnknown, (void **)&obj);
todo_wine
ok(hr == S_OK, "Failed to bind to object, hr %#x.\n", hr); ok(hr == S_OK, "Failed to bind to object, hr %#x.\n", hr);
if (SUCCEEDED(hr)) IUnknown_Release(obj);
IUnknown_Release(obj);
hr = IMoniker_BindToStorage(moniker, bindctx, NULL, &IID_IUnknown, (void **)&obj); hr = IMoniker_BindToStorage(moniker, bindctx, NULL, &IID_IUnknown, (void **)&obj);
todo_wine todo_wine
...@@ -423,10 +421,8 @@ todo_wine ...@@ -423,10 +421,8 @@ todo_wine
bind_opts.dwClassContext = CLSCTX_INPROC_SERVER; bind_opts.dwClassContext = CLSCTX_INPROC_SERVER;
hr = CoGetObject(L"new:msxml2.domdocument", (BIND_OPTS *)&bind_opts, &IID_IXMLDOMDocument, (void **)&obj); hr = CoGetObject(L"new:msxml2.domdocument", (BIND_OPTS *)&bind_opts, &IID_IXMLDOMDocument, (void **)&obj);
todo_wine
ok(hr == S_OK, "Failed to create object, hr %#x.\n", hr); ok(hr == S_OK, "Failed to create object, hr %#x.\n", hr);
if (SUCCEEDED(hr)) IUnknown_Release(obj);
IUnknown_Release(obj);
IBindCtx_Release(bindctx); IBindCtx_Release(bindctx);
} }
......
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