James Hawkins : msi: Verify that the first parameter to Installer. OpenPackage is a VT_BSTR.

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


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

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

msi: Verify that the first parameter to Installer.OpenPackage is a VT_BSTR.

It seems ugly to open up the parameters in pDispParams, but
DispGetParam will happily convert a VT_EMPTY to a VT_BSTR and not
return an error.

---

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

diff --git a/dlls/msi/automation.c b/dlls/msi/automation.c
index 0d02c46..baf406d 100644
--- a/dlls/msi/automation.c
+++ b/dlls/msi/automation.c
@@ -1587,6 +1587,8 @@ static HRESULT WINAPI InstallerImpl_Invoke(
             {
                 if (pDispParams->cArgs == 0)
                     return DISP_E_TYPEMISMATCH;
+                if (V_VT(&pDispParams->rgvarg[pDispParams->cArgs - 1]) != VT_BSTR)
+                    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 c7db3e4..90a8ebf 100644
--- a/dlls/msi/tests/automation.c
+++ b/dlls/msi/tests/automation.c
@@ -649,14 +649,14 @@ static void test_dispatch(void)
     dispparams.cArgs = 1;
     VariantInit(&vararg[0]);
     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 two empty parameters */
     dispparams.cArgs = 2;
     VariantInit(&vararg[0]);
     VariantInit(&vararg[1]);
     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 parameter, the required BSTR.  Second parameter is optional.
      * NOTE: The specified package does not exist, which is why the call fails.




More information about the wine-cvs mailing list