Rob Shearman : ole32: Fix return codes returned by IBindCtx::
RegisterObjectBound and IBindCtx::
RevokeObjectBound when used on NULL objects.
Alexandre Julliard
julliard at wine.codeweavers.com
Fri Mar 9 07:28:28 CST 2007
Module: wine
Branch: master
Commit: c4727fde17c8700e4670f999eb960194034f0f13
URL: http://source.winehq.org/git/wine.git/?a=commit;h=c4727fde17c8700e4670f999eb960194034f0f13
Author: Rob Shearman <rob at codeweavers.com>
Date: Fri Mar 9 09:48:26 2007 +0000
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 464d02e..1dc702d 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 6b8a35a..aa7c30f 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));
More information about the wine-cvs
mailing list