From c4727fde17c8700e4670f999eb960194034f0f13 Mon Sep 17 00:00:00 2001 From: Rob Shearman Date: Fri, 9 Mar 2007 09:48:26 +0000 Subject: [PATCH] ole32: Fix return codes returned by IBindCtx::RegisterObjectBound and IBindCtx::RevokeObjectBound when used on NULL objects. --- dlls/ole32/bindctx.c | 5 ++++- dlls/ole32/tests/moniker.c | 2 -- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/dlls/ole32/bindctx.c b/dlls/ole32/bindctx.c index 464d02e449e..1dc702d1780 100644 --- a/dlls/ole32/bindctx.c +++ b/dlls/ole32/bindctx.c @@ -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; diff --git a/dlls/ole32/tests/moniker.c b/dlls/ole32/tests/moniker.c index 6b8a35a545b..aa7c30f74ed 100644 --- a/dlls/ole32/tests/moniker.c +++ b/dlls/ole32/tests/moniker.c @@ -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));