Robert Shearman : oleaut32: Fix the return code for an invalid dispid in IFontDisp::Invoke.

Alexandre Julliard julliard at wine.codeweavers.com
Fri Jul 28 07:15:25 CDT 2006


Module: wine
Branch: refs/heads/master
Commit: 18732f85f91a2913e1af22b55f970056215d3a46
URL:    http://source.winehq.org/git/?p=wine.git;a=commit;h=18732f85f91a2913e1af22b55f970056215d3a46

Author: Robert Shearman <rob at codeweavers.com>
Date:   Fri Jul 28 01:21:28 2006 +0100

oleaut32: Fix the return code for an invalid dispid in IFontDisp::Invoke.

---

 dlls/oleaut32/olefont.c       |   12 +++++++-----
 dlls/oleaut32/tests/olefont.c |    6 ++++++
 2 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/dlls/oleaut32/olefont.c b/dlls/oleaut32/olefont.c
index 07bfa34..880e740 100644
--- a/dlls/oleaut32/olefont.c
+++ b/dlls/oleaut32/olefont.c
@@ -1402,6 +1402,10 @@ static HRESULT WINAPI OLEFontImpl_Invoke
   OLEFontImpl *this = impl_from_IDispatch(iface);
   HRESULT hr;
 
+  TRACE("%p->(%ld,%s,0x%lx,0x%x,%p,%p,%p,%p)\n", this, dispIdMember,
+    debugstr_guid(riid), lcid, wFlags, pDispParams, pVarResult, pExepInfo,
+    puArgErr);
+
   /* validate parameters */
 
   if (!IsEqualIID(riid, &IID_NULL))
@@ -1600,12 +1604,10 @@ static HRESULT WINAPI OLEFontImpl_Invoke
       return hr;
     }
     break;
+  default:
+    ERR("member not found for dispid 0x%lx\n", dispIdMember);
+    return DISP_E_MEMBERNOTFOUND;
   }
-  FIXME("%p->(%ld,%s,%lx,%x,%p,%p,%p,%p), unhandled dispid/flag!\n",
-    this,dispIdMember,debugstr_guid(riid),lcid,
-    wFlags,pDispParams,pVarResult,pExepInfo,puArgErr
-  );
-  return S_OK;
 }
 
 /************************************************************************
diff --git a/dlls/oleaut32/tests/olefont.c b/dlls/oleaut32/tests/olefont.c
index 9aea60d..e98e84c 100644
--- a/dlls/oleaut32/tests/olefont.c
+++ b/dlls/oleaut32/tests/olefont.c
@@ -459,6 +459,12 @@ static void test_Invoke(void)
     hr = IFontDisp_Invoke(fontdisp, DISPID_FONT_BOLD, &IID_NULL, 0, DISPATCH_PROPERTYGET, NULL, &varresult, NULL, NULL);
     ok_ole_success(hr, "IFontDisp_Invoke");
 
+    hr = IFontDisp_Invoke(fontdisp, DISPID_FONT_BOLD, &IID_NULL, 0, DISPATCH_METHOD, NULL, &varresult, NULL, NULL);
+    ok(hr == DISP_E_MEMBERNOTFOUND, "IFontDisp_Invoke should have returned DISP_E_MEMBERNOTFOUND instead of 0x%08lx\n", hr);
+
+    hr = IFontDisp_Invoke(fontdisp, 0xdeadbeef, &IID_NULL, 0, DISPATCH_PROPERTYGET, NULL, &varresult, NULL, NULL);
+    ok(hr == DISP_E_MEMBERNOTFOUND, "IFontDisp_Invoke should have returned DISP_E_MEMBERNOTFOUND instead of 0x%08lx\n", hr);
+
     IFontDisp_Release(fontdisp);
 }
 




More information about the wine-cvs mailing list