Rob Shearman : ole32: CreateBindCtx should fail if reserved parameter is not zero.

Alexandre Julliard julliard at wine.codeweavers.com
Thu Mar 8 07:17:11 CST 2007


Module: wine
Branch: master
Commit: bf4b5188e0f6881609542855589dc5b4746d96c1
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=bf4b5188e0f6881609542855589dc5b4746d96c1

Author: Rob Shearman <rob at codeweavers.com>
Date:   Thu Mar  8 10:59:38 2007 +0000

ole32: CreateBindCtx should fail if reserved parameter is not zero.

---

 dlls/ole32/bindctx.c       |    8 ++++++++
 dlls/ole32/tests/moniker.c |    1 -
 2 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/dlls/ole32/bindctx.c b/dlls/ole32/bindctx.c
index 2dae2c4..9a7e4df 100644
--- a/dlls/ole32/bindctx.c
+++ b/dlls/ole32/bindctx.c
@@ -536,6 +536,14 @@ HRESULT WINAPI CreateBindCtx(DWORD reserved, LPBC * ppbc)
 
     TRACE("(%d,%p)\n",reserved,ppbc);
 
+    *ppbc = NULL;
+
+    if (reserved != 0)
+    {
+        ERR("reserved should be 0, not 0x%x\n", reserved);
+        return E_INVALIDARG;
+    }
+
     newBindCtx = HeapAlloc(GetProcessHeap(), 0, sizeof(BindCtxImpl));
     if (newBindCtx == 0)
         return E_OUTOFMEMORY;
diff --git a/dlls/ole32/tests/moniker.c b/dlls/ole32/tests/moniker.c
index 861fc33..e628aca 100644
--- a/dlls/ole32/tests/moniker.c
+++ b/dlls/ole32/tests/moniker.c
@@ -1448,7 +1448,6 @@ static void test_bind_context(void)
     static const WCHAR wszParamName[] = {'G','e','m','m','a',0};
 
     hr = CreateBindCtx(0xdeadbeef, &pBindCtx);
-    todo_wine
     ok(hr == E_INVALIDARG, "CreateBindCtx with reserved value non-zero should have returned E_INVALIDARG instead of 0x%08x\n", hr);
 
     hr = CreateBindCtx(0, &pBindCtx);




More information about the wine-cvs mailing list