Commit aa9f4beb authored by Misha Koshelev's avatar Misha Koshelev Committed by Alexandre Julliard

msi: automation: Return DISP_E_MEMBERNOTFOUND if flags are incorrect.

parent 6bb7c911
...@@ -597,6 +597,7 @@ static HRESULT WINAPI RecordImpl_Invoke( ...@@ -597,6 +597,7 @@ static HRESULT WINAPI RecordImpl_Invoke(
return DISP_E_EXCEPTION; return DISP_E_EXCEPTION;
} }
} }
else return DISP_E_MEMBERNOTFOUND;
break; break;
default: default:
...@@ -637,6 +638,7 @@ static HRESULT WINAPI StringListImpl_Invoke( ...@@ -637,6 +638,7 @@ static HRESULT WINAPI StringListImpl_Invoke(
V_VT(pVarResult) = VT_BSTR; V_VT(pVarResult) = VT_BSTR;
V_BSTR(pVarResult) = SysAllocString(data->pszStrings[V_I4(&varg0)]); V_BSTR(pVarResult) = SysAllocString(data->pszStrings[V_I4(&varg0)]);
} }
else return DISP_E_MEMBERNOTFOUND;
break; break;
case DISPID_STRINGLIST_COUNT: case DISPID_STRINGLIST_COUNT:
...@@ -644,6 +646,7 @@ static HRESULT WINAPI StringListImpl_Invoke( ...@@ -644,6 +646,7 @@ static HRESULT WINAPI StringListImpl_Invoke(
V_VT(pVarResult) = VT_I4; V_VT(pVarResult) = VT_I4;
V_I4(pVarResult) = data->iCount; V_I4(pVarResult) = data->iCount;
} }
else return DISP_E_MEMBERNOTFOUND;
break; break;
default: default:
...@@ -696,6 +699,7 @@ static HRESULT WINAPI ViewImpl_Invoke( ...@@ -696,6 +699,7 @@ static HRESULT WINAPI ViewImpl_Invoke(
else else
MsiViewExecute(This->msiHandle, 0); MsiViewExecute(This->msiHandle, 0);
} }
else return DISP_E_MEMBERNOTFOUND;
break; break;
case DISPID_VIEW_FETCH: case DISPID_VIEW_FETCH:
...@@ -720,6 +724,7 @@ static HRESULT WINAPI ViewImpl_Invoke( ...@@ -720,6 +724,7 @@ static HRESULT WINAPI ViewImpl_Invoke(
return DISP_E_EXCEPTION; return DISP_E_EXCEPTION;
} }
} }
else return DISP_E_MEMBERNOTFOUND;
break; break;
case DISPID_VIEW_CLOSE: case DISPID_VIEW_CLOSE:
...@@ -727,6 +732,7 @@ static HRESULT WINAPI ViewImpl_Invoke( ...@@ -727,6 +732,7 @@ static HRESULT WINAPI ViewImpl_Invoke(
{ {
MsiViewClose(This->msiHandle); MsiViewClose(This->msiHandle);
} }
else return DISP_E_MEMBERNOTFOUND;
break; break;
default: default:
...@@ -784,6 +790,7 @@ static HRESULT WINAPI DatabaseImpl_Invoke( ...@@ -784,6 +790,7 @@ static HRESULT WINAPI DatabaseImpl_Invoke(
return DISP_E_EXCEPTION; return DISP_E_EXCEPTION;
} }
} }
else return DISP_E_MEMBERNOTFOUND;
break; break;
default: default:
...@@ -829,6 +836,7 @@ static HRESULT WINAPI SessionImpl_Invoke( ...@@ -829,6 +836,7 @@ static HRESULT WINAPI SessionImpl_Invoke(
IDispatch_AddRef(data->pInstaller); IDispatch_AddRef(data->pInstaller);
V_DISPATCH(pVarResult) = data->pInstaller; V_DISPATCH(pVarResult) = data->pInstaller;
} }
else return DISP_E_MEMBERNOTFOUND;
break; break;
case DISPID_SESSION_PROPERTY: case DISPID_SESSION_PROPERTY:
...@@ -866,6 +874,7 @@ static HRESULT WINAPI SessionImpl_Invoke( ...@@ -866,6 +874,7 @@ static HRESULT WINAPI SessionImpl_Invoke(
return DISP_E_EXCEPTION; return DISP_E_EXCEPTION;
} }
} }
else return DISP_E_MEMBERNOTFOUND;
break; break;
case DISPID_SESSION_LANGUAGE: case DISPID_SESSION_LANGUAGE:
...@@ -874,6 +883,7 @@ static HRESULT WINAPI SessionImpl_Invoke( ...@@ -874,6 +883,7 @@ static HRESULT WINAPI SessionImpl_Invoke(
V_VT(pVarResult) = VT_I4; V_VT(pVarResult) = VT_I4;
V_I4(pVarResult) = langId; V_I4(pVarResult) = langId;
} }
else return DISP_E_MEMBERNOTFOUND;
break; break;
case DISPID_SESSION_MODE: case DISPID_SESSION_MODE:
...@@ -893,6 +903,7 @@ static HRESULT WINAPI SessionImpl_Invoke( ...@@ -893,6 +903,7 @@ static HRESULT WINAPI SessionImpl_Invoke(
return DISP_E_EXCEPTION; return DISP_E_EXCEPTION;
} }
} }
else return DISP_E_MEMBERNOTFOUND;
break; break;
case DISPID_SESSION_DATABASE: case DISPID_SESSION_DATABASE:
...@@ -914,6 +925,7 @@ static HRESULT WINAPI SessionImpl_Invoke( ...@@ -914,6 +925,7 @@ static HRESULT WINAPI SessionImpl_Invoke(
return DISP_E_EXCEPTION; return DISP_E_EXCEPTION;
} }
} }
else return DISP_E_MEMBERNOTFOUND;
break; break;
case DISPID_SESSION_DOACTION: case DISPID_SESSION_DOACTION:
...@@ -954,6 +966,7 @@ static HRESULT WINAPI SessionImpl_Invoke( ...@@ -954,6 +966,7 @@ static HRESULT WINAPI SessionImpl_Invoke(
return DISP_E_EXCEPTION; return DISP_E_EXCEPTION;
} }
} }
else return DISP_E_MEMBERNOTFOUND;
break; break;
case DISPID_SESSION_EVALUATECONDITION: case DISPID_SESSION_EVALUATECONDITION:
...@@ -963,16 +976,20 @@ static HRESULT WINAPI SessionImpl_Invoke( ...@@ -963,16 +976,20 @@ static HRESULT WINAPI SessionImpl_Invoke(
V_VT(pVarResult) = VT_I4; V_VT(pVarResult) = VT_I4;
V_I4(pVarResult) = MsiEvaluateConditionW(This->msiHandle, V_BSTR(&varg0)); V_I4(pVarResult) = MsiEvaluateConditionW(This->msiHandle, V_BSTR(&varg0));
} }
else return DISP_E_MEMBERNOTFOUND;
break; break;
case DISPID_SESSION_SETINSTALLLEVEL: case DISPID_SESSION_SETINSTALLLEVEL:
hr = DispGetParam(pDispParams, 0, VT_I4, &varg0, puArgErr); if (wFlags & DISPATCH_METHOD) {
if (FAILED(hr)) return hr; hr = DispGetParam(pDispParams, 0, VT_I4, &varg0, puArgErr);
if ((ret = MsiSetInstallLevel(This->msiHandle, V_I4(&varg0))) != ERROR_SUCCESS) if (FAILED(hr)) return hr;
{ if ((ret = MsiSetInstallLevel(This->msiHandle, V_I4(&varg0))) != ERROR_SUCCESS)
ERR("MsiSetInstallLevel returned %d\n", ret); {
return DISP_E_EXCEPTION; ERR("MsiSetInstallLevel returned %d\n", ret);
return DISP_E_EXCEPTION;
}
} }
else return DISP_E_MEMBERNOTFOUND;
break; break;
case DISPID_SESSION_FEATURECURRENTSTATE: case DISPID_SESSION_FEATURECURRENTSTATE:
...@@ -988,6 +1005,7 @@ static HRESULT WINAPI SessionImpl_Invoke( ...@@ -988,6 +1005,7 @@ static HRESULT WINAPI SessionImpl_Invoke(
V_I4(pVarResult) = msiInstallStateUnknown; V_I4(pVarResult) = msiInstallStateUnknown;
} }
} }
else return DISP_E_MEMBERNOTFOUND;
break; break;
case DISPID_SESSION_FEATUREREQUESTSTATE: case DISPID_SESSION_FEATUREREQUESTSTATE:
...@@ -1017,6 +1035,7 @@ static HRESULT WINAPI SessionImpl_Invoke( ...@@ -1017,6 +1035,7 @@ static HRESULT WINAPI SessionImpl_Invoke(
return DISP_E_EXCEPTION; return DISP_E_EXCEPTION;
} }
} }
else return DISP_E_MEMBERNOTFOUND;
break; break;
default: default:
...@@ -1137,6 +1156,7 @@ static HRESULT WINAPI InstallerImpl_Invoke( ...@@ -1137,6 +1156,7 @@ static HRESULT WINAPI InstallerImpl_Invoke(
return DISP_E_EXCEPTION; return DISP_E_EXCEPTION;
} }
} }
else return DISP_E_MEMBERNOTFOUND;
break; break;
case DISPID_INSTALLER_OPENPACKAGE: case DISPID_INSTALLER_OPENPACKAGE:
...@@ -1168,6 +1188,7 @@ static HRESULT WINAPI InstallerImpl_Invoke( ...@@ -1168,6 +1188,7 @@ static HRESULT WINAPI InstallerImpl_Invoke(
return DISP_E_EXCEPTION; return DISP_E_EXCEPTION;
} }
} }
else return DISP_E_MEMBERNOTFOUND;
break; break;
case DISPID_INSTALLER_REGISTRYVALUE: case DISPID_INSTALLER_REGISTRYVALUE:
...@@ -1257,6 +1278,7 @@ static HRESULT WINAPI InstallerImpl_Invoke( ...@@ -1257,6 +1278,7 @@ static HRESULT WINAPI InstallerImpl_Invoke(
msi_free(szString); msi_free(szString);
RegCloseKey(hkey); RegCloseKey(hkey);
} }
else return DISP_E_MEMBERNOTFOUND;
break; break;
case DISPID_INSTALLER_PRODUCTSTATE: case DISPID_INSTALLER_PRODUCTSTATE:
...@@ -1266,6 +1288,7 @@ static HRESULT WINAPI InstallerImpl_Invoke( ...@@ -1266,6 +1288,7 @@ static HRESULT WINAPI InstallerImpl_Invoke(
V_VT(pVarResult) = VT_I4; V_VT(pVarResult) = VT_I4;
V_I4(pVarResult) = MsiQueryProductStateW(V_BSTR(&varg0)); V_I4(pVarResult) = MsiQueryProductStateW(V_BSTR(&varg0));
} }
else return DISP_E_MEMBERNOTFOUND;
break; break;
case DISPID_INSTALLER_PRODUCTS: case DISPID_INSTALLER_PRODUCTS:
...@@ -1306,6 +1329,7 @@ static HRESULT WINAPI InstallerImpl_Invoke( ...@@ -1306,6 +1329,7 @@ static HRESULT WINAPI InstallerImpl_Invoke(
else else
ERR("Failed to create StringList object, hresult 0x%08x\n", hr); ERR("Failed to create StringList object, hresult 0x%08x\n", hr);
} }
else return DISP_E_MEMBERNOTFOUND;
break; break;
default: default:
......
...@@ -449,11 +449,11 @@ static void test_dispatch(void) ...@@ -449,11 +449,11 @@ static void test_dispatch(void)
/* Test invoking a method as a DISPATCH_PROPERTYGET or DISPATCH_PROPERTYPUT */ /* Test invoking a method as a DISPATCH_PROPERTYGET or DISPATCH_PROPERTYPUT */
VariantInit(&vararg[0]); VariantInit(&vararg[0]);
hr = IDispatch_Invoke(pInstaller, dispid, &IID_NULL, LOCALE_NEUTRAL, DISPATCH_PROPERTYGET, &dispparams, &varresult, &excepinfo, NULL); hr = IDispatch_Invoke(pInstaller, dispid, &IID_NULL, LOCALE_NEUTRAL, DISPATCH_PROPERTYGET, &dispparams, &varresult, &excepinfo, NULL);
todo_wine ok(hr == DISP_E_MEMBERNOTFOUND, "IDispatch::Invoke returned 0x%08x\n", hr); ok(hr == DISP_E_MEMBERNOTFOUND, "IDispatch::Invoke returned 0x%08x\n", hr);
VariantInit(&vararg[0]); VariantInit(&vararg[0]);
hr = IDispatch_Invoke(pInstaller, dispid, &IID_NULL, LOCALE_NEUTRAL, DISPATCH_PROPERTYPUT, &dispparams, &varresult, &excepinfo, NULL); hr = IDispatch_Invoke(pInstaller, dispid, &IID_NULL, LOCALE_NEUTRAL, DISPATCH_PROPERTYPUT, &dispparams, &varresult, &excepinfo, NULL);
todo_wine ok(hr == DISP_E_MEMBERNOTFOUND, "IDispatch::Invoke returned 0x%08x\n", hr); ok(hr == DISP_E_MEMBERNOTFOUND, "IDispatch::Invoke returned 0x%08x\n", hr);
/* Test invoking a read-only property as DISPATCH_PROPERTYPUT or as a DISPATCH_METHOD */ /* Test invoking a read-only property as DISPATCH_PROPERTYPUT or as a DISPATCH_METHOD */
name = (WCHAR *)szProductState; name = (WCHAR *)szProductState;
...@@ -463,12 +463,12 @@ static void test_dispatch(void) ...@@ -463,12 +463,12 @@ static void test_dispatch(void)
dispparams.rgvarg = NULL; dispparams.rgvarg = NULL;
dispparams.cArgs = 0; dispparams.cArgs = 0;
hr = IDispatch_Invoke(pInstaller, dispid, &IID_NULL, LOCALE_NEUTRAL, DISPATCH_PROPERTYPUT, &dispparams, &varresult, &excepinfo, NULL); hr = IDispatch_Invoke(pInstaller, dispid, &IID_NULL, LOCALE_NEUTRAL, DISPATCH_PROPERTYPUT, &dispparams, &varresult, &excepinfo, NULL);
todo_wine ok(hr == DISP_E_MEMBERNOTFOUND, "IDispatch::Invoke returned 0x%08x\n", hr); ok(hr == DISP_E_MEMBERNOTFOUND, "IDispatch::Invoke returned 0x%08x\n", hr);
dispparams.rgvarg = NULL; dispparams.rgvarg = NULL;
dispparams.cArgs = 0; dispparams.cArgs = 0;
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_MEMBERNOTFOUND, "IDispatch::Invoke returned 0x%08x\n", hr); ok(hr == DISP_E_MEMBERNOTFOUND, "IDispatch::Invoke returned 0x%08x\n", hr);
} }
/* invocation helper function */ /* invocation helper function */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment