ole32: Fix return codes returned by IBindCtx::RegisterObjectBound and IBindCtx::RevokeObjectBound when used on NULL objects.

This commit is contained in:
Rob Shearman 2007-03-09 09:48:26 +00:00 committed by Alexandre Julliard
parent ba3ceaa4b8
commit c4727fde17
2 changed files with 4 additions and 3 deletions

View File

@ -158,7 +158,7 @@ BindCtxImpl_RegisterObjectBound(IBindCtx* iface,IUnknown* punk)
TRACE("(%p,%p)\n",This,punk);
if (punk==NULL)
return E_POINTER;
return S_OK;
IUnknown_AddRef(punk);
@ -197,6 +197,9 @@ BindCtxImpl_RevokeObjectBound(IBindCtx* iface, IUnknown* punk)
TRACE("(%p,%p)\n",This,punk);
if (!punk)
return E_INVALIDARG;
/* check if the object was registered or not */
if (BindCtxImpl_GetObjectIndex(This,punk,NULL,&index)==S_FALSE)
return MK_E_NOTBOUND;

View File

@ -1510,11 +1510,9 @@ static void test_bind_context(void)
ok(!pEnumString, "pEnumString should be NULL\n");
hr = IBindCtx_RegisterObjectBound(pBindCtx, NULL);
todo_wine
ok_ole_success(hr, "IBindCtx_RegisterObjectBound(NULL)");
hr = IBindCtx_RevokeObjectBound(pBindCtx, NULL);
todo_wine
ok(hr == E_INVALIDARG, "IBindCtx_RevokeObjectBound(NULL) should have return E_INVALIDARG instead of 0x%08x\n", hr);
unknown2 = HeapAlloc(GetProcessHeap(), 0, sizeof(*unknown));