Commit 4058b689 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

msscript: Implement some connection point methods.

parent 3ea8a700
......@@ -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,
......
......@@ -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);
......
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