James Hawkins : msi: It' s possible to send in more than two parameters to Installer.OpenPackage, but sending in zero parameters should return DISP_E_TYPEMISMATCH.

Alexandre Julliard julliard at winehq.org
Mon Dec 7 10:26:12 CST 2009


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

Author: James Hawkins <truiken at gmail.com>
Date:   Fri Dec  4 17:16:16 2009 -0800

msi: It's possible to send in more than two parameters to Installer.OpenPackage, but sending in zero parameters should return DISP_E_TYPEMISMATCH.

---

 dlls/msi/automation.c       |    2 ++
 dlls/msi/tests/automation.c |    2 +-
 2 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/dlls/msi/automation.c b/dlls/msi/automation.c
index 3b6dd2d..0d02c46 100644
--- a/dlls/msi/automation.c
+++ b/dlls/msi/automation.c
@@ -1585,6 +1585,8 @@ static HRESULT WINAPI InstallerImpl_Invoke(
         case DISPID_INSTALLER_OPENPACKAGE:
             if (wFlags & DISPATCH_METHOD)
             {
+                if (pDispParams->cArgs == 0)
+                    return DISP_E_TYPEMISMATCH;
                 hr = DispGetParam(pDispParams, 0, VT_BSTR, &varg0, puArgErr);
                 if (FAILED(hr)) return hr;
                 hr = DispGetParam(pDispParams, 1, VT_I4, &varg1, puArgErr);
diff --git a/dlls/msi/tests/automation.c b/dlls/msi/tests/automation.c
index 6c6c303..c7db3e4 100644
--- a/dlls/msi/tests/automation.c
+++ b/dlls/msi/tests/automation.c
@@ -642,7 +642,7 @@ static void test_dispatch(void)
 
     /* Try with NULL params */
     hr = IDispatch_Invoke(pInstaller, dispid, &IID_NULL, LOCALE_NEUTRAL, DISPATCH_METHOD, &dispparams, &varresult, &excepinfo, NULL);
-    todo_wine ok(hr == DISP_E_TYPEMISMATCH, "IDispatch::Invoke returned 0x%08x\n", hr);
+    ok(hr == DISP_E_TYPEMISMATCH, "IDispatch::Invoke returned 0x%08x\n", hr);
 
     /* Try one empty parameter */
     dispparams.rgvarg = vararg;




More information about the wine-cvs mailing list