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

This commit is contained in:
James Hawkins 2009-12-04 17:16:16 -08:00 committed by Alexandre Julliard
parent b614052895
commit 4687604356
2 changed files with 3 additions and 1 deletions

View File

@ -1585,6 +1585,8 @@ static HRESULT WINAPI InstallerImpl_Invoke(
case DISPID_INSTALLER_OPENPACKAGE: case DISPID_INSTALLER_OPENPACKAGE:
if (wFlags & DISPATCH_METHOD) if (wFlags & DISPATCH_METHOD)
{ {
if (pDispParams->cArgs == 0)
return DISP_E_TYPEMISMATCH;
hr = DispGetParam(pDispParams, 0, VT_BSTR, &varg0, puArgErr); hr = DispGetParam(pDispParams, 0, VT_BSTR, &varg0, puArgErr);
if (FAILED(hr)) return hr; if (FAILED(hr)) return hr;
hr = DispGetParam(pDispParams, 1, VT_I4, &varg1, puArgErr); hr = DispGetParam(pDispParams, 1, VT_I4, &varg1, puArgErr);

View File

@ -642,7 +642,7 @@ static void test_dispatch(void)
/* Try with NULL params */ /* Try with NULL params */
hr = IDispatch_Invoke(pInstaller, dispid, &IID_NULL, LOCALE_NEUTRAL, DISPATCH_METHOD, &dispparams, &varresult, &excepinfo, NULL); 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 */ /* Try one empty parameter */
dispparams.rgvarg = vararg; dispparams.rgvarg = vararg;