msscript: Implement some connection point methods.

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Nikolay Sivov 2016-07-14 14:14:28 +03:00 committed by Alexandre Julliard
parent 3ea8a700f7
commit 4058b68966
2 changed files with 45 additions and 5 deletions

View File

@ -1282,9 +1282,10 @@ static HRESULT WINAPI ConnectionPoint_GetConnectionInterface(IConnectionPoint *i
{
ConnectionPoint *This = impl_from_IConnectionPoint(iface);
FIXME("(%p)->(%p)\n", This, iid);
TRACE("(%p)->(%p)\n", This, iid);
return E_NOTIMPL;
*iid = *This->riid;
return S_OK;
}
static HRESULT WINAPI ConnectionPoint_GetConnectionPointContainer(IConnectionPoint *iface,
@ -1292,9 +1293,15 @@ static HRESULT WINAPI ConnectionPoint_GetConnectionPointContainer(IConnectionPoi
{
ConnectionPoint *This = impl_from_IConnectionPoint(iface);
FIXME("(%p)->(%p)\n", This, container);
TRACE("(%p)->(%p)\n", This, container);
return E_NOTIMPL;
if (!container)
return E_POINTER;
*container = &This->control->IConnectionPointContainer_iface;
IConnectionPointContainer_AddRef(*container);
return S_OK;
}
static HRESULT WINAPI ConnectionPoint_Advise(IConnectionPoint *iface, IUnknown *unk_sink,

View File

@ -782,10 +782,11 @@ if (hr == S_OK)
static void test_connectionpoints(void)
{
IConnectionPointContainer *container;
IConnectionPointContainer *container, *container2;
IConnectionPoint *cp;
IScriptControl *sc;
HRESULT hr;
IID iid;
hr = CoCreateInstance(&CLSID_ScriptControl, NULL, CLSCTX_INPROC_SERVER|CLSCTX_INPROC_HANDLER,
&IID_IScriptControl, (void**)&sc);
@ -799,10 +800,42 @@ static void test_connectionpoints(void)
hr = IConnectionPointContainer_FindConnectionPoint(container, &IID_IPropertyNotifySink, &cp);
ok(hr == S_OK, "got 0x%08x\n", hr);
if (0) /* crashes on win2k3 */
{
hr = IConnectionPoint_GetConnectionPointContainer(cp, NULL);
ok(hr == E_POINTER, "got 0x%08x\n", hr);
}
hr = IConnectionPoint_GetConnectionInterface(cp, &iid);
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(IsEqualIID(&iid, &IID_IPropertyNotifySink), "got %s\n", wine_dbgstr_guid(&iid));
hr = IConnectionPoint_GetConnectionPointContainer(cp, &container2);
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(container2 == container, "got %p, expected %p\n", container2, container);
IConnectionPointContainer_Release(container2);
IConnectionPoint_Release(cp);
hr = IConnectionPointContainer_FindConnectionPoint(container, &DIID_DScriptControlSource, &cp);
ok(hr == S_OK, "got 0x%08x\n", hr);
if (0) /* crashes on win2k3 */
{
hr = IConnectionPoint_GetConnectionPointContainer(cp, NULL);
ok(hr == E_POINTER, "got 0x%08x\n", hr);
}
hr = IConnectionPoint_GetConnectionInterface(cp, &iid);
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(IsEqualIID(&iid, &DIID_DScriptControlSource), "got %s\n", wine_dbgstr_guid(&iid));
hr = IConnectionPoint_GetConnectionPointContainer(cp, &container2);
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(container2 == container, "got %p, expected %p\n", container2, container);
IConnectionPointContainer_Release(container2);
IConnectionPoint_Release(cp);
IConnectionPointContainer_Release(container);