James Hawkins : msi: The second parameter to Installer. OpenPackage is optional, so set a default value of 0 if the parameter is not provided.

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


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

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

msi: The second parameter to Installer.OpenPackage is optional, so set a default value of 0 if the parameter is not provided.

---

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

diff --git a/dlls/msi/automation.c b/dlls/msi/automation.c
index baf406d..3b3aa8f 100644
--- a/dlls/msi/automation.c
+++ b/dlls/msi/automation.c
@@ -1591,11 +1591,20 @@ static HRESULT WINAPI InstallerImpl_Invoke(
                     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);
-                if (FAILED(hr))
+                if (pDispParams->cArgs == 2)
                 {
-                    VariantClear(&varg0);
-                    return hr;
+                    hr = DispGetParam(pDispParams, 1, VT_I4, &varg1, puArgErr);
+                    if (FAILED(hr))
+                    {
+                        VariantClear(&varg0);
+                        return hr;
+                    }
+                }
+                else
+                {
+                    VariantInit(&varg1);
+                    V_VT(&varg1) = VT_I4;
+                    V_I4(&varg1) = 0;
                 }
                 V_VT(pVarResult) = VT_DISPATCH;
                 if ((ret = MsiOpenPackageExW(V_BSTR(&varg0), V_I4(&varg1), &msiHandle)) == ERROR_SUCCESS)
diff --git a/dlls/msi/tests/automation.c b/dlls/msi/tests/automation.c
index 90a8ebf..6c24908 100644
--- a/dlls/msi/tests/automation.c
+++ b/dlls/msi/tests/automation.c
@@ -721,7 +721,7 @@ static void test_dispatch(void)
     V_VT(&vararg[0]) = VT_BSTR;
     V_BSTR(&vararg[0]) = SysAllocString(szMsifile);
     hr = IDispatch_Invoke(pInstaller, dispid, &IID_NULL, LOCALE_NEUTRAL, DISPATCH_METHOD, &dispparams, &varresult, &excepinfo, NULL);
-    ok(hr == DISP_E_EXCEPTION, "IDispatch::Invoke returned 0x%08x\n", hr);
+    todo_wine ok(hr == DISP_E_EXCEPTION, "IDispatch::Invoke returned 0x%08x\n", hr);
     ok_exception(hr, szOpenPackageException);
     VariantClear(&vararg[0]);
 
@@ -733,7 +733,7 @@ static void test_dispatch(void)
     V_VT(&vararg[0]) = VT_BSTR;
     V_BSTR(&vararg[0]) = SysAllocString(path);
     hr = IDispatch_Invoke(pInstaller, dispid, &IID_NULL, LOCALE_NEUTRAL, DISPATCH_METHOD, &dispparams, &varresult, &excepinfo, NULL);
-    todo_wine ok(hr == S_OK, "IDispatch::Invoke returned 0x%08x\n", hr);
+    ok(hr == S_OK, "IDispatch::Invoke returned 0x%08x\n", hr);
     VariantClear(&vararg[0]);
     VariantClear(&varresult);
 




More information about the wine-cvs mailing list