mshtml: Make cookie parameter optional in ConnectionPoint_Advise.

This commit is contained in:
Piotr Caban 2012-02-01 10:41:58 +01:00 committed by Alexandre Julliard
parent 1c1b1c0073
commit 43b38e1420
2 changed files with 6 additions and 1 deletions

View file

@ -158,7 +158,8 @@ static HRESULT WINAPI ConnectionPoint_Advise(IConnectionPoint *iface, IUnknown *
}
This->sinks[i].unk = sink;
*pdwCookie = i+1;
if(pdwCookie)
*pdwCookie = i+1;
if(!i && This->data && This->data->on_advise)
This->data->on_advise(This->container->outer, This->data);

View file

@ -4790,6 +4790,10 @@ static void test_ConnectionPoint(IConnectionPointContainer *container, REFIID ri
if(IsEqualGUID(&IID_IPropertyNotifySink, riid)) {
hres = IConnectionPoint_Advise(cp, (IUnknown*)&PropertyNotifySink, &cookie);
ok(hres == S_OK, "Advise failed: %08x\n", hres);
hres = IConnectionPoint_Unadvise(cp, cookie);
ok(hres == S_OK, "Unadvise failed: %08x\n", hres);
hres = IConnectionPoint_Advise(cp, (IUnknown*)&PropertyNotifySink, NULL);
ok(hres == S_OK, "Advise failed: %08x\n", hres);
} else if(IsEqualGUID(&IID_IDispatch, riid)) {
hres = IConnectionPoint_Advise(cp, (IUnknown*)&EventDispatch, &cookie);
ok(hres == S_OK, "Advise failed: %08x\n", hres);