ole32: Add a NULL pointer check in CoDisconnectObject.

This commit is contained in:
Alexandre Julliard 2012-05-14 18:24:19 +02:00
parent 5de180beeb
commit 2736d28064
2 changed files with 5 additions and 0 deletions

View File

@ -1557,6 +1557,8 @@ HRESULT WINAPI CoDisconnectObject( LPUNKNOWN lpUnk, DWORD reserved )
TRACE("(%p, 0x%08x)\n", lpUnk, reserved);
if (!lpUnk) return E_INVALIDARG;
hr = IUnknown_QueryInterface(lpUnk, &IID_IMarshal, (void **)&marshal);
if (hr == S_OK)
{

View File

@ -1331,6 +1331,9 @@ static void test_disconnect_stub(void)
CoDisconnectObject((IUnknown*)&Test_ClassFactory, 0);
ok_no_locks();
hr = CoDisconnectObject(NULL, 0);
ok( hr == E_INVALIDARG, "wrong status %x\n", hr );
}
/* tests failure case of a same-thread marshal and unmarshal twice */