mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-06 04:40:48 +00:00
atl100: Fixed AtlAdvise and AtlUnadvise crashing with NULL pUnkCP.
This commit is contained in:
parent
af59b20c80
commit
8d18b89346
|
@ -51,6 +51,9 @@ HRESULT WINAPI AtlAdvise(IUnknown *pUnkCP, IUnknown *pUnk, const IID *iid, DWORD
|
|||
|
||||
TRACE("%p %p %p %p\n", pUnkCP, pUnk, iid, pdw);
|
||||
|
||||
if(!pUnkCP)
|
||||
return E_INVALIDARG;
|
||||
|
||||
hres = IUnknown_QueryInterface(pUnkCP, &IID_IConnectionPointContainer, (void**)&container);
|
||||
if(FAILED(hres))
|
||||
return hres;
|
||||
|
@ -76,6 +79,9 @@ HRESULT WINAPI AtlUnadvise(IUnknown *pUnkCP, const IID *iid, DWORD dw)
|
|||
|
||||
TRACE("%p %p %d\n", pUnkCP, iid, dw);
|
||||
|
||||
if(!pUnkCP)
|
||||
return E_INVALIDARG;
|
||||
|
||||
hres = IUnknown_QueryInterface(pUnkCP, &IID_IConnectionPointContainer, (void**)&container);
|
||||
if(FAILED(hres))
|
||||
return hres;
|
||||
|
|
|
@ -359,6 +359,12 @@ static void test_cp(void)
|
|||
DWORD cookie = 0;
|
||||
HRESULT hres;
|
||||
|
||||
hres = AtlAdvise(NULL, (IUnknown*)0xdeed0000, &CLSID_Test, &cookie);
|
||||
ok(hres == E_INVALIDARG, "expect E_INVALIDARG, returned %08x\n", hres);
|
||||
|
||||
hres = AtlUnadvise(NULL, &CLSID_Test, 0xdeadbeef);
|
||||
ok(hres == E_INVALIDARG, "expect E_INVALIDARG, returned %08x\n", hres);
|
||||
|
||||
hres = AtlAdvise((IUnknown*)&ConnectionPointContainer, (IUnknown*)0xdead0000, &CLSID_Test, &cookie);
|
||||
ok(hres == S_OK, "AtlAdvise failed: %08x\n", hres);
|
||||
ok(cookie == 0xdeadbeef, "cookie = %x\n", cookie);
|
||||
|
|
Loading…
Reference in a new issue