Commit 937b6430 authored by Misha Koshelev's avatar Misha Koshelev Committed by Alexandre Julliard

msi: automation: Change all tabs to spaces to conform to msi formatting.

parent 63ed9117
...@@ -110,19 +110,19 @@ HRESULT load_type_info(IDispatch *iface, ITypeInfo **pptinfo, REFIID clsid, LCID ...@@ -110,19 +110,19 @@ HRESULT load_type_info(IDispatch *iface, ITypeInfo **pptinfo, REFIID clsid, LCID
/* Load registered type library */ /* Load registered type library */
hr = LoadRegTypeLib(&LIBID_WindowsInstaller, 1, 0, lcid, &pLib); hr = LoadRegTypeLib(&LIBID_WindowsInstaller, 1, 0, lcid, &pLib);
if (FAILED(hr)) { if (FAILED(hr)) {
hr = LoadTypeLib(szMsiServer, &pLib); hr = LoadTypeLib(szMsiServer, &pLib);
if (FAILED(hr)) { if (FAILED(hr)) {
ERR("Could not load msiserver.tlb\n"); ERR("Could not load msiserver.tlb\n");
return hr; return hr;
} }
} }
/* Get type information for object */ /* Get type information for object */
hr = ITypeLib_GetTypeInfoOfGuid(pLib, clsid, &pInfo); hr = ITypeLib_GetTypeInfoOfGuid(pLib, clsid, &pInfo);
ITypeLib_Release(pLib); ITypeLib_Release(pLib);
if (FAILED(hr)) { if (FAILED(hr)) {
ERR("Could not load ITypeInfo for %s\n", debugstr_guid(clsid)); ERR("Could not load ITypeInfo for %s\n", debugstr_guid(clsid));
return hr; return hr;
} }
*pptinfo = pInfo; *pptinfo = pInfo;
return S_OK; return S_OK;
...@@ -131,8 +131,8 @@ HRESULT load_type_info(IDispatch *iface, ITypeInfo **pptinfo, REFIID clsid, LCID ...@@ -131,8 +131,8 @@ HRESULT load_type_info(IDispatch *iface, ITypeInfo **pptinfo, REFIID clsid, LCID
/* Create the automation object, placing the result in the pointer ppObj. The automation object is created /* Create the automation object, placing the result in the pointer ppObj. The automation object is created
* with the appropriate clsid and invocation function. */ * with the appropriate clsid and invocation function. */
HRESULT create_automation_object(MSIHANDLE msiHandle, IUnknown *pUnkOuter, LPVOID *ppObj, REFIID clsid, HRESULT create_automation_object(MSIHANDLE msiHandle, IUnknown *pUnkOuter, LPVOID *ppObj, REFIID clsid,
HRESULT (STDMETHODCALLTYPE *funcInvoke)(AutomationObject*,DISPID,REFIID,LCID,WORD,DISPPARAMS*, HRESULT (STDMETHODCALLTYPE *funcInvoke)(AutomationObject*,DISPID,REFIID,LCID,WORD,DISPPARAMS*,
VARIANT*,EXCEPINFO*,UINT*), VARIANT*,EXCEPINFO*,UINT*),
void (STDMETHODCALLTYPE *funcFree)(AutomationObject*), void (STDMETHODCALLTYPE *funcFree)(AutomationObject*),
SIZE_T sizetPrivateData) SIZE_T sizetPrivateData)
{ {
...@@ -142,7 +142,7 @@ HRESULT create_automation_object(MSIHANDLE msiHandle, IUnknown *pUnkOuter, LPVOI ...@@ -142,7 +142,7 @@ HRESULT create_automation_object(MSIHANDLE msiHandle, IUnknown *pUnkOuter, LPVOI
TRACE("(%ld,%p,%p,%s,%p,%p,%ld)\n", (unsigned long)msiHandle, pUnkOuter, ppObj, debugstr_guid(clsid), funcInvoke, funcFree, sizetPrivateData); TRACE("(%ld,%p,%p,%s,%p,%p,%ld)\n", (unsigned long)msiHandle, pUnkOuter, ppObj, debugstr_guid(clsid), funcInvoke, funcFree, sizetPrivateData);
if( pUnkOuter ) if( pUnkOuter )
return CLASS_E_NOAGGREGATION; return CLASS_E_NOAGGREGATION;
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(AutomationObject)+sizetPrivateData); object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(AutomationObject)+sizetPrivateData);
...@@ -161,8 +161,8 @@ HRESULT create_automation_object(MSIHANDLE msiHandle, IUnknown *pUnkOuter, LPVOI ...@@ -161,8 +161,8 @@ HRESULT create_automation_object(MSIHANDLE msiHandle, IUnknown *pUnkOuter, LPVOI
object->iTypeInfo = NULL; object->iTypeInfo = NULL;
hr = load_type_info((IDispatch *)object, &object->iTypeInfo, clsid, 0x0); hr = load_type_info((IDispatch *)object, &object->iTypeInfo, clsid, 0x0);
if (FAILED(hr)) { if (FAILED(hr)) {
HeapFree(GetProcessHeap(), 0, object); HeapFree(GetProcessHeap(), 0, object);
return hr; return hr;
} }
*ppObj = object; *ppObj = object;
...@@ -206,8 +206,8 @@ static HRESULT WINAPI AutomationObject_QueryInterface(IDispatch* iface, REFIID r ...@@ -206,8 +206,8 @@ static HRESULT WINAPI AutomationObject_QueryInterface(IDispatch* iface, REFIID r
*ppvObject = &This->lpvtblIProvideMultipleClassInfo; *ppvObject = &This->lpvtblIProvideMultipleClassInfo;
else else
{ {
TRACE("() : asking for unsupported interface %s\n",debugstr_guid(riid)); TRACE("() : asking for unsupported interface %s\n",debugstr_guid(riid));
return E_NOINTERFACE; return E_NOINTERFACE;
} }
/* /*
...@@ -238,7 +238,7 @@ static ULONG WINAPI AutomationObject_Release(IDispatch* iface) ...@@ -238,7 +238,7 @@ static ULONG WINAPI AutomationObject_Release(IDispatch* iface)
if (!ref) if (!ref)
{ {
if (This->funcFree) This->funcFree(This); if (This->funcFree) This->funcFree(This);
MsiCloseHandle(This->msiHandle); MsiCloseHandle(This->msiHandle);
HeapFree(GetProcessHeap(), 0, This); HeapFree(GetProcessHeap(), 0, This);
} }
...@@ -322,14 +322,14 @@ static HRESULT WINAPI AutomationObject_Invoke( ...@@ -322,14 +322,14 @@ static HRESULT WINAPI AutomationObject_Invoke(
if (!IsEqualIID(riid, &IID_NULL)) if (!IsEqualIID(riid, &IID_NULL))
{ {
ERR("riid was %s instead of IID_NULL\n", debugstr_guid(riid)); ERR("riid was %s instead of IID_NULL\n", debugstr_guid(riid));
return DISP_E_UNKNOWNNAME; return DISP_E_UNKNOWNNAME;
} }
if (wFlags & DISPATCH_PROPERTYGET && !pVarResult) if (wFlags & DISPATCH_PROPERTYGET && !pVarResult)
{ {
ERR("NULL pVarResult not allowed when DISPATCH_PROPERTYGET specified\n"); ERR("NULL pVarResult not allowed when DISPATCH_PROPERTYGET specified\n");
return DISP_E_PARAMNOTOPTIONAL; return DISP_E_PARAMNOTOPTIONAL;
} }
/* This simplifies our individual object invocation functions */ /* This simplifies our individual object invocation functions */
...@@ -342,15 +342,15 @@ static HRESULT WINAPI AutomationObject_Invoke( ...@@ -342,15 +342,15 @@ static HRESULT WINAPI AutomationObject_Invoke(
/* If we are tracing, we want to see the name of the member we are invoking */ /* If we are tracing, we want to see the name of the member we are invoking */
if (TRACE_ON(msi)) if (TRACE_ON(msi))
{ {
ITypeInfo_GetDocumentation(This->iTypeInfo, dispIdMember, &bstrName, NULL, NULL, NULL); ITypeInfo_GetDocumentation(This->iTypeInfo, dispIdMember, &bstrName, NULL, NULL, NULL);
TRACE("Method %d, %s\n", dispIdMember, debugstr_w(bstrName)); TRACE("Method %d, %s\n", dispIdMember, debugstr_w(bstrName));
} }
hr = This->funcInvoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr); hr = This->funcInvoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr);
if (hr == DISP_E_MEMBERNOTFOUND) { if (hr == DISP_E_MEMBERNOTFOUND) {
if (bstrName == NULL) ITypeInfo_GetDocumentation(This->iTypeInfo, dispIdMember, &bstrName, NULL, NULL, NULL); if (bstrName == NULL) ITypeInfo_GetDocumentation(This->iTypeInfo, dispIdMember, &bstrName, NULL, NULL, NULL);
FIXME("Method %d, %s wflags %d not implemented, clsid %s\n", dispIdMember, debugstr_w(bstrName), wFlags, debugstr_guid(This->clsid)); FIXME("Method %d, %s wflags %d not implemented, clsid %s\n", dispIdMember, debugstr_w(bstrName), wFlags, debugstr_guid(This->clsid));
} }
else if (pExcepInfo && else if (pExcepInfo &&
(hr == DISP_E_PARAMNOTFOUND || (hr == DISP_E_PARAMNOTFOUND ||
...@@ -448,10 +448,10 @@ static HRESULT WINAPI AutomationObject_IProvideMultipleClassInfo_GetGUID(IProvid ...@@ -448,10 +448,10 @@ static HRESULT WINAPI AutomationObject_IProvideMultipleClassInfo_GetGUID(IProvid
TRACE("(%p/%p)->(%d,%s)\n", iface, This, dwGuidKind, debugstr_guid(pGUID)); TRACE("(%p/%p)->(%d,%s)\n", iface, This, dwGuidKind, debugstr_guid(pGUID));
if (dwGuidKind != GUIDKIND_DEFAULT_SOURCE_DISP_IID) if (dwGuidKind != GUIDKIND_DEFAULT_SOURCE_DISP_IID)
return E_INVALIDARG; return E_INVALIDARG;
else { else {
*pGUID = *This->clsid; *pGUID = *This->clsid;
return S_OK; return S_OK;
} }
} }
...@@ -478,19 +478,19 @@ static HRESULT WINAPI AutomationObject_GetInfoOfIndex(IProvideMultipleClassInfo* ...@@ -478,19 +478,19 @@ static HRESULT WINAPI AutomationObject_GetInfoOfIndex(IProvideMultipleClassInfo*
TRACE("(%p/%p)->(%d,%d,%p,%p,%p,%p,%p)\n", iface, This, iti, dwFlags, pptiCoClass, pdwTIFlags, pcdispidReserved, piidPrimary, piidSource); TRACE("(%p/%p)->(%d,%d,%p,%p,%p,%p,%p)\n", iface, This, iti, dwFlags, pptiCoClass, pdwTIFlags, pcdispidReserved, piidPrimary, piidSource);
if (iti != 0) if (iti != 0)
return E_INVALIDARG; return E_INVALIDARG;
if (dwFlags & MULTICLASSINFO_GETTYPEINFO) if (dwFlags & MULTICLASSINFO_GETTYPEINFO)
load_type_info((IDispatch *)This, pptiCoClass, This->clsid, 0); load_type_info((IDispatch *)This, pptiCoClass, This->clsid, 0);
if (dwFlags & MULTICLASSINFO_GETNUMRESERVEDDISPIDS) if (dwFlags & MULTICLASSINFO_GETNUMRESERVEDDISPIDS)
{ {
*pdwTIFlags = 0; *pdwTIFlags = 0;
*pcdispidReserved = 0; *pcdispidReserved = 0;
} }
if (dwFlags & MULTICLASSINFO_GETIIDPRIMARY){ if (dwFlags & MULTICLASSINFO_GETIIDPRIMARY){
*piidPrimary = *This->clsid; *piidPrimary = *This->clsid;
} }
if (dwFlags & MULTICLASSINFO_GETIIDSOURCE){ if (dwFlags & MULTICLASSINFO_GETIIDSOURCE){
...@@ -519,9 +519,9 @@ static const IProvideMultipleClassInfoVtbl AutomationObject_IProvideMultipleClas ...@@ -519,9 +519,9 @@ static const IProvideMultipleClassInfoVtbl AutomationObject_IProvideMultipleClas
This function is only for VARIANT type parameters that have several types that cannot be properly discriminated This function is only for VARIANT type parameters that have several types that cannot be properly discriminated
using DispGetParam/VariantChangeType. */ using DispGetParam/VariantChangeType. */
HRESULT WINAPI DispGetParam_CopyOnly( HRESULT WINAPI DispGetParam_CopyOnly(
DISPPARAMS *pdispparams, /* [in] Parameter list */ DISPPARAMS *pdispparams, /* [in] Parameter list */
UINT *position, /* [in] Position of parameter to copy in pdispparams; on return will contain calculated position */ UINT *position, /* [in] Position of parameter to copy in pdispparams; on return will contain calculated position */
VARIANT *pvarResult) /* [out] Destination for resulting variant */ VARIANT *pvarResult) /* [out] Destination for resulting variant */
{ {
/* position is counted backwards */ /* position is counted backwards */
UINT pos; UINT pos;
...@@ -566,15 +566,15 @@ static HRESULT WINAPI RecordImpl_Invoke( ...@@ -566,15 +566,15 @@ static HRESULT WINAPI RecordImpl_Invoke(
switch (dispIdMember) switch (dispIdMember)
{ {
case DISPID_RECORD_FIELDCOUNT: case DISPID_RECORD_FIELDCOUNT:
if (wFlags & DISPATCH_PROPERTYGET) { if (wFlags & DISPATCH_PROPERTYGET) {
V_VT(pVarResult) = VT_I4; V_VT(pVarResult) = VT_I4;
V_I4(pVarResult) = MsiRecordGetFieldCount(This->msiHandle); V_I4(pVarResult) = MsiRecordGetFieldCount(This->msiHandle);
} }
else return DISP_E_MEMBERNOTFOUND; else return DISP_E_MEMBERNOTFOUND;
break; break;
case DISPID_RECORD_STRINGDATA: case DISPID_RECORD_STRINGDATA:
if (wFlags & DISPATCH_PROPERTYGET) { if (wFlags & DISPATCH_PROPERTYGET) {
hr = DispGetParam(pDispParams, 0, VT_I4, &varg0, puArgErr); hr = DispGetParam(pDispParams, 0, VT_I4, &varg0, puArgErr);
if (FAILED(hr)) return hr; if (FAILED(hr)) return hr;
...@@ -590,28 +590,28 @@ static HRESULT WINAPI RecordImpl_Invoke( ...@@ -590,28 +590,28 @@ static HRESULT WINAPI RecordImpl_Invoke(
} }
if (ret != ERROR_SUCCESS) if (ret != ERROR_SUCCESS)
ERR("MsiRecordGetString returned %d\n", ret); ERR("MsiRecordGetString returned %d\n", ret);
} else if (wFlags & DISPATCH_PROPERTYPUT) { } else if (wFlags & DISPATCH_PROPERTYPUT) {
hr = DispGetParam(pDispParams, 0, VT_I4, &varg0, puArgErr); hr = DispGetParam(pDispParams, 0, VT_I4, &varg0, puArgErr);
if (FAILED(hr)) return hr; if (FAILED(hr)) return hr;
hr = DispGetParam(pDispParams, DISPID_PROPERTYPUT, VT_BSTR, &varg1, puArgErr); hr = DispGetParam(pDispParams, DISPID_PROPERTYPUT, VT_BSTR, &varg1, puArgErr);
if (FAILED(hr)) return hr; if (FAILED(hr)) return hr;
if ((ret = MsiRecordSetStringW(This->msiHandle, V_I4(&varg0), V_BSTR(&varg1))) != ERROR_SUCCESS) if ((ret = MsiRecordSetStringW(This->msiHandle, V_I4(&varg0), V_BSTR(&varg1))) != ERROR_SUCCESS)
{ {
VariantClear(&varg1); VariantClear(&varg1);
ERR("MsiRecordSetString returned %d\n", ret); ERR("MsiRecordSetString returned %d\n", ret);
return DISP_E_EXCEPTION; return DISP_E_EXCEPTION;
} }
} }
else return DISP_E_MEMBERNOTFOUND; else return DISP_E_MEMBERNOTFOUND;
break; break;
case DISPID_RECORD_INTEGERDATA: case DISPID_RECORD_INTEGERDATA:
if (wFlags & DISPATCH_PROPERTYGET) { if (wFlags & DISPATCH_PROPERTYGET) {
hr = DispGetParam(pDispParams, 0, VT_I4, &varg0, puArgErr); hr = DispGetParam(pDispParams, 0, VT_I4, &varg0, puArgErr);
if (FAILED(hr)) return hr; if (FAILED(hr)) return hr;
V_VT(pVarResult) = VT_I4; V_VT(pVarResult) = VT_I4;
V_I4(pVarResult) = MsiRecordGetInteger(This->msiHandle, V_I4(&varg0)); V_I4(pVarResult) = MsiRecordGetInteger(This->msiHandle, V_I4(&varg0));
} else if (wFlags & DISPATCH_PROPERTYPUT) { } else if (wFlags & DISPATCH_PROPERTYPUT) {
hr = DispGetParam(pDispParams, 0, VT_I4, &varg0, puArgErr); hr = DispGetParam(pDispParams, 0, VT_I4, &varg0, puArgErr);
if (FAILED(hr)) return hr; if (FAILED(hr)) return hr;
hr = DispGetParam(pDispParams, DISPID_PROPERTYPUT, VT_I4, &varg1, puArgErr); hr = DispGetParam(pDispParams, DISPID_PROPERTYPUT, VT_I4, &varg1, puArgErr);
...@@ -621,9 +621,9 @@ static HRESULT WINAPI RecordImpl_Invoke( ...@@ -621,9 +621,9 @@ static HRESULT WINAPI RecordImpl_Invoke(
ERR("MsiRecordSetInteger returned %d\n", ret); ERR("MsiRecordSetInteger returned %d\n", ret);
return DISP_E_EXCEPTION; return DISP_E_EXCEPTION;
} }
} }
else return DISP_E_MEMBERNOTFOUND; else return DISP_E_MEMBERNOTFOUND;
break; break;
default: default:
return DISP_E_MEMBERNOTFOUND; return DISP_E_MEMBERNOTFOUND;
...@@ -655,7 +655,7 @@ static HRESULT WINAPI StringListImpl_Invoke( ...@@ -655,7 +655,7 @@ static HRESULT WINAPI StringListImpl_Invoke(
switch (dispIdMember) switch (dispIdMember)
{ {
case DISPID_STRINGLIST_ITEM: case DISPID_STRINGLIST_ITEM:
if (wFlags & DISPATCH_PROPERTYGET) { if (wFlags & DISPATCH_PROPERTYGET) {
hr = DispGetParam(pDispParams, 0, VT_I4, &varg0, puArgErr); hr = DispGetParam(pDispParams, 0, VT_I4, &varg0, puArgErr);
if (FAILED(hr)) return hr; if (FAILED(hr)) return hr;
if (V_I4(&varg0) < 0 || V_I4(&varg0) >= data->iCount) if (V_I4(&varg0) < 0 || V_I4(&varg0) >= data->iCount)
...@@ -667,10 +667,10 @@ static HRESULT WINAPI StringListImpl_Invoke( ...@@ -667,10 +667,10 @@ static HRESULT WINAPI StringListImpl_Invoke(
break; break;
case DISPID_STRINGLIST_COUNT: case DISPID_STRINGLIST_COUNT:
if (wFlags & DISPATCH_PROPERTYGET) { if (wFlags & DISPATCH_PROPERTYGET) {
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; else return DISP_E_MEMBERNOTFOUND;
break; break;
...@@ -715,21 +715,21 @@ static HRESULT WINAPI ViewImpl_Invoke( ...@@ -715,21 +715,21 @@ static HRESULT WINAPI ViewImpl_Invoke(
switch (dispIdMember) switch (dispIdMember)
{ {
case DISPID_VIEW_EXECUTE: case DISPID_VIEW_EXECUTE:
if (wFlags & DISPATCH_METHOD) if (wFlags & DISPATCH_METHOD)
{ {
hr = DispGetParam(pDispParams, 0, VT_DISPATCH, &varg0, puArgErr); hr = DispGetParam(pDispParams, 0, VT_DISPATCH, &varg0, puArgErr);
if (SUCCEEDED(hr) && V_DISPATCH(&varg0) != NULL) if (SUCCEEDED(hr) && V_DISPATCH(&varg0) != NULL)
MsiViewExecute(This->msiHandle, ((AutomationObject *)V_DISPATCH(&varg0))->msiHandle); MsiViewExecute(This->msiHandle, ((AutomationObject *)V_DISPATCH(&varg0))->msiHandle);
else else
MsiViewExecute(This->msiHandle, 0); MsiViewExecute(This->msiHandle, 0);
} }
else return DISP_E_MEMBERNOTFOUND; else return DISP_E_MEMBERNOTFOUND;
break; break;
case DISPID_VIEW_FETCH: case DISPID_VIEW_FETCH:
if (wFlags & DISPATCH_METHOD) if (wFlags & DISPATCH_METHOD)
{ {
V_VT(pVarResult) = VT_DISPATCH; V_VT(pVarResult) = VT_DISPATCH;
if ((ret = MsiViewFetch(This->msiHandle, &msiHandle)) == ERROR_SUCCESS) if ((ret = MsiViewFetch(This->msiHandle, &msiHandle)) == ERROR_SUCCESS)
{ {
...@@ -741,20 +741,20 @@ static HRESULT WINAPI ViewImpl_Invoke( ...@@ -741,20 +741,20 @@ static HRESULT WINAPI ViewImpl_Invoke(
else else
ERR("Failed to create Record object, hresult 0x%08x\n", hr); ERR("Failed to create Record object, hresult 0x%08x\n", hr);
} }
else if (ret == ERROR_NO_MORE_ITEMS) else if (ret == ERROR_NO_MORE_ITEMS)
V_DISPATCH(pVarResult) = NULL; V_DISPATCH(pVarResult) = NULL;
else else
{ {
ERR("MsiViewFetch returned %d\n", ret); ERR("MsiViewFetch returned %d\n", ret);
return DISP_E_EXCEPTION; return DISP_E_EXCEPTION;
} }
} }
else return DISP_E_MEMBERNOTFOUND; else return DISP_E_MEMBERNOTFOUND;
break; break;
case DISPID_VIEW_MODIFY: case DISPID_VIEW_MODIFY:
if (wFlags & DISPATCH_METHOD) if (wFlags & DISPATCH_METHOD)
{ {
hr = DispGetParam(pDispParams, 0, VT_I4, &varg0, puArgErr); hr = DispGetParam(pDispParams, 0, VT_I4, &varg0, puArgErr);
if (FAILED(hr)) return hr; if (FAILED(hr)) return hr;
hr = DispGetParam(pDispParams, 1, VT_DISPATCH, &varg1, puArgErr); hr = DispGetParam(pDispParams, 1, VT_DISPATCH, &varg1, puArgErr);
...@@ -766,17 +766,17 @@ static HRESULT WINAPI ViewImpl_Invoke( ...@@ -766,17 +766,17 @@ static HRESULT WINAPI ViewImpl_Invoke(
ERR("MsiViewModify returned %d\n", ret); ERR("MsiViewModify returned %d\n", ret);
return DISP_E_EXCEPTION; return DISP_E_EXCEPTION;
} }
} }
else return DISP_E_MEMBERNOTFOUND; else return DISP_E_MEMBERNOTFOUND;
break; break;
case DISPID_VIEW_CLOSE: case DISPID_VIEW_CLOSE:
if (wFlags & DISPATCH_METHOD) if (wFlags & DISPATCH_METHOD)
{ {
MsiViewClose(This->msiHandle); MsiViewClose(This->msiHandle);
} }
else return DISP_E_MEMBERNOTFOUND; else return DISP_E_MEMBERNOTFOUND;
break; break;
default: default:
return DISP_E_MEMBERNOTFOUND; return DISP_E_MEMBERNOTFOUND;
...@@ -810,9 +810,9 @@ static HRESULT WINAPI DatabaseImpl_Invoke( ...@@ -810,9 +810,9 @@ static HRESULT WINAPI DatabaseImpl_Invoke(
switch (dispIdMember) switch (dispIdMember)
{ {
case DISPID_DATABASE_OPENVIEW: case DISPID_DATABASE_OPENVIEW:
if (wFlags & DISPATCH_METHOD) if (wFlags & DISPATCH_METHOD)
{ {
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;
V_VT(pVarResult) = VT_DISPATCH; V_VT(pVarResult) = VT_DISPATCH;
...@@ -826,15 +826,15 @@ static HRESULT WINAPI DatabaseImpl_Invoke( ...@@ -826,15 +826,15 @@ static HRESULT WINAPI DatabaseImpl_Invoke(
else else
ERR("Failed to create View object, hresult 0x%08x\n", hr); ERR("Failed to create View object, hresult 0x%08x\n", hr);
} }
else else
{ {
VariantClear(&varg0); VariantClear(&varg0);
ERR("MsiDatabaseOpenView returned %d\n", ret); ERR("MsiDatabaseOpenView returned %d\n", ret);
return DISP_E_EXCEPTION; return DISP_E_EXCEPTION;
} }
} }
else return DISP_E_MEMBERNOTFOUND; else return DISP_E_MEMBERNOTFOUND;
break; break;
default: default:
return DISP_E_MEMBERNOTFOUND; return DISP_E_MEMBERNOTFOUND;
...@@ -873,16 +873,16 @@ static HRESULT WINAPI SessionImpl_Invoke( ...@@ -873,16 +873,16 @@ static HRESULT WINAPI SessionImpl_Invoke(
switch (dispIdMember) switch (dispIdMember)
{ {
case DISPID_SESSION_INSTALLER: case DISPID_SESSION_INSTALLER:
if (wFlags & DISPATCH_PROPERTYGET) { if (wFlags & DISPATCH_PROPERTYGET) {
V_VT(pVarResult) = VT_DISPATCH; V_VT(pVarResult) = VT_DISPATCH;
IDispatch_AddRef(data->pInstaller); IDispatch_AddRef(data->pInstaller);
V_DISPATCH(pVarResult) = data->pInstaller; V_DISPATCH(pVarResult) = data->pInstaller;
} }
else return DISP_E_MEMBERNOTFOUND; else return DISP_E_MEMBERNOTFOUND;
break; break;
case DISPID_SESSION_PROPERTY: case DISPID_SESSION_PROPERTY:
if (wFlags & DISPATCH_PROPERTYGET) { if (wFlags & DISPATCH_PROPERTYGET) {
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;
...@@ -898,7 +898,7 @@ static HRESULT WINAPI SessionImpl_Invoke( ...@@ -898,7 +898,7 @@ static HRESULT WINAPI SessionImpl_Invoke(
} }
if (ret != ERROR_SUCCESS) if (ret != ERROR_SUCCESS)
ERR("MsiGetProperty returned %d\n", ret); ERR("MsiGetProperty returned %d\n", ret);
} else if (wFlags & DISPATCH_PROPERTYPUT) { } else if (wFlags & DISPATCH_PROPERTYPUT) {
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, DISPID_PROPERTYPUT, VT_BSTR, &varg1, puArgErr); hr = DispGetParam(pDispParams, DISPID_PROPERTYPUT, VT_BSTR, &varg1, puArgErr);
...@@ -906,50 +906,50 @@ static HRESULT WINAPI SessionImpl_Invoke( ...@@ -906,50 +906,50 @@ static HRESULT WINAPI SessionImpl_Invoke(
VariantClear(&varg0); VariantClear(&varg0);
return hr; return hr;
} }
if ((ret = MsiSetPropertyW(This->msiHandle, V_BSTR(&varg0), V_BSTR(&varg1))) != ERROR_SUCCESS) if ((ret = MsiSetPropertyW(This->msiHandle, V_BSTR(&varg0), V_BSTR(&varg1))) != ERROR_SUCCESS)
{ {
VariantClear(&varg0); VariantClear(&varg0);
VariantClear(&varg1); VariantClear(&varg1);
ERR("MsiSetProperty returned %d\n", ret); ERR("MsiSetProperty returned %d\n", ret);
return DISP_E_EXCEPTION; return DISP_E_EXCEPTION;
} }
} }
else return DISP_E_MEMBERNOTFOUND; else return DISP_E_MEMBERNOTFOUND;
break; break;
case DISPID_SESSION_LANGUAGE: case DISPID_SESSION_LANGUAGE:
if (wFlags & DISPATCH_PROPERTYGET) { if (wFlags & DISPATCH_PROPERTYGET) {
langId = MsiGetLanguage(This->msiHandle); langId = MsiGetLanguage(This->msiHandle);
V_VT(pVarResult) = VT_I4; V_VT(pVarResult) = VT_I4;
V_I4(pVarResult) = langId; V_I4(pVarResult) = langId;
} }
else return DISP_E_MEMBERNOTFOUND; else return DISP_E_MEMBERNOTFOUND;
break; break;
case DISPID_SESSION_MODE: case DISPID_SESSION_MODE:
if (wFlags & DISPATCH_PROPERTYGET) { if (wFlags & DISPATCH_PROPERTYGET) {
hr = DispGetParam(pDispParams, 0, VT_I4, &varg0, puArgErr); hr = DispGetParam(pDispParams, 0, VT_I4, &varg0, puArgErr);
if (FAILED(hr)) return hr; if (FAILED(hr)) return hr;
V_VT(pVarResult) = VT_BOOL; V_VT(pVarResult) = VT_BOOL;
V_BOOL(pVarResult) = MsiGetMode(This->msiHandle, V_I4(&varg0)); V_BOOL(pVarResult) = MsiGetMode(This->msiHandle, V_I4(&varg0));
} else if (wFlags & DISPATCH_PROPERTYPUT) { } else if (wFlags & DISPATCH_PROPERTYPUT) {
hr = DispGetParam(pDispParams, 0, VT_I4, &varg0, puArgErr); hr = DispGetParam(pDispParams, 0, VT_I4, &varg0, puArgErr);
if (FAILED(hr)) return hr; if (FAILED(hr)) return hr;
hr = DispGetParam(pDispParams, DISPID_PROPERTYPUT, VT_BOOL, &varg1, puArgErr); hr = DispGetParam(pDispParams, DISPID_PROPERTYPUT, VT_BOOL, &varg1, puArgErr);
if (FAILED(hr)) return hr; if (FAILED(hr)) return hr;
if ((ret = MsiSetMode(This->msiHandle, V_I4(&varg0), V_BOOL(&varg1))) != ERROR_SUCCESS) if ((ret = MsiSetMode(This->msiHandle, V_I4(&varg0), V_BOOL(&varg1))) != ERROR_SUCCESS)
{ {
ERR("MsiSetMode returned %d\n", ret); ERR("MsiSetMode returned %d\n", ret);
return DISP_E_EXCEPTION; return DISP_E_EXCEPTION;
} }
} }
else return DISP_E_MEMBERNOTFOUND; else return DISP_E_MEMBERNOTFOUND;
break; break;
case DISPID_SESSION_DATABASE: case DISPID_SESSION_DATABASE:
if (wFlags & DISPATCH_PROPERTYGET) { if (wFlags & DISPATCH_PROPERTYGET) {
V_VT(pVarResult) = VT_DISPATCH; V_VT(pVarResult) = VT_DISPATCH;
if ((msiHandle = MsiGetActiveDatabase(This->msiHandle))) if ((msiHandle = MsiGetActiveDatabase(This->msiHandle)))
{ {
if (SUCCEEDED(hr = create_automation_object(msiHandle, NULL, (LPVOID*)&pDispatch, &DIID_Database, DatabaseImpl_Invoke, NULL, 0))) if (SUCCEEDED(hr = create_automation_object(msiHandle, NULL, (LPVOID*)&pDispatch, &DIID_Database, DatabaseImpl_Invoke, NULL, 0)))
{ {
...@@ -959,14 +959,14 @@ static HRESULT WINAPI SessionImpl_Invoke( ...@@ -959,14 +959,14 @@ static HRESULT WINAPI SessionImpl_Invoke(
else else
ERR("Failed to create Database object, hresult 0x%08x\n", hr); ERR("Failed to create Database object, hresult 0x%08x\n", hr);
} }
else else
{ {
ERR("MsiGetActiveDatabase failed\n"); ERR("MsiGetActiveDatabase failed\n");
return DISP_E_EXCEPTION; return DISP_E_EXCEPTION;
} }
} }
else return DISP_E_MEMBERNOTFOUND; else return DISP_E_MEMBERNOTFOUND;
break; break;
case DISPID_SESSION_DOACTION: case DISPID_SESSION_DOACTION:
if (wFlags & DISPATCH_METHOD) { if (wFlags & DISPATCH_METHOD) {
...@@ -1032,35 +1032,35 @@ static HRESULT WINAPI SessionImpl_Invoke( ...@@ -1032,35 +1032,35 @@ static HRESULT WINAPI SessionImpl_Invoke(
else return DISP_E_MEMBERNOTFOUND; else return DISP_E_MEMBERNOTFOUND;
break; break;
case DISPID_SESSION_FEATURECURRENTSTATE: case DISPID_SESSION_FEATURECURRENTSTATE:
if (wFlags & DISPATCH_PROPERTYGET) { if (wFlags & DISPATCH_PROPERTYGET) {
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;
V_VT(pVarResult) = VT_I4; V_VT(pVarResult) = VT_I4;
if ((ret = MsiGetFeatureStateW(This->msiHandle, V_BSTR(&varg0), &iInstalled, &iAction)) == ERROR_SUCCESS) if ((ret = MsiGetFeatureStateW(This->msiHandle, V_BSTR(&varg0), &iInstalled, &iAction)) == ERROR_SUCCESS)
V_I4(pVarResult) = iInstalled; V_I4(pVarResult) = iInstalled;
else else
{ {
ERR("MsiGetFeatureState returned %d\n", ret); ERR("MsiGetFeatureState returned %d\n", ret);
V_I4(pVarResult) = msiInstallStateUnknown; V_I4(pVarResult) = msiInstallStateUnknown;
} }
} }
else return DISP_E_MEMBERNOTFOUND; else return DISP_E_MEMBERNOTFOUND;
break; break;
case DISPID_SESSION_FEATUREREQUESTSTATE: case DISPID_SESSION_FEATUREREQUESTSTATE:
if (wFlags & DISPATCH_PROPERTYGET) { if (wFlags & DISPATCH_PROPERTYGET) {
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;
V_VT(pVarResult) = VT_I4; V_VT(pVarResult) = VT_I4;
if ((ret = MsiGetFeatureStateW(This->msiHandle, V_BSTR(&varg0), &iInstalled, &iAction)) == ERROR_SUCCESS) if ((ret = MsiGetFeatureStateW(This->msiHandle, V_BSTR(&varg0), &iInstalled, &iAction)) == ERROR_SUCCESS)
V_I4(pVarResult) = iAction; V_I4(pVarResult) = iAction;
else else
{ {
ERR("MsiGetFeatureState returned %d\n", ret); ERR("MsiGetFeatureState returned %d\n", ret);
V_I4(pVarResult) = msiInstallStateUnknown; V_I4(pVarResult) = msiInstallStateUnknown;
} }
} else if (wFlags & DISPATCH_PROPERTYPUT) { } else if (wFlags & DISPATCH_PROPERTYPUT) {
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, DISPID_PROPERTYPUT, VT_I4, &varg1, puArgErr); hr = DispGetParam(pDispParams, DISPID_PROPERTYPUT, VT_I4, &varg1, puArgErr);
...@@ -1068,15 +1068,15 @@ static HRESULT WINAPI SessionImpl_Invoke( ...@@ -1068,15 +1068,15 @@ static HRESULT WINAPI SessionImpl_Invoke(
VariantClear(&varg0); VariantClear(&varg0);
return hr; return hr;
} }
if ((ret = MsiSetFeatureStateW(This->msiHandle, V_BSTR(&varg0), V_I4(&varg1))) != ERROR_SUCCESS) if ((ret = MsiSetFeatureStateW(This->msiHandle, V_BSTR(&varg0), V_I4(&varg1))) != ERROR_SUCCESS)
{ {
VariantClear(&varg0); VariantClear(&varg0);
ERR("MsiSetFeatureState returned %d\n", ret); ERR("MsiSetFeatureState returned %d\n", ret);
return DISP_E_EXCEPTION; return DISP_E_EXCEPTION;
} }
} }
else return DISP_E_MEMBERNOTFOUND; else return DISP_E_MEMBERNOTFOUND;
break; break;
default: default:
return DISP_E_MEMBERNOTFOUND; return DISP_E_MEMBERNOTFOUND;
...@@ -1177,8 +1177,8 @@ static HRESULT WINAPI InstallerImpl_Invoke( ...@@ -1177,8 +1177,8 @@ static HRESULT WINAPI InstallerImpl_Invoke(
switch (dispIdMember) switch (dispIdMember)
{ {
case DISPID_INSTALLER_CREATERECORD: case DISPID_INSTALLER_CREATERECORD:
if (wFlags & DISPATCH_METHOD) if (wFlags & DISPATCH_METHOD)
{ {
hr = DispGetParam(pDispParams, 0, VT_I4, &varg0, puArgErr); hr = DispGetParam(pDispParams, 0, VT_I4, &varg0, puArgErr);
if (FAILED(hr)) return hr; if (FAILED(hr)) return hr;
V_VT(pVarResult) = VT_DISPATCH; V_VT(pVarResult) = VT_DISPATCH;
...@@ -1201,9 +1201,9 @@ static HRESULT WINAPI InstallerImpl_Invoke( ...@@ -1201,9 +1201,9 @@ static HRESULT WINAPI InstallerImpl_Invoke(
else return DISP_E_MEMBERNOTFOUND; else return DISP_E_MEMBERNOTFOUND;
break; break;
case DISPID_INSTALLER_OPENPACKAGE: case DISPID_INSTALLER_OPENPACKAGE:
if (wFlags & DISPATCH_METHOD) if (wFlags & DISPATCH_METHOD)
{ {
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);
...@@ -1213,7 +1213,7 @@ static HRESULT WINAPI InstallerImpl_Invoke( ...@@ -1213,7 +1213,7 @@ static HRESULT WINAPI InstallerImpl_Invoke(
return hr; return hr;
} }
V_VT(pVarResult) = VT_DISPATCH; V_VT(pVarResult) = VT_DISPATCH;
if ((ret = MsiOpenPackageExW(V_BSTR(&varg0), V_I4(&varg1), &msiHandle)) == ERROR_SUCCESS) if ((ret = MsiOpenPackageExW(V_BSTR(&varg0), V_I4(&varg1), &msiHandle)) == ERROR_SUCCESS)
{ {
if (SUCCEEDED(hr = create_session(msiHandle, (IDispatch *)This, &pDispatch))) if (SUCCEEDED(hr = create_session(msiHandle, (IDispatch *)This, &pDispatch)))
{ {
...@@ -1223,19 +1223,19 @@ static HRESULT WINAPI InstallerImpl_Invoke( ...@@ -1223,19 +1223,19 @@ static HRESULT WINAPI InstallerImpl_Invoke(
else else
ERR("Failed to create Session object, hresult 0x%08x\n", hr); ERR("Failed to create Session object, hresult 0x%08x\n", hr);
} }
else else
{ {
VariantClear(&varg0); VariantClear(&varg0);
ERR("MsiOpenPackageEx returned %d\n", ret); ERR("MsiOpenPackageEx returned %d\n", ret);
return DISP_E_EXCEPTION; return DISP_E_EXCEPTION;
} }
} }
else return DISP_E_MEMBERNOTFOUND; else return DISP_E_MEMBERNOTFOUND;
break; break;
case DISPID_INSTALLER_INSTALLPRODUCT: case DISPID_INSTALLER_INSTALLPRODUCT:
if (wFlags & DISPATCH_METHOD) if (wFlags & DISPATCH_METHOD)
{ {
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_BSTR, &varg1, puArgErr); hr = DispGetParam(pDispParams, 1, VT_BSTR, &varg1, puArgErr);
...@@ -1244,16 +1244,16 @@ static HRESULT WINAPI InstallerImpl_Invoke( ...@@ -1244,16 +1244,16 @@ static HRESULT WINAPI InstallerImpl_Invoke(
VariantClear(&varg0); VariantClear(&varg0);
return hr; return hr;
} }
if ((ret = MsiInstallProductW(V_BSTR(&varg0), V_BSTR(&varg1))) != ERROR_SUCCESS) if ((ret = MsiInstallProductW(V_BSTR(&varg0), V_BSTR(&varg1))) != ERROR_SUCCESS)
{ {
VariantClear(&varg1); VariantClear(&varg1);
VariantClear(&varg0); VariantClear(&varg0);
ERR("MsiInstallProduct returned %d\n", ret); ERR("MsiInstallProduct returned %d\n", ret);
return DISP_E_EXCEPTION; return DISP_E_EXCEPTION;
} }
} }
else return DISP_E_MEMBERNOTFOUND; else return DISP_E_MEMBERNOTFOUND;
break; break;
case DISPID_INSTALLER_REGISTRYVALUE: case DISPID_INSTALLER_REGISTRYVALUE:
if (wFlags & DISPATCH_METHOD) { if (wFlags & DISPATCH_METHOD) {
......
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