Module: wine Branch: master Commit: 43b38e1420801cb34ed6a6ca98af95bf658bb8af URL: http://source.winehq.org/git/wine.git/?a=commit;h=43b38e1420801cb34ed6a6ca98...
Author: Piotr Caban piotr@codeweavers.com Date: Wed Feb 1 10:41:58 2012 +0100
mshtml: Make cookie parameter optional in ConnectionPoint_Advise.
---
dlls/mshtml/conpoint.c | 3 ++- dlls/mshtml/tests/htmldoc.c | 4 ++++ 2 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/dlls/mshtml/conpoint.c b/dlls/mshtml/conpoint.c index ca45524..691a8c9 100644 --- a/dlls/mshtml/conpoint.c +++ b/dlls/mshtml/conpoint.c @@ -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); diff --git a/dlls/mshtml/tests/htmldoc.c b/dlls/mshtml/tests/htmldoc.c index 3f356e4..53e463a 100644 --- a/dlls/mshtml/tests/htmldoc.c +++ b/dlls/mshtml/tests/htmldoc.c @@ -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);