ReactOS  0.4.14-dev-376-gaedba84
automation.c File Reference
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "winerror.h"
#include "winuser.h"
#include "winreg.h"
#include "msidefs.h"
#include "msipriv.h"
#include "activscp.h"
#include "oleauto.h"
#include "shlwapi.h"
#include "wine/debug.h"
#include "wine/unicode.h"
#include "msiserver.h"
#include "msiserver_dispids.h"
Include dependency graph for automation.c:

Go to the source code of this file.

Classes

struct  tid_id_t
 
struct  AutomationObject
 
struct  ListObject
 
struct  ListEnumerator
 
struct  SessionObject
 

Macros

#define COBJMACROS
 
#define REG_INDEX_CLASSES_ROOT   0
 
#define REG_INDEX_DYN_DATA   6
 
#define MAX_FUNC_PARAMS   20
 

Typedefs

typedef struct AutomationObject AutomationObject
 
typedef HRESULT(* auto_invoke_func) (AutomationObject *This, DISPID dispIdMember, REFIID riid, LCID lcid, WORD flags, DISPPARAMS *pDispParams, VARIANT *result, EXCEPINFO *ei, UINT *arg_err)
 
typedef void(* auto_free_func) (AutomationObject *This)
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (msi)
 
static HRESULT database_invoke (AutomationObject *, DISPID, REFIID, LCID, WORD, DISPPARAMS *, VARIANT *, EXCEPINFO *, UINT *)
 
static HRESULT installer_invoke (AutomationObject *, DISPID, REFIID, LCID, WORD, DISPPARAMS *, VARIANT *, EXCEPINFO *, UINT *)
 
static HRESULT record_invoke (AutomationObject *, DISPID, REFIID, LCID, WORD, DISPPARAMS *, VARIANT *, EXCEPINFO *, UINT *)
 
static HRESULT session_invoke (AutomationObject *, DISPID, REFIID, LCID, WORD, DISPPARAMS *, VARIANT *, EXCEPINFO *, UINT *)
 
static HRESULT list_invoke (AutomationObject *, DISPID, REFIID, LCID, WORD, DISPPARAMS *, VARIANT *, EXCEPINFO *, UINT *)
 
static void list_free (AutomationObject *)
 
static HRESULT summaryinfo_invoke (AutomationObject *, DISPID, REFIID, LCID, WORD, DISPPARAMS *, VARIANT *, EXCEPINFO *, UINT *)
 
static HRESULT view_invoke (AutomationObject *, DISPID, REFIID, LCID, WORD, DISPPARAMS *, VARIANT *, EXCEPINFO *, UINT *)
 
static const IIDget_riid_from_tid (tid_t tid)
 
HRESULT get_typeinfo (tid_t tid, ITypeInfo **typeinfo)
 
void release_typelib (void)
 
static HRESULT create_database (MSIHANDLE, IDispatch **)
 
static HRESULT create_list_enumerator (ListObject *, void **)
 
static HRESULT create_summaryinfo (MSIHANDLE, IDispatch **)
 
static HRESULT create_view (MSIHANDLE, IDispatch **)
 
static AutomationObjectimpl_from_IProvideMultipleClassInfo (IProvideMultipleClassInfo *iface)
 
static AutomationObjectimpl_from_IDispatch (IDispatch *iface)
 
static HRESULT WINAPI AutomationObject_QueryInterface (IDispatch *iface, REFIID riid, void **ppvObject)
 
static ULONG WINAPI AutomationObject_AddRef (IDispatch *iface)
 
static ULONG WINAPI AutomationObject_Release (IDispatch *iface)
 
static HRESULT WINAPI AutomationObject_GetTypeInfoCount (IDispatch *iface, UINT *pctinfo)
 
static HRESULT WINAPI AutomationObject_GetTypeInfo (IDispatch *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
 
static HRESULT WINAPI AutomationObject_GetIDsOfNames (IDispatch *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
 
static HRESULT WINAPI AutomationObject_Invoke (IDispatch *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
 
static HRESULT WINAPI ProvideMultipleClassInfo_QueryInterface (IProvideMultipleClassInfo *iface, REFIID riid, VOID **ppvoid)
 
static ULONG WINAPI ProvideMultipleClassInfo_AddRef (IProvideMultipleClassInfo *iface)
 
static ULONG WINAPI ProvideMultipleClassInfo_Release (IProvideMultipleClassInfo *iface)
 
static HRESULT WINAPI ProvideMultipleClassInfo_GetClassInfo (IProvideMultipleClassInfo *iface, ITypeInfo **ppTI)
 
static HRESULT WINAPI ProvideMultipleClassInfo_GetGUID (IProvideMultipleClassInfo *iface, DWORD dwGuidKind, GUID *pGUID)
 
static HRESULT WINAPI ProvideMultipleClassInfo_GetMultiTypeInfoCount (IProvideMultipleClassInfo *iface, ULONG *pcti)
 
static HRESULT WINAPI ProvideMultipleClassInfo_GetInfoOfIndex (IProvideMultipleClassInfo *iface, ULONG iti, DWORD dwFlags, ITypeInfo **ti, DWORD *pdwTIFlags, ULONG *pcdispidReserved, IID *piidPrimary, IID *piidSource)
 
static HRESULT init_automation_object (AutomationObject *This, MSIHANDLE msiHandle, tid_t tid)
 
static ListEnumeratorimpl_from_IEnumVARIANT (IEnumVARIANT *iface)
 
static HRESULT WINAPI ListEnumerator_QueryInterface (IEnumVARIANT *iface, REFIID riid, void **ppvObject)
 
static ULONG WINAPI ListEnumerator_AddRef (IEnumVARIANT *iface)
 
static ULONG WINAPI ListEnumerator_Release (IEnumVARIANT *iface)
 
static HRESULT WINAPI ListEnumerator_Next (IEnumVARIANT *iface, ULONG celt, VARIANT *rgVar, ULONG *fetched)
 
static HRESULT WINAPI ListEnumerator_Skip (IEnumVARIANT *iface, ULONG celt)
 
static HRESULT WINAPI ListEnumerator_Reset (IEnumVARIANT *iface)
 
static HRESULT WINAPI ListEnumerator_Clone (IEnumVARIANT *iface, IEnumVARIANT **ppEnum)
 
static HRESULT DispGetParam_CopyOnly (DISPPARAMS *pdispparams, UINT *position, VARIANT *pvarResult)
 
static HRESULT create_record (MSIHANDLE msiHandle, IDispatch **disp)
 
static HRESULT get_products_count (const WCHAR *product, int *len)
 
static HRESULT create_list (const WCHAR *product, IDispatch **dispatch)
 
static HRESULT DatabaseImpl_LastErrorRecord (WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
 
static void variant_from_registry_value (VARIANT *pVarResult, DWORD dwType, LPBYTE lpData, DWORD dwSize)
 
static HRESULT InstallerImpl_CreateRecord (WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
 
static HRESULT InstallerImpl_OpenPackage (AutomationObject *This, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
 
static HRESULT InstallerImpl_OpenProduct (WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
 
static HRESULT InstallerImpl_OpenDatabase (WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
 
static HRESULT InstallerImpl_SummaryInformation (WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
 
static HRESULT InstallerImpl_UILevel (WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
 
static HRESULT InstallerImpl_EnableLog (WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
 
static HRESULT InstallerImpl_InstallProduct (WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
 
static HRESULT InstallerImpl_Version (WORD wFlags, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
 
static HRESULT InstallerImpl_LastErrorRecord (WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
 
static HRESULT InstallerImpl_RegistryValue (WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
 
static HRESULT InstallerImpl_Environment (WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
 
static HRESULT InstallerImpl_FileAttributes (WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
 
static HRESULT InstallerImpl_FileSize (WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
 
static HRESULT InstallerImpl_FileVersion (WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
 
static HRESULT InstallerImpl_ProductState (WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
 
static HRESULT InstallerImpl_ProductInfo (WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
 
static HRESULT InstallerImpl_Products (WORD flags, DISPPARAMS *pDispParams, VARIANT *result, EXCEPINFO *pExcepInfo, UINT *puArgErr)
 
static HRESULT InstallerImpl_RelatedProducts (WORD flags, DISPPARAMS *pDispParams, VARIANT *result, EXCEPINFO *pExcepInfo, UINT *puArgErr)
 
HRESULT create_msiserver (IUnknown *outer, void **ppObj)
 
HRESULT create_session (MSIHANDLE msiHandle, IDispatch *installer, IDispatch **disp)
 

Variables

static tid_id_t tid_ids []
 
static ITypeLibtypelib
 
static ITypeInfotypeinfos [LAST_tid]
 
static const struct IDispatchVtbl AutomationObjectVtbl
 
static const IProvideMultipleClassInfoVtbl ProvideMultipleClassInfoVtbl
 
static const struct IEnumVARIANTVtbl ListEnumerator_Vtbl
 

Macro Definition Documentation

◆ COBJMACROS

#define COBJMACROS

Definition at line 21 of file automation.c.

◆ MAX_FUNC_PARAMS

#define MAX_FUNC_PARAMS   20

Definition at line 315 of file automation.c.

◆ REG_INDEX_CLASSES_ROOT

#define REG_INDEX_CLASSES_ROOT   0

Definition at line 42 of file automation.c.

◆ REG_INDEX_DYN_DATA

#define REG_INDEX_DYN_DATA   6

Definition at line 43 of file automation.c.

Typedef Documentation

◆ auto_free_func

typedef void(* auto_free_func) (AutomationObject *This)

Definition at line 53 of file automation.c.

◆ auto_invoke_func

typedef HRESULT(* auto_invoke_func) (AutomationObject *This, DISPID dispIdMember, REFIID riid, LCID lcid, WORD flags, DISPPARAMS *pDispParams, VARIANT *result, EXCEPINFO *ei, UINT *arg_err)

Definition at line 48 of file automation.c.

◆ AutomationObject

Definition at line 45 of file automation.c.

Function Documentation

◆ AutomationObject_AddRef()

static ULONG WINAPI AutomationObject_AddRef ( IDispatch iface)
static

Definition at line 224 of file automation.c.

225 {
227 
228  TRACE("(%p/%p)\n", iface, This);
229 
230  return InterlockedIncrement(&This->ref);
231 }
#define TRACE(s)
Definition: solgame.cpp:4
#define InterlockedIncrement
Definition: armddk.h:53
static AutomationObject * impl_from_IDispatch(IDispatch *iface)
Definition: automation.c:188

◆ AutomationObject_GetIDsOfNames()

static HRESULT WINAPI AutomationObject_GetIDsOfNames ( IDispatch iface,
REFIID  riid,
LPOLESTR rgszNames,
UINT  cNames,
LCID  lcid,
DISPID rgDispId 
)
static

Definition at line 280 of file automation.c.

287 {
289  ITypeInfo *ti;
290  HRESULT hr;
291 
292  TRACE("(%p/%p)->(%s, %p, %d, %d, %p)\n", iface, This,
293  debugstr_guid(riid), rgszNames, cNames, lcid, rgDispId);
294 
295  if (!IsEqualGUID(riid, &IID_NULL)) return E_INVALIDARG;
296 
297  hr = get_typeinfo(This->tid, &ti);
298  if (FAILED(hr))
299  return hr;
300 
301  hr = ITypeInfo_GetIDsOfNames(ti, rgszNames, cNames, rgDispId);
302  if (hr == DISP_E_UNKNOWNNAME)
303  {
304  UINT idx;
305  for (idx=0; idx<cNames; idx++)
306  {
307  if (rgDispId[idx] == DISPID_UNKNOWN)
308  FIXME("Unknown member %s, clsid %s\n", debugstr_w(rgszNames[idx]), debugstr_guid(get_riid_from_tid(This->tid)));
309  }
310  }
311  return hr;
312 }
#define DISP_E_UNKNOWNNAME
Definition: winerror.h:2515
HRESULT hr
Definition: shlfolder.c:183
REFIID riid
Definition: precomp.h:44
#define debugstr_w
Definition: kernel32.h:32
#define FIXME(fmt,...)
Definition: debug.h:110
unsigned int idx
Definition: utils.c:41
static const IID * get_riid_from_tid(tid_t tid)
Definition: automation.c:84
#define E_INVALIDARG
Definition: ddrawi.h:101
#define debugstr_guid
Definition: kernel32.h:35
HRESULT get_typeinfo(tid_t tid, ITypeInfo **typeinfo)
Definition: automation.c:89
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
#define IID_NULL
Definition: guiddef.h:98
unsigned int UINT
Definition: ndis.h:50
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112
static AutomationObject * impl_from_IDispatch(IDispatch *iface)
Definition: automation.c:188

◆ AutomationObject_GetTypeInfo()

static HRESULT WINAPI AutomationObject_GetTypeInfo ( IDispatch iface,
UINT  iTInfo,
LCID  lcid,
ITypeInfo **  ppTInfo 
)
static

Definition at line 261 of file automation.c.

266 {
268  HRESULT hr;
269 
270  TRACE("(%p/%p)->(%d,%d,%p)\n", iface, This, iTInfo, lcid, ppTInfo);
271 
272  hr = get_typeinfo(This->tid, ppTInfo);
273  if (FAILED(hr))
274  return hr;
275 
276  ITypeInfo_AddRef(*ppTInfo);
277  return hr;
278 }
HRESULT hr
Definition: shlfolder.c:183
HRESULT get_typeinfo(tid_t tid, ITypeInfo **typeinfo)
Definition: automation.c:89
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
static AutomationObject * impl_from_IDispatch(IDispatch *iface)
Definition: automation.c:188

◆ AutomationObject_GetTypeInfoCount()

static HRESULT WINAPI AutomationObject_GetTypeInfoCount ( IDispatch iface,
UINT pctinfo 
)
static

Definition at line 250 of file automation.c.

253 {
255 
256  TRACE("(%p/%p)->(%p)\n", iface, This, pctinfo);
257  *pctinfo = 1;
258  return S_OK;
259 }
#define TRACE(s)
Definition: solgame.cpp:4
#define S_OK
Definition: intsafe.h:59
static AutomationObject * impl_from_IDispatch(IDispatch *iface)
Definition: automation.c:188

◆ AutomationObject_Invoke()

static HRESULT WINAPI AutomationObject_Invoke ( IDispatch iface,
DISPID  dispIdMember,
REFIID  riid,
LCID  lcid,
WORD  wFlags,
DISPPARAMS *  pDispParams,
VARIANT pVarResult,
EXCEPINFO *  pExcepInfo,
UINT puArgErr 
)
static

Definition at line 318 of file automation.c.

328 {
330  HRESULT hr;
331  unsigned int uArgErr;
332  VARIANT varResultDummy;
333  BSTR bstrName = NULL;
334  ITypeInfo *ti;
335 
336  TRACE("(%p/%p)->(%d, %s, %d, %d, %p, %p, %p, %p)\n", iface, This,
337  dispIdMember, debugstr_guid(riid), lcid, wFlags,
338  pDispParams, pVarResult, pExcepInfo, puArgErr);
339 
340  if (!IsEqualIID(riid, &IID_NULL))
341  {
342  ERR("riid was %s instead of IID_NULL\n", debugstr_guid(riid));
343  return DISP_E_UNKNOWNNAME;
344  }
345 
346  if (wFlags & DISPATCH_PROPERTYGET && !pVarResult)
347  {
348  ERR("NULL pVarResult not allowed when DISPATCH_PROPERTYGET specified\n");
350  }
351 
352  /* This simplifies our individual object invocation functions */
353  if (puArgErr == NULL) puArgErr = &uArgErr;
354  if (pVarResult == NULL) pVarResult = &varResultDummy;
355 
356  hr = get_typeinfo(This->tid, &ti);
357  if (FAILED(hr))
358  return hr;
359 
360  /* Assume return type is void unless determined otherwise */
361  VariantInit(pVarResult);
362 
363  /* If we are tracing, we want to see the name of the member we are invoking */
364  if (TRACE_ON(msi))
365  {
366  ITypeInfo_GetDocumentation(ti, dispIdMember, &bstrName, NULL, NULL, NULL);
367  TRACE("Method %d, %s\n", dispIdMember, debugstr_w(bstrName));
368  }
369 
370  hr = tid_ids[This->tid].fn_invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr);
371 
372  if (hr == DISP_E_MEMBERNOTFOUND) {
373  if (bstrName == NULL) ITypeInfo_GetDocumentation(ti, dispIdMember, &bstrName, NULL, NULL, NULL);
374  FIXME("Method %d, %s wflags %d not implemented, clsid %s\n", dispIdMember, debugstr_w(bstrName), wFlags,
376  }
377  else if (pExcepInfo &&
378  (hr == DISP_E_PARAMNOTFOUND ||
379  hr == DISP_E_EXCEPTION)) {
380  static const WCHAR szComma[] = { ',',0 };
381  static const WCHAR szExceptionSource[] = {'M','s','i',' ','A','P','I',' ','E','r','r','o','r',0};
382  WCHAR szExceptionDescription[MAX_PATH];
383  BSTR bstrParamNames[MAX_FUNC_PARAMS];
384  unsigned namesNo, i;
385  BOOL bFirst = TRUE;
386 
387  if (FAILED(ITypeInfo_GetNames(ti, dispIdMember, bstrParamNames,
388  MAX_FUNC_PARAMS, &namesNo)))
389  {
390  TRACE("Failed to retrieve names for dispIdMember %d\n", dispIdMember);
391  }
392  else
393  {
394  memset(szExceptionDescription, 0, sizeof(szExceptionDescription));
395  for (i=0; i<namesNo; i++)
396  {
397  if (bFirst) bFirst = FALSE;
398  else {
399  lstrcpyW(&szExceptionDescription[lstrlenW(szExceptionDescription)], szComma);
400  }
401  lstrcpyW(&szExceptionDescription[lstrlenW(szExceptionDescription)], bstrParamNames[i]);
402  SysFreeString(bstrParamNames[i]);
403  }
404 
405  memset(pExcepInfo, 0, sizeof(EXCEPINFO));
406  pExcepInfo->wCode = 1000;
407  pExcepInfo->bstrSource = SysAllocString(szExceptionSource);
408  pExcepInfo->bstrDescription = SysAllocString(szExceptionDescription);
410  }
411  }
412 
413  /* Make sure we free the return variant if it is our dummy variant */
414  if (pVarResult == &varResultDummy) VariantClear(pVarResult);
415 
416  /* Free function name if we retrieved it */
417  SysFreeString(bstrName);
418 
419  TRACE("Returning 0x%08x, %s\n", hr, SUCCEEDED(hr) ? "ok" : "not ok");
420 
421  return hr;
422 }
#define DISP_E_EXCEPTION
Definition: winerror.h:2518
#define DISP_E_UNKNOWNNAME
Definition: winerror.h:2515
#define TRUE
Definition: types.h:120
#define DISPATCH_PROPERTYGET
Definition: oleauto.h:1007
HRESULT hr
Definition: shlfolder.c:183
REFIID riid
Definition: precomp.h:44
#define DISP_E_MEMBERNOTFOUND
Definition: winerror.h:2512
static tid_id_t tid_ids[]
Definition: automation.c:71
OLECHAR * BSTR
Definition: compat.h:1942
#define MAX_FUNC_PARAMS
Definition: automation.c:315
void WINAPI VariantInit(VARIANTARG *pVarg)
Definition: variant.c:571
#define lstrlenW
Definition: compat.h:415
#define DISP_E_PARAMNOTFOUND
Definition: winerror.h:2513
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
unsigned int BOOL
Definition: ntddk_ex.h:94
#define debugstr_w
Definition: kernel32.h:32
#define FIXME(fmt,...)
Definition: debug.h:110
static const IID * get_riid_from_tid(tid_t tid)
Definition: automation.c:84
auto_invoke_func fn_invoke
Definition: automation.c:57
smooth NULL
Definition: ftsmooth.c:416
BSTR WINAPI SysAllocString(LPCOLESTR str)
Definition: oleaut.c:241
#define debugstr_guid
Definition: kernel32.h:35
HRESULT get_typeinfo(tid_t tid, ITypeInfo **typeinfo)
Definition: automation.c:89
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
#define MAX_PATH
Definition: compat.h:26
HRESULT WINAPI DECLSPEC_HOTPATCH VariantClear(VARIANTARG *pVarg)
Definition: variant.c:651
#define IID_NULL
Definition: guiddef.h:98
#define DISP_E_PARAMNOTOPTIONAL
Definition: winerror.h:2524
_In_ DWORD _Out_ _In_ WORD wFlags
Definition: wincon.h:519
#define ERR(fmt,...)
Definition: debug.h:109
struct stdole::EXCEPINFO EXCEPINFO
#define lstrcpyW
Definition: compat.h:414
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
Definition: oleaut.c:274
#define memset(x, y, z)
Definition: compat.h:39
static AutomationObject * impl_from_IDispatch(IDispatch *iface)
Definition: automation.c:188
#define TRACE_ON(x)
Definition: compat.h:65
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95
#define SUCCEEDED(hr)
Definition: intsafe.h:57

◆ AutomationObject_QueryInterface()

static HRESULT WINAPI AutomationObject_QueryInterface ( IDispatch iface,
REFIID  riid,
void **  ppvObject 
)
static

Definition at line 194 of file automation.c.

195 {
197 
198  TRACE("(%p/%p)->(%s,%p)\n", iface, This, debugstr_guid(riid), ppvObject);
199 
200  if (ppvObject == NULL)
201  return E_INVALIDARG;
202 
203  *ppvObject = 0;
204 
205  if (IsEqualGUID(riid, &IID_IUnknown) ||
208  *ppvObject = &This->IDispatch_iface;
209  else if (IsEqualGUID(riid, &IID_IProvideClassInfo) ||
211  IsEqualGUID(riid, &IID_IProvideMultipleClassInfo))
212  *ppvObject = &This->IProvideMultipleClassInfo_iface;
213  else
214  {
215  TRACE("() : asking for unsupported interface %s\n", debugstr_guid(riid));
216  return E_NOINTERFACE;
217  }
218 
219  IDispatch_AddRef(iface);
220 
221  return S_OK;
222 }
#define E_NOINTERFACE
Definition: winerror.h:2364
REFIID riid
Definition: precomp.h:44
const GUID IID_IProvideClassInfo
static const IID * get_riid_from_tid(tid_t tid)
Definition: automation.c:84
#define E_INVALIDARG
Definition: ddrawi.h:101
smooth NULL
Definition: ftsmooth.c:416
const GUID IID_IProvideClassInfo2
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
const GUID IID_IUnknown
const GUID IID_IDispatch
REFIID LPVOID * ppvObject
Definition: precomp.h:44
#define S_OK
Definition: intsafe.h:59
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112
static AutomationObject * impl_from_IDispatch(IDispatch *iface)
Definition: automation.c:188

◆ AutomationObject_Release()

static ULONG WINAPI AutomationObject_Release ( IDispatch iface)
static

Definition at line 233 of file automation.c.

234 {
237 
238  TRACE("(%p/%p)\n", iface, This);
239 
240  if (!ref)
241  {
242  if (tid_ids[This->tid].fn_free) tid_ids[This->tid].fn_free(This);
243  MsiCloseHandle(This->msiHandle);
244  msi_free(This);
245  }
246 
247  return ref;
248 }
static tid_id_t tid_ids[]
Definition: automation.c:71
Definition: send.c:47
GLenum GLint ref
Definition: glext.h:6028
#define TRACE(s)
Definition: solgame.cpp:4
#define InterlockedDecrement
Definition: armddk.h:52
UINT WINAPI MsiCloseHandle(MSIHANDLE handle)
Definition: handle.c:270
auto_free_func fn_free
Definition: automation.c:58
static BOOL msi_free(void *mem)
Definition: msipriv.h:1227
unsigned int ULONG
Definition: retypes.h:1
static AutomationObject * impl_from_IDispatch(IDispatch *iface)
Definition: automation.c:188

◆ create_database()

static HRESULT create_database ( MSIHANDLE  msiHandle,
IDispatch **  dispatch 
)
static

Definition at line 2489 of file automation.c.

2490 {
2491  AutomationObject *database;
2492  HRESULT hr;
2493 
2494  TRACE("(%d %p)\n", msiHandle, dispatch);
2495 
2496  database = msi_alloc(sizeof(AutomationObject));
2497  if (!database) return E_OUTOFMEMORY;
2498 
2499  hr = init_automation_object(database, msiHandle, Database_tid);
2500  if (hr != S_OK)
2501  {
2502  msi_free(database);
2503  return hr;
2504  }
2505 
2506  *dispatch = &database->IDispatch_iface;
2507 
2508  return hr;
2509 }
HRESULT hr
Definition: shlfolder.c:183
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
void dispatch(HANDLE hStopEvent)
Definition: dispatch.c:66
static HRESULT init_automation_object(AutomationObject *This, MSIHANDLE msiHandle, tid_t tid)
Definition: automation.c:547
#define S_OK
Definition: intsafe.h:59
IDispatch IDispatch_iface
Definition: automation.c:146
static BOOL msi_free(void *mem)
Definition: msipriv.h:1227
static void * msi_alloc(size_t len) __WINE_ALLOC_SIZE(1)
Definition: msipriv.h:1204

Referenced by InstallerImpl_OpenDatabase(), and session_invoke().

◆ create_list()

static HRESULT create_list ( const WCHAR product,
IDispatch **  dispatch 
)
static

Definition at line 1118 of file automation.c.

1119 {
1120  ListObject *list;
1121  HRESULT hr;
1122  int i;
1123 
1124  list = msi_alloc_zero(sizeof(ListObject));
1125  if (!list) return E_OUTOFMEMORY;
1126 
1127  hr = init_automation_object(&list->autoobj, 0, StringList_tid);
1128  if (hr != S_OK)
1129  {
1130  msi_free(list);
1131  return hr;
1132  }
1133 
1134  *dispatch = &list->autoobj.IDispatch_iface;
1135 
1136  hr = get_products_count(product, &list->count);
1137  if (hr != S_OK)
1138  {
1139  IDispatch_Release(*dispatch);
1140  return hr;
1141  }
1142 
1143  list->data = msi_alloc(list->count*sizeof(VARIANT));
1144  if (!list->data)
1145  {
1146  IDispatch_Release(*dispatch);
1147  return E_OUTOFMEMORY;
1148  }
1149 
1150  for (i = 0; i < list->count; i++)
1151  {
1152  WCHAR dataW[GUID_SIZE];
1153  UINT ret;
1154 
1155  /* all or related only */
1156  if (product)
1157  ret = MsiEnumRelatedProductsW(product, 0, i, dataW);
1158  else
1159  ret = MsiEnumProductsW(i, dataW);
1160 
1161  if (ret == ERROR_NO_MORE_ITEMS) break;
1162 
1163  V_VT(&list->data[i]) = VT_BSTR;
1164  V_BSTR(&list->data[i]) = SysAllocString(dataW);
1165  }
1166 
1167  return S_OK;
1168 }
HRESULT hr
Definition: shlfolder.c:183
UINT WINAPI MsiEnumProductsW(DWORD index, LPWSTR lpguid)
Definition: registry.c:1168
#define ERROR_NO_MORE_ITEMS
Definition: compat.h:95
static HRESULT get_products_count(const WCHAR *product, int *len)
Definition: automation.c:1090
static void * msi_alloc_zero(size_t len) __WINE_ALLOC_SIZE(1)
Definition: msipriv.h:1210
UINT WINAPI MsiEnumRelatedProductsW(LPCWSTR szUpgradeCode, DWORD dwReserved, DWORD iProductIndex, LPWSTR lpProductBuf)
Definition: registry.c:1706
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
BSTR WINAPI SysAllocString(LPCOLESTR str)
Definition: oleaut.c:241
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
int ret
#define V_VT(A)
Definition: oleauto.h:211
Definition: _list.h:228
void dispatch(HANDLE hStopEvent)
Definition: dispatch.c:66
#define V_BSTR(A)
Definition: oleauto.h:226
static HRESULT init_automation_object(AutomationObject *This, MSIHANDLE msiHandle, tid_t tid)
Definition: automation.c:547
#define S_OK
Definition: intsafe.h:59
#define list
Definition: rosglue.h:35
unsigned int UINT
Definition: ndis.h:50
static BOOL msi_free(void *mem)
Definition: msipriv.h:1227
static void * msi_alloc(size_t len) __WINE_ALLOC_SIZE(1)
Definition: msipriv.h:1204
#define GUID_SIZE
Definition: msipriv.h:710

Referenced by InstallerImpl_Products(), and InstallerImpl_RelatedProducts().

◆ create_list_enumerator()

static HRESULT create_list_enumerator ( ListObject list,
void **  ppObj 
)
static

Definition at line 706 of file automation.c.

707 {
709 
710  TRACE("(%p, %p)\n", list, ppObj);
711 
712  object = msi_alloc(sizeof(ListEnumerator));
713 
714  /* Set all the VTable references */
715  object->IEnumVARIANT_iface.lpVtbl = &ListEnumerator_Vtbl;
716  object->ref = 1;
717 
718  /* Store data that was passed */
719  object->pos = 0;
720  object->list = list;
721  if (list) IDispatch_AddRef(&list->autoobj.IDispatch_iface);
722 
723  *ppObj = object;
724  return S_OK;
725 }
#define TRACE(s)
Definition: solgame.cpp:4
Definition: _list.h:228
#define S_OK
Definition: intsafe.h:59
static const struct IEnumVARIANTVtbl ListEnumerator_Vtbl
Definition: automation.c:694
#define list
Definition: rosglue.h:35
static void * msi_alloc(size_t len) __WINE_ALLOC_SIZE(1)
Definition: msipriv.h:1204
void * object
Definition: jmemsys.h:48

Referenced by list_invoke(), and ListEnumerator_Clone().

◆ create_msiserver()

HRESULT create_msiserver ( IUnknown outer,
void **  ppObj 
)

Definition at line 2443 of file automation.c.

2444 {
2445  AutomationObject *installer;
2446  HRESULT hr;
2447 
2448  TRACE("(%p %p)\n", outer, ppObj);
2449 
2450  if (outer)
2451  return CLASS_E_NOAGGREGATION;
2452 
2453  installer = msi_alloc(sizeof(AutomationObject));
2454  if (!installer) return E_OUTOFMEMORY;
2455 
2456  hr = init_automation_object(installer, 0, Installer_tid);
2457  if (hr != S_OK)
2458  {
2459  msi_free(installer);
2460  return hr;
2461  }
2462 
2463  *ppObj = &installer->IDispatch_iface;
2464 
2465  return hr;
2466 }
HRESULT hr
Definition: shlfolder.c:183
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
#define CLASS_E_NOAGGREGATION
Definition: winerror.h:2662
static HRESULT init_automation_object(AutomationObject *This, MSIHANDLE msiHandle, tid_t tid)
Definition: automation.c:547
#define S_OK
Definition: intsafe.h:59
IDispatch IDispatch_iface
Definition: automation.c:146
static BOOL msi_free(void *mem)
Definition: msipriv.h:1227
static void * msi_alloc(size_t len) __WINE_ALLOC_SIZE(1)
Definition: msipriv.h:1204

Referenced by call_script().

◆ create_record()

static HRESULT create_record ( MSIHANDLE  msiHandle,
IDispatch **  disp 
)
static

Definition at line 1003 of file automation.c.

1004 {
1006  HRESULT hr;
1007 
1008  record = msi_alloc(sizeof(*record));
1009  if (!record) return E_OUTOFMEMORY;
1010 
1011  hr = init_automation_object(record, msiHandle, Record_tid);
1012  if (hr != S_OK)
1013  {
1014  msi_free(record);
1015  return hr;
1016  }
1017 
1018  *disp = &record->IDispatch_iface;
1019 
1020  return hr;
1021 }
disp
Definition: i386-dis.c:3181
HRESULT hr
Definition: shlfolder.c:183
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
LONG HRESULT
Definition: typedefs.h:77
static HRESULT init_automation_object(AutomationObject *This, MSIHANDLE msiHandle, tid_t tid)
Definition: automation.c:547
#define S_OK
Definition: intsafe.h:59
static BOOL msi_free(void *mem)
Definition: msipriv.h:1227
static void * msi_alloc(size_t len) __WINE_ALLOC_SIZE(1)
Definition: msipriv.h:1204

Referenced by InstallerImpl_CreateRecord(), and view_invoke().

◆ create_session()

HRESULT create_session ( MSIHANDLE  msiHandle,
IDispatch installer,
IDispatch **  disp 
)

Definition at line 2468 of file automation.c.

2469 {
2470  SessionObject *session;
2471  HRESULT hr;
2472 
2473  session = msi_alloc(sizeof(SessionObject));
2474  if (!session) return E_OUTOFMEMORY;
2475 
2476  hr = init_automation_object(&session->autoobj, msiHandle, Session_tid);
2477  if (hr != S_OK)
2478  {
2479  msi_free(session);
2480  return hr;
2481  }
2482 
2483  session->installer = installer;
2484  *disp = &session->autoobj.IDispatch_iface;
2485 
2486  return hr;
2487 }
disp
Definition: i386-dis.c:3181
HRESULT hr
Definition: shlfolder.c:183
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
LONG HRESULT
Definition: typedefs.h:77
static HRESULT init_automation_object(AutomationObject *This, MSIHANDLE msiHandle, tid_t tid)
Definition: automation.c:547
#define S_OK
Definition: intsafe.h:59
IDispatch IDispatch_iface
Definition: automation.c:146
static BOOL msi_free(void *mem)
Definition: msipriv.h:1227
static void * msi_alloc(size_t len) __WINE_ALLOC_SIZE(1)
Definition: msipriv.h:1204
IDispatch * installer
Definition: automation.c:180
AutomationObject autoobj
Definition: automation.c:179

Referenced by call_script(), and InstallerImpl_OpenPackage().

◆ create_summaryinfo()

static HRESULT create_summaryinfo ( MSIHANDLE  msiHandle,
IDispatch **  disp 
)
static

Definition at line 2533 of file automation.c.

2534 {
2536  HRESULT hr;
2537 
2538  info = msi_alloc(sizeof(*info));
2539  if (!info) return E_OUTOFMEMORY;
2540 
2542  if (hr != S_OK)
2543  {
2544  msi_free(info);
2545  return hr;
2546  }
2547 
2548  *disp = &info->IDispatch_iface;
2549 
2550  return hr;
2551 }
disp
Definition: i386-dis.c:3181
HRESULT hr
Definition: shlfolder.c:183
struct _test_info info[]
Definition: SetCursorPos.c:19
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
LONG HRESULT
Definition: typedefs.h:77
static HRESULT init_automation_object(AutomationObject *This, MSIHANDLE msiHandle, tid_t tid)
Definition: automation.c:547
#define S_OK
Definition: intsafe.h:59
static BOOL msi_free(void *mem)
Definition: msipriv.h:1227
static void * msi_alloc(size_t len) __WINE_ALLOC_SIZE(1)
Definition: msipriv.h:1204

Referenced by database_invoke(), and InstallerImpl_SummaryInformation().

◆ create_view()

static HRESULT create_view ( MSIHANDLE  msiHandle,
IDispatch **  dispatch 
)
static

Definition at line 2511 of file automation.c.

2512 {
2514  HRESULT hr;
2515 
2516  TRACE("(%d %p)\n", msiHandle, dispatch);
2517 
2518  view = msi_alloc(sizeof(AutomationObject));
2519  if (!view) return E_OUTOFMEMORY;
2520 
2521  hr = init_automation_object(view, msiHandle, View_tid);
2522  if (hr != S_OK)
2523  {
2524  msi_free(view);
2525  return hr;
2526  }
2527 
2528  *dispatch = &view->IDispatch_iface;
2529 
2530  return hr;
2531 }
HRESULT hr
Definition: shlfolder.c:183
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
void dispatch(HANDLE hStopEvent)
Definition: dispatch.c:66
static HRESULT init_automation_object(AutomationObject *This, MSIHANDLE msiHandle, tid_t tid)
Definition: automation.c:547
#define S_OK
Definition: intsafe.h:59
static BOOL msi_free(void *mem)
Definition: msipriv.h:1227
static void * msi_alloc(size_t len) __WINE_ALLOC_SIZE(1)
Definition: msipriv.h:1204
static IOleDocumentView * view
Definition: activex.c:1749

Referenced by database_invoke(), and yyparse().

◆ database_invoke()

HRESULT database_invoke ( AutomationObject This,
DISPID  dispIdMember,
REFIID  riid,
LCID  lcid,
WORD  wFlags,
DISPPARAMS *  pDispParams,
VARIANT pVarResult,
EXCEPINFO *  pExcepInfo,
UINT puArgErr 
)
static

Definition at line 1274 of file automation.c.

1284 {
1285  IDispatch *dispatch = NULL;
1286  MSIHANDLE msiHandle;
1287  UINT ret;
1288  VARIANTARG varg0, varg1;
1289  HRESULT hr;
1290 
1291  VariantInit(&varg0);
1292  VariantInit(&varg1);
1293 
1294  switch (dispIdMember)
1295  {
1298  {
1299  hr = DispGetParam(pDispParams, 0, VT_I4, &varg0, puArgErr);
1300  if (FAILED(hr))
1301  V_I4(&varg0) = 0;
1302 
1303  V_VT(pVarResult) = VT_DISPATCH;
1304  if ((ret = MsiGetSummaryInformationW(This->msiHandle, NULL, V_I4(&varg0), &msiHandle)) == ERROR_SUCCESS)
1305  {
1306  hr = create_summaryinfo(msiHandle, &dispatch);
1307  if (SUCCEEDED(hr))
1308  V_DISPATCH(pVarResult) = dispatch;
1309  else
1310  ERR("Failed to create SummaryInfo object: 0x%08x\n", hr);
1311  }
1312  else
1313  {
1314  ERR("MsiGetSummaryInformation returned %d\n", ret);
1315  return DISP_E_EXCEPTION;
1316  }
1317  }
1318  else return DISP_E_MEMBERNOTFOUND;
1319  break;
1320 
1322  if (wFlags & DISPATCH_METHOD)
1323  {
1324  hr = DispGetParam(pDispParams, 0, VT_BSTR, &varg0, puArgErr);
1325  if (FAILED(hr)) return hr;
1326  V_VT(pVarResult) = VT_DISPATCH;
1327  if ((ret = MsiDatabaseOpenViewW(This->msiHandle, V_BSTR(&varg0), &msiHandle)) == ERROR_SUCCESS)
1328  {
1329  if (SUCCEEDED(hr = create_view(msiHandle, &dispatch)))
1330  V_DISPATCH(pVarResult) = dispatch;
1331  else
1332  ERR("Failed to create View object, hresult 0x%08x\n", hr);
1333  }
1334  else
1335  {
1336  VariantClear(&varg0);
1337  ERR("MsiDatabaseOpenView returned %d\n", ret);
1338  return DISP_E_EXCEPTION;
1339  }
1340  }
1341  else return DISP_E_MEMBERNOTFOUND;
1342  break;
1343 
1345  return DatabaseImpl_LastErrorRecord(wFlags, pDispParams,
1346  pVarResult, pExcepInfo,
1347  puArgErr);
1348 
1349  default:
1350  return DISP_E_MEMBERNOTFOUND;
1351  }
1352 
1353  VariantClear(&varg1);
1354  VariantClear(&varg0);
1355 
1356  return S_OK;
1357 }
#define DISP_E_EXCEPTION
Definition: winerror.h:2518
Definition: compat.h:1947
#define DISPATCH_PROPERTYGET
Definition: oleauto.h:1007
#define ERROR_SUCCESS
Definition: deptool.c:10
HRESULT hr
Definition: shlfolder.c:183
HRESULT WINAPI DispGetParam(DISPPARAMS *pdispparams, UINT position, VARTYPE vtTarg, VARIANT *pvarResult, UINT *puArgErr)
Definition: dispatch.c:118
#define DISP_E_MEMBERNOTFOUND
Definition: winerror.h:2512
UINT WINAPI MsiGetSummaryInformationW(MSIHANDLE hDatabase, LPCWSTR szDatabase, UINT uiUpdateCount, MSIHANDLE *pHandle)
Definition: suminfo.c:514
void WINAPI VariantInit(VARIANTARG *pVarg)
Definition: variant.c:571
unsigned long MSIHANDLE
Definition: msiserver.idl:25
#define V_I4(A)
Definition: oleauto.h:247
#define DISPATCH_METHOD
Definition: oleauto.h:1006
#define V_DISPATCH(A)
Definition: oleauto.h:239
static HRESULT DatabaseImpl_LastErrorRecord(WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
Definition: automation.c:1259
smooth NULL
Definition: ftsmooth.c:416
LONG HRESULT
Definition: typedefs.h:77
#define DISPID_INSTALLER_LASTERRORRECORD
int ret
HRESULT WINAPI DECLSPEC_HOTPATCH VariantClear(VARIANTARG *pVarg)
Definition: variant.c:651
#define V_VT(A)
Definition: oleauto.h:211
void dispatch(HANDLE hStopEvent)
Definition: dispatch.c:66
#define V_BSTR(A)
Definition: oleauto.h:226
#define DISPID_DATABASE_SUMMARYINFORMATION
_In_ DWORD _Out_ _In_ WORD wFlags
Definition: wincon.h:519
#define ERR(fmt,...)
Definition: debug.h:109
#define S_OK
Definition: intsafe.h:59
#define DISPID_DATABASE_OPENVIEW
unsigned int UINT
Definition: ndis.h:50
UINT WINAPI MsiDatabaseOpenViewW(MSIHANDLE hdb, LPCWSTR szQuery, MSIHANDLE *phView)
Definition: msiquery.c:241
static HRESULT create_summaryinfo(MSIHANDLE, IDispatch **)
Definition: automation.c:2533
#define SUCCEEDED(hr)
Definition: intsafe.h:57
static HRESULT create_view(MSIHANDLE, IDispatch **)
Definition: automation.c:2511

◆ DatabaseImpl_LastErrorRecord()

static HRESULT DatabaseImpl_LastErrorRecord ( WORD  wFlags,
DISPPARAMS *  pDispParams,
VARIANT pVarResult,
EXCEPINFO *  pExcepInfo,
UINT puArgErr 
)
static

Definition at line 1259 of file automation.c.

1264 {
1265  if (!(wFlags & DISPATCH_METHOD))
1266  return DISP_E_MEMBERNOTFOUND;
1267 
1268  FIXME("\n");
1269 
1270  VariantInit(pVarResult);
1271  return S_OK;
1272 }
#define DISP_E_MEMBERNOTFOUND
Definition: winerror.h:2512
void WINAPI VariantInit(VARIANTARG *pVarg)
Definition: variant.c:571
#define DISPATCH_METHOD
Definition: oleauto.h:1006
#define FIXME(fmt,...)
Definition: debug.h:110
_In_ DWORD _Out_ _In_ WORD wFlags
Definition: wincon.h:519
#define S_OK
Definition: intsafe.h:59

Referenced by database_invoke().

◆ DispGetParam_CopyOnly()

static HRESULT DispGetParam_CopyOnly ( DISPPARAMS *  pdispparams,
UINT position,
VARIANT pvarResult 
)
static

Definition at line 734 of file automation.c.

738 {
739  /* position is counted backwards */
740  UINT pos;
741 
742  TRACE("position=%d, cArgs=%d, cNamedArgs=%d\n",
743  *position, pdispparams->cArgs, pdispparams->cNamedArgs);
744  if (*position < pdispparams->cArgs) {
745  /* positional arg? */
746  pos = pdispparams->cArgs - *position - 1;
747  } else {
748  /* FIXME: is this how to handle named args? */
749  for (pos=0; pos<pdispparams->cNamedArgs; pos++)
750  if (pdispparams->rgdispidNamedArgs[pos] == *position) break;
751 
752  if (pos==pdispparams->cNamedArgs)
753  return DISP_E_PARAMNOTFOUND;
754  }
755  *position = pos;
756  return VariantCopyInd(pvarResult,
757  &pdispparams->rgvarg[pos]);
758 }
HRESULT WINAPI VariantCopyInd(VARIANT *pvargDest, VARIANTARG *pvargSrc)
Definition: variant.c:850
#define DISP_E_PARAMNOTFOUND
Definition: winerror.h:2513
#define TRACE(s)
Definition: solgame.cpp:4
unsigned int UINT
Definition: ndis.h:50

Referenced by InstallerImpl_RegistryValue(), and summaryinfo_invoke().

◆ get_products_count()

static HRESULT get_products_count ( const WCHAR product,
int len 
)
static

Definition at line 1090 of file automation.c.

1091 {
1092  int i = 0;
1093 
1094  while (1)
1095  {
1096  WCHAR dataW[GUID_SIZE];
1097  UINT ret;
1098 
1099  /* all or related only */
1100  if (product)
1101  ret = MsiEnumRelatedProductsW(product, 0, i, dataW);
1102  else
1103  ret = MsiEnumProductsW(i, dataW);
1104 
1105  if (ret == ERROR_NO_MORE_ITEMS) break;
1106 
1107  if (ret != ERROR_SUCCESS)
1108  return DISP_E_EXCEPTION;
1109 
1110  i++;
1111  }
1112 
1113  *len = i;
1114 
1115  return S_OK;
1116 }
#define DISP_E_EXCEPTION
Definition: winerror.h:2518
#define ERROR_SUCCESS
Definition: deptool.c:10
UINT WINAPI MsiEnumProductsW(DWORD index, LPWSTR lpguid)
Definition: registry.c:1168
#define ERROR_NO_MORE_ITEMS
Definition: compat.h:95
UINT WINAPI MsiEnumRelatedProductsW(LPCWSTR szUpgradeCode, DWORD dwReserved, DWORD iProductIndex, LPWSTR lpProductBuf)
Definition: registry.c:1706
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
__wchar_t WCHAR
Definition: xmlstorage.h:180
int ret
GLenum GLsizei len
Definition: glext.h:6722
#define S_OK
Definition: intsafe.h:59
unsigned int UINT
Definition: ndis.h:50
#define GUID_SIZE
Definition: msipriv.h:710

Referenced by create_list().

◆ get_riid_from_tid()

static const IID* get_riid_from_tid ( tid_t  tid)
static

◆ get_typeinfo()

HRESULT get_typeinfo ( tid_t  tid,
ITypeInfo **  typeinfo 
)

Definition at line 89 of file automation.c.

90 {
91  HRESULT hr;
92 
93  if (!typelib)
94  {
95  ITypeLib *lib;
96 
97  hr = LoadRegTypeLib(&LIBID_WindowsInstaller, 1, 0, LOCALE_NEUTRAL, &lib);
98  if (FAILED(hr)) {
99  static const WCHAR msiserverW[] = {'m','s','i','s','e','r','v','e','r','.','t','l','b',0};
100  hr = LoadTypeLib(msiserverW, &lib);
101  if (FAILED(hr)) {
102  ERR("Could not load msiserver.tlb\n");
103  return hr;
104  }
105  }
106 
107  if (InterlockedCompareExchangePointer((void**)&typelib, lib, NULL))
108  ITypeLib_Release(lib);
109  }
110 
111  if (!typeinfos[tid])
112  {
113  ITypeInfo *ti;
114 
115  hr = ITypeLib_GetTypeInfoOfGuid(typelib, get_riid_from_tid(tid), &ti);
116  if (FAILED(hr)) {
117  ERR("Could not load ITypeInfo for %s\n", debugstr_guid(get_riid_from_tid(tid)));
118  return hr;
119  }
120 
122  ITypeInfo_Release(ti);
123  }
124 
125  *typeinfo = typeinfos[tid];
126  return S_OK;
127 }
HRESULT hr
Definition: shlfolder.c:183
HRESULT WINAPI LoadTypeLib(const OLECHAR *szFile, ITypeLib **pptLib)
Definition: typelib.c:461
#define InterlockedCompareExchangePointer
Definition: interlocked.h:129
static const IID * get_riid_from_tid(tid_t tid)
Definition: automation.c:84
smooth NULL
Definition: ftsmooth.c:416
static ITypeInfo * typeinfos[LAST_tid]
Definition: automation.c:82
#define debugstr_guid
Definition: kernel32.h:35
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
static ITypeLib * typelib
Definition: automation.c:81
#define ERR(fmt,...)
Definition: debug.h:109
#define S_OK
Definition: intsafe.h:59
HRESULT WINAPI LoadRegTypeLib(REFGUID rguid, WORD wVerMajor, WORD wVerMinor, LCID lcid, ITypeLib **ppTLib)
Definition: typelib.c:534
#define LOCALE_NEUTRAL
static TfClientId tid

Referenced by AutomationObject_GetIDsOfNames(), AutomationObject_GetTypeInfo(), AutomationObject_Invoke(), ProvideMultipleClassInfo_GetClassInfo(), and ProvideMultipleClassInfo_GetInfoOfIndex().

◆ impl_from_IDispatch()

static AutomationObject* impl_from_IDispatch ( IDispatch iface)
inlinestatic

Definition at line 188 of file automation.c.

189 {
190  return CONTAINING_RECORD(iface, AutomationObject, IDispatch_iface);
191 }
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560

Referenced by AutomationObject_AddRef(), AutomationObject_GetIDsOfNames(), AutomationObject_GetTypeInfo(), AutomationObject_GetTypeInfoCount(), AutomationObject_Invoke(), AutomationObject_QueryInterface(), and AutomationObject_Release().

◆ impl_from_IEnumVARIANT()

static ListEnumerator* impl_from_IEnumVARIANT ( IEnumVARIANT iface)
inlinestatic

Definition at line 565 of file automation.c.

566 {
567  return CONTAINING_RECORD(iface, ListEnumerator, IEnumVARIANT_iface);
568 }
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560

Referenced by ListEnumerator_AddRef(), ListEnumerator_Clone(), ListEnumerator_Next(), ListEnumerator_QueryInterface(), ListEnumerator_Release(), ListEnumerator_Reset(), and ListEnumerator_Skip().

◆ impl_from_IProvideMultipleClassInfo()

static AutomationObject* impl_from_IProvideMultipleClassInfo ( IProvideMultipleClassInfo iface)
inlinestatic

Definition at line 183 of file automation.c.

184 {
185  return CONTAINING_RECORD(iface, AutomationObject, IProvideMultipleClassInfo_iface);
186 }
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560

Referenced by ProvideMultipleClassInfo_AddRef(), ProvideMultipleClassInfo_GetClassInfo(), ProvideMultipleClassInfo_GetGUID(), ProvideMultipleClassInfo_GetInfoOfIndex(), ProvideMultipleClassInfo_GetMultiTypeInfoCount(), ProvideMultipleClassInfo_QueryInterface(), and ProvideMultipleClassInfo_Release().

◆ init_automation_object()

static HRESULT init_automation_object ( AutomationObject This,
MSIHANDLE  msiHandle,
tid_t  tid 
)
static

Definition at line 547 of file automation.c.

548 {
549  TRACE("(%p, %d, %s)\n", This, msiHandle, debugstr_guid(get_riid_from_tid(tid)));
550 
551  This->IDispatch_iface.lpVtbl = &AutomationObjectVtbl;
552  This->IProvideMultipleClassInfo_iface.lpVtbl = &ProvideMultipleClassInfoVtbl;
553  This->ref = 1;
554 
555  This->msiHandle = msiHandle;
556  This->tid = tid;
557 
558  return S_OK;
559 }
static const struct IDispatchVtbl AutomationObjectVtbl
Definition: automation.c:424
static const IProvideMultipleClassInfoVtbl ProvideMultipleClassInfoVtbl
Definition: automation.c:536
static const IID * get_riid_from_tid(tid_t tid)
Definition: automation.c:84
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
#define S_OK
Definition: intsafe.h:59
static TfClientId tid

Referenced by create_database(), create_list(), create_msiserver(), create_record(), create_session(), create_summaryinfo(), and create_view().

◆ installer_invoke()

static HRESULT installer_invoke ( AutomationObject This,
DISPID  dispIdMember,
REFIID  riid,
LCID  lcid,
WORD  wFlags,
DISPPARAMS *  pDispParams,
VARIANT pVarResult,
EXCEPINFO *  pExcepInfo,
UINT puArgErr 
)
static

Definition at line 2343 of file automation.c.

2353 {
2354  switch (dispIdMember)
2355  {
2357  return InstallerImpl_CreateRecord(wFlags, pDispParams,
2358  pVarResult, pExcepInfo, puArgErr);
2359 
2361  return InstallerImpl_OpenPackage(This, wFlags, pDispParams,
2362  pVarResult, pExcepInfo, puArgErr);
2363 
2365  return InstallerImpl_OpenProduct(wFlags, pDispParams,
2366  pVarResult, pExcepInfo, puArgErr);
2367 
2369  return InstallerImpl_OpenDatabase(wFlags, pDispParams,
2370  pVarResult, pExcepInfo, puArgErr);
2371 
2373  return InstallerImpl_SummaryInformation(wFlags, pDispParams,
2374  pVarResult, pExcepInfo,
2375  puArgErr);
2376 
2378  return InstallerImpl_UILevel(wFlags, pDispParams,
2379  pVarResult, pExcepInfo, puArgErr);
2380 
2382  return InstallerImpl_EnableLog(wFlags, pDispParams,
2383  pVarResult, pExcepInfo, puArgErr);
2384 
2386  return InstallerImpl_InstallProduct(wFlags, pDispParams,
2387  pVarResult, pExcepInfo,
2388  puArgErr);
2389 
2391  return InstallerImpl_Version(wFlags, pVarResult,
2392  pExcepInfo, puArgErr);
2393 
2395  return InstallerImpl_LastErrorRecord(wFlags, pDispParams,
2396  pVarResult, pExcepInfo,
2397  puArgErr);
2398 
2400  return InstallerImpl_RegistryValue(wFlags, pDispParams,
2401  pVarResult, pExcepInfo,
2402  puArgErr);
2403 
2405  return InstallerImpl_Environment(wFlags, pDispParams,
2406  pVarResult, pExcepInfo, puArgErr);
2407 
2409  return InstallerImpl_FileAttributes(wFlags, pDispParams,
2410  pVarResult, pExcepInfo,
2411  puArgErr);
2412 
2414  return InstallerImpl_FileSize(wFlags, pDispParams,
2415  pVarResult, pExcepInfo, puArgErr);
2416 
2418  return InstallerImpl_FileVersion(wFlags, pDispParams,
2419  pVarResult, pExcepInfo, puArgErr);
2420 
2422  return InstallerImpl_ProductState(wFlags, pDispParams,
2423  pVarResult, pExcepInfo, puArgErr);
2424 
2426  return InstallerImpl_ProductInfo(wFlags, pDispParams,
2427  pVarResult, pExcepInfo, puArgErr);
2428 
2430  return InstallerImpl_Products(wFlags, pDispParams,
2431  pVarResult, pExcepInfo, puArgErr);
2432 
2434  return InstallerImpl_RelatedProducts(wFlags, pDispParams,
2435  pVarResult, pExcepInfo,
2436  puArgErr);
2437 
2438  default:
2439  return DISP_E_MEMBERNOTFOUND;
2440  }
2441 }
#define DISPID_INSTALLER_OPENPACKAGE
#define DISPID_INSTALLER_OPENPRODUCT
#define DISPID_INSTALLER_PRODUCTS
#define DISPID_INSTALLER_FILESIZE
#define DISPID_INSTALLER_ENABLELOG
#define DISPID_INSTALLER_SUMMARYINFORMATION
static HRESULT InstallerImpl_CreateRecord(WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
Definition: automation.c:1677
#define DISPID_INSTALLER_OPENDATABASE
#define DISP_E_MEMBERNOTFOUND
Definition: winerror.h:2512
#define DISPID_INSTALLER_CREATERECORD
#define DISPID_INSTALLER_FILEVERSION
static HRESULT InstallerImpl_ProductInfo(WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
Definition: automation.c:2235
#define DISPID_INSTALLER_UILEVEL
static HRESULT InstallerImpl_RegistryValue(WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
Definition: automation.c:2002
#define DISPID_INSTALLER_FILEATTRIBUTES
static HRESULT InstallerImpl_Version(WORD wFlags, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
Definition: automation.c:1959
#define DISPID_INSTALLER_VERSION
static HRESULT InstallerImpl_FileAttributes(WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
Definition: automation.c:2166
#define DISPID_INSTALLER_PRODUCTINFO
static HRESULT InstallerImpl_EnableLog(WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
Definition: automation.c:1908
#define DISPID_INSTALLER_LASTERRORRECORD
static HRESULT InstallerImpl_FileSize(WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
Definition: automation.c:2181
static HRESULT InstallerImpl_UILevel(WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
Definition: automation.c:1871
static HRESULT InstallerImpl_ProductState(WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
Definition: automation.c:2211
#define DISPID_INSTALLER_PRODUCTSTATE
#define DISPID_INSTALLER_RELATEDPRODUCTS
_In_ DWORD _Out_ _In_ WORD wFlags
Definition: wincon.h:519
static HRESULT InstallerImpl_FileVersion(WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
Definition: automation.c:2196
static HRESULT InstallerImpl_InstallProduct(WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
Definition: automation.c:1923
static HRESULT InstallerImpl_OpenDatabase(WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
Definition: automation.c:1788
static HRESULT InstallerImpl_SummaryInformation(WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
Definition: automation.c:1832
static HRESULT InstallerImpl_LastErrorRecord(WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
Definition: automation.c:1987
#define DISPID_INSTALLER_ENVIRONMENT
static HRESULT InstallerImpl_RelatedProducts(WORD flags, DISPPARAMS *pDispParams, VARIANT *result, EXCEPINFO *pExcepInfo, UINT *puArgErr)
Definition: automation.c:2316
#define DISPID_INSTALLER_INSTALLPRODUCT
static HRESULT InstallerImpl_OpenPackage(AutomationObject *This, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
Definition: automation.c:1704
static HRESULT InstallerImpl_OpenProduct(WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
Definition: automation.c:1763
static HRESULT InstallerImpl_Environment(WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
Definition: automation.c:2151
static HRESULT InstallerImpl_Products(WORD flags, DISPPARAMS *pDispParams, VARIANT *result, EXCEPINFO *pExcepInfo, UINT *puArgErr)
Definition: automation.c:2294
#define DISPID_INSTALLER_REGISTRYVALUE

◆ InstallerImpl_CreateRecord()

static HRESULT InstallerImpl_CreateRecord ( WORD  wFlags,
DISPPARAMS *  pDispParams,
VARIANT pVarResult,
EXCEPINFO *  pExcepInfo,
UINT puArgErr 
)
static

Definition at line 1677 of file automation.c.

1682 {
1683  HRESULT hr;
1684  VARIANTARG varg0;
1685  MSIHANDLE hrec;
1686 
1687  if (!(wFlags & DISPATCH_METHOD))
1688  return DISP_E_MEMBERNOTFOUND;
1689 
1690  VariantInit(&varg0);
1691  hr = DispGetParam(pDispParams, 0, VT_I4, &varg0, puArgErr);
1692  if (FAILED(hr))
1693  return hr;
1694 
1695  V_VT(pVarResult) = VT_DISPATCH;
1696 
1697  hrec = MsiCreateRecord(V_I4(&varg0));
1698  if (!hrec)
1699  return DISP_E_EXCEPTION;
1700 
1701  return create_record(hrec, &V_DISPATCH(pVarResult));
1702 }
#define DISP_E_EXCEPTION
Definition: winerror.h:2518
MSIHANDLE WINAPI MsiCreateRecord(UINT cParams)
Definition: record.c:95
Definition: compat.h:1947
HRESULT hr
Definition: shlfolder.c:183
HRESULT WINAPI DispGetParam(DISPPARAMS *pdispparams, UINT position, VARTYPE vtTarg, VARIANT *pvarResult, UINT *puArgErr)
Definition: dispatch.c:118
#define DISP_E_MEMBERNOTFOUND
Definition: winerror.h:2512
void WINAPI VariantInit(VARIANTARG *pVarg)
Definition: variant.c:571
unsigned long MSIHANDLE
Definition: msiserver.idl:25
#define V_I4(A)
Definition: oleauto.h:247
#define DISPATCH_METHOD
Definition: oleauto.h:1006
#define V_DISPATCH(A)
Definition: oleauto.h:239
LONG HRESULT
Definition: typedefs.h:77
#define V_VT(A)
Definition: oleauto.h:211
_In_ DWORD _Out_ _In_ WORD wFlags
Definition: wincon.h:519
static HRESULT create_record(MSIHANDLE msiHandle, IDispatch **disp)
Definition: automation.c:1003

Referenced by installer_invoke().

◆ InstallerImpl_EnableLog()

static HRESULT InstallerImpl_EnableLog ( WORD  wFlags,
DISPPARAMS *  pDispParams,
VARIANT pVarResult,
EXCEPINFO *  pExcepInfo,
UINT puArgErr 
)
static

Definition at line 1908 of file automation.c.

1913 {
1914  if (!(wFlags & DISPATCH_METHOD))
1915  return DISP_E_MEMBERNOTFOUND;
1916 
1917  FIXME("\n");
1918 
1919  VariantInit(pVarResult);
1920  return S_OK;
1921 }
#define DISP_E_MEMBERNOTFOUND
Definition: winerror.h:2512
void WINAPI VariantInit(VARIANTARG *pVarg)
Definition: variant.c:571
#define DISPATCH_METHOD
Definition: oleauto.h:1006
#define FIXME(fmt,...)
Definition: debug.h:110
_In_ DWORD _Out_ _In_ WORD wFlags
Definition: wincon.h:519
#define S_OK
Definition: intsafe.h:59

Referenced by installer_invoke().

◆ InstallerImpl_Environment()

static HRESULT InstallerImpl_Environment ( WORD  wFlags,
DISPPARAMS *  pDispParams,
VARIANT pVarResult,
EXCEPINFO *  pExcepInfo,
UINT puArgErr 
)
static

Definition at line 2151 of file automation.c.

2156 {
2157  if (!(wFlags & DISPATCH_METHOD))
2158  return DISP_E_MEMBERNOTFOUND;
2159 
2160  FIXME("\n");
2161 
2162  VariantInit(pVarResult);
2163  return S_OK;
2164 }
#define DISP_E_MEMBERNOTFOUND
Definition: winerror.h:2512
void WINAPI VariantInit(VARIANTARG *pVarg)
Definition: variant.c:571
#define DISPATCH_METHOD
Definition: oleauto.h:1006
#define FIXME(fmt,...)
Definition: debug.h:110
_In_ DWORD _Out_ _In_ WORD wFlags
Definition: wincon.h:519
#define S_OK
Definition: intsafe.h:59

Referenced by installer_invoke().

◆ InstallerImpl_FileAttributes()

static HRESULT InstallerImpl_FileAttributes ( WORD  wFlags,
DISPPARAMS *  pDispParams,
VARIANT pVarResult,
EXCEPINFO *  pExcepInfo,
UINT puArgErr 
)
static

Definition at line 2166 of file automation.c.

2171 {
2172  if (!(wFlags & DISPATCH_METHOD))
2173  return DISP_E_MEMBERNOTFOUND;
2174 
2175  FIXME("\n");
2176 
2177  VariantInit(pVarResult);
2178  return S_OK;
2179 }
#define DISP_E_MEMBERNOTFOUND
Definition: winerror.h:2512
void WINAPI VariantInit(VARIANTARG *pVarg)
Definition: variant.c:571
#define DISPATCH_METHOD
Definition: oleauto.h:1006
#define FIXME(fmt,...)
Definition: debug.h:110
_In_ DWORD _Out_ _In_ WORD wFlags
Definition: wincon.h:519
#define S_OK
Definition: intsafe.h:59

Referenced by installer_invoke().

◆ InstallerImpl_FileSize()

static HRESULT InstallerImpl_FileSize ( WORD  wFlags,
DISPPARAMS *  pDispParams,
VARIANT pVarResult,
EXCEPINFO *  pExcepInfo,
UINT puArgErr 
)
static

Definition at line 2181 of file automation.c.

2186 {
2187  if (!(wFlags & DISPATCH_METHOD))
2188  return DISP_E_MEMBERNOTFOUND;
2189 
2190  FIXME("\n");
2191 
2192  VariantInit(pVarResult);
2193  return S_OK;
2194 }
#define DISP_E_MEMBERNOTFOUND
Definition: winerror.h:2512
void WINAPI VariantInit(VARIANTARG *pVarg)
Definition: variant.c:571
#define DISPATCH_METHOD
Definition: oleauto.h:1006
#define FIXME(fmt,...)
Definition: debug.h:110
_In_ DWORD _Out_ _In_ WORD wFlags
Definition: wincon.h:519
#define S_OK
Definition: intsafe.h:59

Referenced by installer_invoke().

◆ InstallerImpl_FileVersion()

static HRESULT InstallerImpl_FileVersion ( WORD  wFlags,
DISPPARAMS *  pDispParams,
VARIANT pVarResult,
EXCEPINFO *  pExcepInfo,
UINT puArgErr 
)
static

Definition at line 2196 of file automation.c.

2201 {
2202  if (!(wFlags & DISPATCH_METHOD))
2203  return DISP_E_MEMBERNOTFOUND;
2204 
2205  FIXME("\n");
2206 
2207  VariantInit(pVarResult);
2208  return S_OK;
2209 }
#define DISP_E_MEMBERNOTFOUND
Definition: winerror.h:2512
void WINAPI VariantInit(VARIANTARG *pVarg)
Definition: variant.c:571
#define DISPATCH_METHOD
Definition: oleauto.h:1006
#define FIXME(fmt,...)
Definition: debug.h:110
_In_ DWORD _Out_ _In_ WORD wFlags
Definition: wincon.h:519
#define S_OK
Definition: intsafe.h:59

Referenced by installer_invoke().

◆ InstallerImpl_InstallProduct()

static HRESULT InstallerImpl_InstallProduct ( WORD  wFlags,
DISPPARAMS *  pDispParams,
VARIANT pVarResult,
EXCEPINFO *  pExcepInfo,
UINT puArgErr 
)
static

Definition at line 1923 of file automation.c.

1928 {
1929  UINT ret;
1930  HRESULT hr;
1931  VARIANTARG varg0, varg1;
1932 
1933  if (!(wFlags & DISPATCH_METHOD))
1934  return DISP_E_MEMBERNOTFOUND;
1935 
1936  VariantInit(&varg0);
1937  hr = DispGetParam(pDispParams, 0, VT_BSTR, &varg0, puArgErr);
1938  if (FAILED(hr))
1939  return hr;
1940 
1941  VariantInit(&varg1);
1942  hr = DispGetParam(pDispParams, 1, VT_BSTR, &varg1, puArgErr);
1943  if (FAILED(hr))
1944  goto done;
1945 
1946  ret = MsiInstallProductW(V_BSTR(&varg0), V_BSTR(&varg1));
1947  if (ret != ERROR_SUCCESS)
1948  {
1949  hr = DISP_E_EXCEPTION;
1950  goto done;
1951  }
1952 
1953 done:
1954  VariantClear(&varg0);
1955  VariantClear(&varg1);
1956  return hr;
1957 }
#define DISP_E_EXCEPTION
Definition: winerror.h:2518
#define ERROR_SUCCESS
Definition: deptool.c:10
HRESULT hr
Definition: shlfolder.c:183
HRESULT WINAPI DispGetParam(DISPPARAMS *pdispparams, UINT position, VARTYPE vtTarg, VARIANT *pvarResult, UINT *puArgErr)
Definition: dispatch.c:118
UINT WINAPI MsiInstallProductW(LPCWSTR szPackagePath, LPCWSTR szCommandLine)
Definition: msi.c:235
#define DISP_E_MEMBERNOTFOUND
Definition: winerror.h:2512
void WINAPI VariantInit(VARIANTARG *pVarg)
Definition: variant.c:571
#define DISPATCH_METHOD
Definition: oleauto.h:1006
LONG HRESULT
Definition: typedefs.h:77
int ret
HRESULT WINAPI DECLSPEC_HOTPATCH VariantClear(VARIANTARG *pVarg)
Definition: variant.c:651
#define V_BSTR(A)
Definition: oleauto.h:226
_In_ DWORD _Out_ _In_ WORD wFlags
Definition: wincon.h:519
unsigned int UINT
Definition: ndis.h:50

Referenced by installer_invoke().

◆ InstallerImpl_LastErrorRecord()

static HRESULT InstallerImpl_LastErrorRecord ( WORD  wFlags,
DISPPARAMS *  pDispParams,
VARIANT pVarResult,
EXCEPINFO *  pExcepInfo,
UINT puArgErr 
)
static

Definition at line 1987 of file automation.c.

1992 {
1993  if (!(wFlags & DISPATCH_METHOD))
1994  return DISP_E_MEMBERNOTFOUND;
1995 
1996  FIXME("\n");
1997 
1998  VariantInit(pVarResult);
1999  return S_OK;
2000 }
#define DISP_E_MEMBERNOTFOUND
Definition: winerror.h:2512
void WINAPI VariantInit(VARIANTARG *pVarg)
Definition: variant.c:571
#define DISPATCH_METHOD
Definition: oleauto.h:1006
#define FIXME(fmt,...)
Definition: debug.h:110
_In_ DWORD _Out_ _In_ WORD wFlags
Definition: wincon.h:519
#define S_OK
Definition: intsafe.h:59

Referenced by installer_invoke().

◆ InstallerImpl_OpenDatabase()

static HRESULT InstallerImpl_OpenDatabase ( WORD  wFlags,
DISPPARAMS *  pDispParams,
VARIANT pVarResult,
EXCEPINFO *  pExcepInfo,
UINT puArgErr 
)
static

Definition at line 1788 of file automation.c.

1793 {
1794  UINT ret;
1795  HRESULT hr;
1796  MSIHANDLE hdb;
1798  VARIANTARG varg0, varg1;
1799 
1800  if (!(wFlags & DISPATCH_METHOD))
1801  return DISP_E_MEMBERNOTFOUND;
1802 
1803  VariantInit(&varg0);
1804  hr = DispGetParam(pDispParams, 0, VT_BSTR, &varg0, puArgErr);
1805  if (FAILED(hr))
1806  return hr;
1807 
1808  VariantInit(&varg1);
1809  hr = DispGetParam(pDispParams, 1, VT_BSTR, &varg1, puArgErr);
1810  if (FAILED(hr))
1811  goto done;
1812 
1813  V_VT(pVarResult) = VT_DISPATCH;
1814 
1815  ret = MsiOpenDatabaseW(V_BSTR(&varg0), V_BSTR(&varg1), &hdb);
1816  if (ret != ERROR_SUCCESS)
1817  {
1818  hr = DISP_E_EXCEPTION;
1819  goto done;
1820  }
1821 
1822  hr = create_database(hdb, &dispatch);
1823  if (SUCCEEDED(hr))
1824  V_DISPATCH(pVarResult) = dispatch;
1825 
1826 done:
1827  VariantClear(&varg0);
1828  VariantClear(&varg1);
1829  return hr;
1830 }
#define DISP_E_EXCEPTION
Definition: winerror.h:2518
#define ERROR_SUCCESS
Definition: deptool.c:10
HRESULT hr
Definition: shlfolder.c:183
HRESULT WINAPI DispGetParam(DISPPARAMS *pdispparams, UINT position, VARTYPE vtTarg, VARIANT *pvarResult, UINT *puArgErr)
Definition: dispatch.c:118
#define DISP_E_MEMBERNOTFOUND
Definition: winerror.h:2512
void WINAPI VariantInit(VARIANTARG *pVarg)
Definition: variant.c:571
unsigned long MSIHANDLE
Definition: msiserver.idl:25
#define DISPATCH_METHOD
Definition: oleauto.h:1006
#define V_DISPATCH(A)
Definition: oleauto.h:239
LONG HRESULT
Definition: typedefs.h:77
int ret
HRESULT WINAPI DECLSPEC_HOTPATCH VariantClear(VARIANTARG *pVarg)
Definition: variant.c:651
#define V_VT(A)
Definition: oleauto.h:211
void dispatch(HANDLE hStopEvent)
Definition: dispatch.c:66
#define V_BSTR(A)
Definition: oleauto.h:226
_In_ DWORD _Out_ _In_ WORD wFlags
Definition: wincon.h:519
static HRESULT create_database(MSIHANDLE, IDispatch **)
Definition: automation.c:2489
UINT WINAPI MsiOpenDatabaseW(LPCWSTR szDBPath, LPCWSTR szPersist, MSIHANDLE *phDB)
Definition: database.c:303
unsigned int UINT
Definition: ndis.h:50
#define SUCCEEDED(hr)
Definition: intsafe.h:57

Referenced by installer_invoke().

◆ InstallerImpl_OpenPackage()

static HRESULT InstallerImpl_OpenPackage ( AutomationObject This,
WORD  wFlags,
DISPPARAMS *  pDispParams,
VARIANT pVarResult,
EXCEPINFO *  pExcepInfo,
UINT puArgErr 
)
static

Definition at line 1704 of file automation.c.

1710 {
1711  UINT ret;
1712  HRESULT hr;
1713  MSIHANDLE hpkg;
1715  VARIANTARG varg0, varg1;
1716 
1717  if (!(wFlags & DISPATCH_METHOD))
1718  return DISP_E_MEMBERNOTFOUND;
1719 
1720  if (pDispParams->cArgs == 0)
1721  return DISP_E_TYPEMISMATCH;
1722 
1723  if (V_VT(&pDispParams->rgvarg[pDispParams->cArgs - 1]) != VT_BSTR)
1724  return DISP_E_TYPEMISMATCH;
1725 
1726  VariantInit(&varg0);
1727  hr = DispGetParam(pDispParams, 0, VT_BSTR, &varg0, puArgErr);
1728  if (FAILED(hr))
1729  return hr;
1730 
1731  VariantInit(&varg1);
1732  if (pDispParams->cArgs == 2)
1733  {
1734  hr = DispGetParam(pDispParams, 1, VT_I4, &varg1, puArgErr);
1735  if (FAILED(hr))
1736  goto done;
1737  }
1738  else
1739  {
1740  V_VT(&varg1) = VT_I4;
1741  V_I4(&varg1) = 0;
1742  }
1743 
1744  V_VT(pVarResult) = VT_DISPATCH;
1745 
1746  ret = MsiOpenPackageExW(V_BSTR(&varg0), V_I4(&varg1), &hpkg);
1747  if (ret != ERROR_SUCCESS)
1748  {
1749  hr = DISP_E_EXCEPTION;
1750  goto done;
1751  }
1752 
1753  hr = create_session(hpkg, &This->IDispatch_iface, &dispatch);
1754  if (SUCCEEDED(hr))
1755  V_DISPATCH(pVarResult) = dispatch;
1756 
1757 done:
1758  VariantClear(&varg0);
1759  VariantClear(&varg1);
1760  return hr;
1761 }
#define DISP_E_EXCEPTION
Definition: winerror.h:2518
Definition: compat.h:1947
#define ERROR_SUCCESS
Definition: deptool.c:10
HRESULT hr
Definition: shlfolder.c:183
HRESULT WINAPI DispGetParam(DISPPARAMS *pdispparams, UINT position, VARTYPE vtTarg, VARIANT *pvarResult, UINT *puArgErr)
Definition: dispatch.c:118
#define DISP_E_MEMBERNOTFOUND
Definition: winerror.h:2512
void WINAPI VariantInit(VARIANTARG *pVarg)
Definition: variant.c:571
unsigned long MSIHANDLE
Definition: msiserver.idl:25
#define V_I4(A)
Definition: oleauto.h:247
#define DISPATCH_METHOD
Definition: oleauto.h:1006
HRESULT create_session(MSIHANDLE msiHandle, IDispatch *installer, IDispatch **disp)
Definition: automation.c:2468
#define V_DISPATCH(A)
Definition: oleauto.h:239
UINT WINAPI MsiOpenPackageExW(LPCWSTR szPackage, DWORD dwOptions, MSIHANDLE *phPackage)
Definition: package.c:1630
#define DISP_E_TYPEMISMATCH
Definition: winerror.h:2514
LONG HRESULT
Definition: typedefs.h:77
int ret
HRESULT WINAPI DECLSPEC_HOTPATCH VariantClear(VARIANTARG *pVarg)
Definition: variant.c:651
#define V_VT(A)
Definition: oleauto.h:211
void dispatch(HANDLE hStopEvent)
Definition: dispatch.c:66
#define V_BSTR(A)
Definition: oleauto.h:226
_In_ DWORD _Out_ _In_ WORD wFlags
Definition: wincon.h:519
unsigned int UINT
Definition: ndis.h:50
#define SUCCEEDED(hr)
Definition: intsafe.h:57

Referenced by installer_invoke().

◆ InstallerImpl_OpenProduct()

static HRESULT InstallerImpl_OpenProduct ( WORD  wFlags,
DISPPARAMS *  pDispParams,
VARIANT pVarResult,
EXCEPINFO *  pExcepInfo,
UINT puArgErr 
)
static

Definition at line 1763 of file automation.c.

1768 {
1769  HRESULT hr;
1770  VARIANTARG varg0;
1771 
1772  if (!(wFlags & DISPATCH_METHOD))
1773  return DISP_E_MEMBERNOTFOUND;
1774 
1775  VariantInit(&varg0);
1776  hr = DispGetParam(pDispParams, 0, VT_BSTR, &varg0, puArgErr);
1777  if (FAILED(hr))
1778  return hr;
1779 
1780  FIXME("%s\n", debugstr_w(V_BSTR(&varg0)));
1781 
1782  VariantInit(pVarResult);
1783 
1784  VariantClear(&varg0);
1785  return S_OK;
1786 }
HRESULT hr
Definition: shlfolder.c:183
HRESULT WINAPI DispGetParam(DISPPARAMS *pdispparams, UINT position, VARTYPE vtTarg, VARIANT *pvarResult, UINT *puArgErr)
Definition: dispatch.c:118
#define DISP_E_MEMBERNOTFOUND
Definition: winerror.h:2512
void WINAPI VariantInit(VARIANTARG *pVarg)
Definition: variant.c:571
#define DISPATCH_METHOD
Definition: oleauto.h:1006
#define debugstr_w
Definition: kernel32.h:32
#define FIXME(fmt,...)
Definition: debug.h:110
LONG HRESULT
Definition: typedefs.h:77
HRESULT WINAPI DECLSPEC_HOTPATCH VariantClear(VARIANTARG *pVarg)
Definition: variant.c:651
#define V_BSTR(A)
Definition: oleauto.h:226
_In_ DWORD _Out_ _In_ WORD wFlags
Definition: wincon.h:519
#define S_OK
Definition: intsafe.h:59

Referenced by installer_invoke().

◆ InstallerImpl_ProductInfo()

static HRESULT InstallerImpl_ProductInfo ( WORD  wFlags,
DISPPARAMS *  pDispParams,
VARIANT pVarResult,
EXCEPINFO *  pExcepInfo,
UINT puArgErr 
)
static

Definition at line 2235 of file automation.c.

2240 {
2241  UINT ret;
2242  HRESULT hr;
2243  DWORD size;
2244  LPWSTR str = NULL;
2245  VARIANTARG varg0, varg1;
2246 
2247  if (!(wFlags & DISPATCH_PROPERTYGET))
2248  return DISP_E_MEMBERNOTFOUND;
2249 
2250  VariantInit(&varg0);
2251  hr = DispGetParam(pDispParams, 0, VT_BSTR, &varg0, puArgErr);
2252  if (FAILED(hr))
2253  return hr;
2254 
2255  VariantInit(&varg1);
2256  hr = DispGetParam(pDispParams, 1, VT_BSTR, &varg1, puArgErr);
2257  if (FAILED(hr))
2258  goto done;
2259 
2260  V_VT(pVarResult) = VT_BSTR;
2261  V_BSTR(pVarResult) = NULL;
2262 
2263  ret = MsiGetProductInfoW(V_BSTR(&varg0), V_BSTR(&varg1), NULL, &size);
2264  if (ret != ERROR_SUCCESS)
2265  {
2266  hr = DISP_E_EXCEPTION;
2267  goto done;
2268  }
2269 
2270  str = msi_alloc(++size * sizeof(WCHAR));
2271  if (!str)
2272  {
2273  hr = E_OUTOFMEMORY;
2274  goto done;
2275  }
2276 
2277  ret = MsiGetProductInfoW(V_BSTR(&varg0), V_BSTR(&varg1), str, &size);
2278  if (ret != ERROR_SUCCESS)
2279  {
2280  hr = DISP_E_EXCEPTION;
2281  goto done;
2282  }
2283 
2284  V_BSTR(pVarResult) = SysAllocString(str);
2285  hr = S_OK;
2286 
2287 done:
2288  msi_free(str);
2289  VariantClear(&varg0);
2290  VariantClear(&varg1);
2291  return hr;
2292 }
#define DISP_E_EXCEPTION
Definition: winerror.h:2518
#define DISPATCH_PROPERTYGET
Definition: oleauto.h:1007
#define ERROR_SUCCESS
Definition: deptool.c:10
HRESULT hr
Definition: shlfolder.c:183
HRESULT WINAPI DispGetParam(DISPPARAMS *pdispparams, UINT position, VARTYPE vtTarg, VARIANT *pvarResult, UINT *puArgErr)
Definition: dispatch.c:118
#define DISP_E_MEMBERNOTFOUND
Definition: winerror.h:2512
void WINAPI VariantInit(VARIANTARG *pVarg)
Definition: variant.c:571
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
const WCHAR * str
smooth NULL
Definition: ftsmooth.c:416
BSTR WINAPI SysAllocString(LPCOLESTR str)
Definition: oleaut.c:241
GLsizeiptr size
Definition: glext.h:5919
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
UINT WINAPI MsiGetProductInfoW(LPCWSTR szProduct, LPCWSTR szAttribute, LPWSTR szBuffer, LPDWORD pcchValueBuf)
Definition: msi.c:1301
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
HRESULT WINAPI DECLSPEC_HOTPATCH VariantClear(VARIANTARG *pVarg)
Definition: variant.c:651
#define V_VT(A)
Definition: oleauto.h:211
#define V_BSTR(A)
Definition: oleauto.h:226
_In_ DWORD _Out_ _In_ WORD wFlags
Definition: wincon.h:519
#define S_OK
Definition: intsafe.h:59
unsigned int UINT
Definition: ndis.h:50
static BOOL msi_free(void *mem)
Definition: msipriv.h:1227
static void * msi_alloc(size_t len) __WINE_ALLOC_SIZE(1)
Definition: msipriv.h:1204
WCHAR * LPWSTR
Definition: xmlstorage.h:184

Referenced by installer_invoke().

◆ InstallerImpl_Products()

static HRESULT InstallerImpl_Products ( WORD  flags,
DISPPARAMS *  pDispParams,
VARIANT result,
EXCEPINFO *  pExcepInfo,
UINT puArgErr 
)
static

Definition at line 2294 of file automation.c.

2299 {
2301  HRESULT hr;
2302 
2303  if (!(flags & DISPATCH_PROPERTYGET))
2304  return DISP_E_MEMBERNOTFOUND;
2305 
2306  hr = create_list(NULL, &dispatch);
2307  if (FAILED(hr))
2308  return hr;
2309 
2310  V_VT(result) = VT_DISPATCH;
2312 
2313  return hr;
2314 }
#define DISPATCH_PROPERTYGET
Definition: oleauto.h:1007
HRESULT hr
Definition: shlfolder.c:183
#define DISP_E_MEMBERNOTFOUND
Definition: winerror.h:2512
#define V_DISPATCH(A)
Definition: oleauto.h:239
smooth NULL
Definition: ftsmooth.c:416
LONG HRESULT
Definition: typedefs.h:77
GLbitfield flags
Definition: glext.h:7161
#define V_VT(A)
Definition: oleauto.h:211
void dispatch(HANDLE hStopEvent)
Definition: dispatch.c:66
static HRESULT create_list(const WCHAR *product, IDispatch **dispatch)
Definition: automation.c:1118
GLuint64EXT * result
Definition: glext.h:11304

Referenced by installer_invoke().

◆ InstallerImpl_ProductState()

static HRESULT InstallerImpl_ProductState ( WORD  wFlags,
DISPPARAMS *  pDispParams,
VARIANT pVarResult,
EXCEPINFO *  pExcepInfo,
UINT puArgErr 
)
static

Definition at line 2211 of file automation.c.

2216 {
2217  HRESULT hr;
2218  VARIANTARG varg0;
2219 
2220  if (!(wFlags & DISPATCH_PROPERTYGET))
2221  return DISP_E_MEMBERNOTFOUND;
2222 
2223  VariantInit(&varg0);
2224  hr = DispGetParam(pDispParams, 0, VT_BSTR, &varg0, puArgErr);
2225  if (FAILED(hr))
2226  return hr;
2227 
2228  V_VT(pVarResult) = VT_I4;
2229  V_I4(pVarResult) = MsiQueryProductStateW(V_BSTR(&varg0));
2230 
2231  VariantClear(&varg0);
2232  return S_OK;
2233 }
Definition: compat.h:1947
#define DISPATCH_PROPERTYGET
Definition: oleauto.h:1007
HRESULT hr
Definition: shlfolder.c:183
HRESULT WINAPI DispGetParam(DISPPARAMS *pdispparams, UINT position, VARTYPE vtTarg, VARIANT *pvarResult, UINT *puArgErr)
Definition: dispatch.c:118
#define DISP_E_MEMBERNOTFOUND
Definition: winerror.h:2512
void WINAPI VariantInit(VARIANTARG *pVarg)
Definition: variant.c:571
#define V_I4(A)
Definition: oleauto.h:247
LONG HRESULT
Definition: typedefs.h:77
HRESULT WINAPI DECLSPEC_HOTPATCH VariantClear(VARIANTARG *pVarg)
Definition: variant.c:651
#define V_VT(A)
Definition: oleauto.h:211
#define V_BSTR(A)
Definition: oleauto.h:226
_In_ DWORD _Out_ _In_ WORD wFlags
Definition: wincon.h:519
#define S_OK
Definition: intsafe.h:59
INSTALLSTATE WINAPI MsiQueryProductStateW(LPCWSTR szProduct)
Definition: msi.c:2255

Referenced by installer_invoke().

◆ InstallerImpl_RegistryValue()

static HRESULT InstallerImpl_RegistryValue ( WORD  wFlags,
DISPPARAMS *  pDispParams,
VARIANT pVarResult,
EXCEPINFO *  pExcepInfo,
UINT puArgErr 
)
static

Definition at line 2002 of file automation.c.

2007 {
2008  UINT ret;
2009  HKEY hkey = NULL;
2010  HRESULT hr;
2011  UINT posValue;
2012  DWORD type, size;
2013  LPWSTR szString = NULL;
2014  VARIANTARG varg0, varg1, varg2;
2015 
2016  if (!(wFlags & DISPATCH_METHOD))
2017  return DISP_E_MEMBERNOTFOUND;
2018 
2019  VariantInit(&varg0);
2020  hr = DispGetParam(pDispParams, 0, VT_I4, &varg0, puArgErr);
2021  if (FAILED(hr))
2022  return hr;
2023 
2024  VariantInit(&varg1);
2025  hr = DispGetParam(pDispParams, 1, VT_BSTR, &varg1, puArgErr);
2026  if (FAILED(hr))
2027  goto done;
2028 
2029  /* Save valuePos so we can save puArgErr if we are unable to do our type
2030  * conversions.
2031  */
2032  posValue = 2;
2033  VariantInit(&varg2);
2034  hr = DispGetParam_CopyOnly(pDispParams, &posValue, &varg2);
2035  if (FAILED(hr))
2036  goto done;
2037 
2038  if (V_I4(&varg0) >= REG_INDEX_CLASSES_ROOT &&
2039  V_I4(&varg0) <= REG_INDEX_DYN_DATA)
2040  {
2041  V_I4(&varg0) |= (UINT_PTR)HKEY_CLASSES_ROOT;
2042  }
2043 
2044  ret = RegOpenKeyW((HKEY)(UINT_PTR)V_I4(&varg0), V_BSTR(&varg1), &hkey);
2045 
2046  /* Only VT_EMPTY case can do anything if the key doesn't exist. */
2047  if (ret != ERROR_SUCCESS && V_VT(&varg2) != VT_EMPTY)
2048  {
2049  hr = DISP_E_BADINDEX;
2050  goto done;
2051  }
2052 
2053  /* Third parameter can be VT_EMPTY, VT_I4, or VT_BSTR */
2054  switch (V_VT(&varg2))
2055  {
2056  /* Return VT_BOOL clarifying whether registry key exists or not. */
2057  case VT_EMPTY:
2058  V_VT(pVarResult) = VT_BOOL;
2059  V_BOOL(pVarResult) = (ret == ERROR_SUCCESS) ? VARIANT_TRUE : VARIANT_FALSE;
2060  break;
2061 
2062  /* Return the value of specified key if it exists. */
2063  case VT_BSTR:
2064  ret = RegQueryValueExW(hkey, V_BSTR(&varg2),
2065  NULL, NULL, NULL, &size);
2066  if (ret != ERROR_SUCCESS)
2067  {
2068  hr = DISP_E_BADINDEX;
2069  goto done;
2070  }
2071 
2072  szString = msi_alloc(size);
2073  if (!szString)
2074  {
2075  hr = E_OUTOFMEMORY;
2076  goto done;
2077  }
2078 
2079  ret = RegQueryValueExW(hkey, V_BSTR(&varg2), NULL,
2080  &type, (LPBYTE)szString, &size);
2081  if (ret != ERROR_SUCCESS)
2082  {
2083  msi_free(szString);
2084  hr = DISP_E_BADINDEX;
2085  goto done;
2086  }
2087 
2088  variant_from_registry_value(pVarResult, type,
2089  (LPBYTE)szString, size);
2090  msi_free(szString);
2091  break;
2092 
2093  /* Try to make it into VT_I4, can use VariantChangeType for this. */
2094  default:
2095  hr = VariantChangeType(&varg2, &varg2, 0, VT_I4);
2096  if (FAILED(hr))
2097  {
2098  if (hr == DISP_E_TYPEMISMATCH)
2099  *puArgErr = posValue;
2100 
2101  goto done;
2102  }
2103 
2104  /* Retrieve class name or maximum value name or subkey name size. */
2105  if (!V_I4(&varg2))
2106  ret = RegQueryInfoKeyW(hkey, NULL, &size, NULL, NULL, NULL,
2107  NULL, NULL, NULL, NULL, NULL, NULL);
2108  else if (V_I4(&varg2) > 0)
2109  ret = RegQueryInfoKeyW(hkey, NULL, NULL, NULL, NULL, NULL,
2110  NULL, NULL, &size, NULL, NULL, NULL);
2111  else /* V_I4(&varg2) < 0 */
2112  ret = RegQueryInfoKeyW(hkey, NULL, NULL, NULL, NULL, &size,
2113  NULL, NULL, NULL, NULL, NULL, NULL);
2114 
2115  if (ret != ERROR_SUCCESS)
2116  goto done;
2117 
2118  szString = msi_alloc(++size * sizeof(WCHAR));
2119  if (!szString)
2120  {
2121  hr = E_OUTOFMEMORY;
2122  goto done;
2123  }
2124 
2125  if (!V_I4(&varg2))
2126  ret = RegQueryInfoKeyW(hkey, szString, &size,NULL, NULL, NULL,
2127  NULL, NULL, NULL, NULL, NULL, NULL);
2128  else if (V_I4(&varg2) > 0)
2129  ret = RegEnumValueW(hkey, V_I4(&varg2)-1, szString,
2130  &size, 0, 0, NULL, NULL);
2131  else /* V_I4(&varg2) < 0 */
2132  ret = RegEnumKeyW(hkey, -1 - V_I4(&varg2), szString, size);
2133 
2134  if (ret == ERROR_SUCCESS)
2135  {
2136  V_VT(pVarResult) = VT_BSTR;
2137  V_BSTR(pVarResult) = SysAllocString(szString);
2138  }
2139 
2140  msi_free(szString);
2141  }
2142 
2143 done:
2144  VariantClear(&varg0);
2145  VariantClear(&varg1);
2146  VariantClear(&varg2);
2147  RegCloseKey(hkey);
2148  return hr;
2149 }
unsigned __int3264 UINT_PTR
Definition: activex.cpp:275
HRESULT WINAPI DECLSPEC_HOTPATCH VariantChangeType(VARIANTARG *pvargDest, VARIANTARG *pvargSrc, USHORT wFlags, VARTYPE vt)
Definition: variant.c:965
Definition: compat.h:1947
#define ERROR_SUCCESS
Definition: deptool.c:10
HRESULT hr
Definition: shlfolder.c:183
static void variant_from_registry_value(VARIANT *pVarResult, DWORD dwType, LPBYTE lpData, DWORD dwSize)
Definition: automation.c:1615
HRESULT WINAPI DispGetParam(DISPPARAMS *pdispparams, UINT position, VARTYPE vtTarg, VARIANT *pvarResult, UINT *puArgErr)
Definition: dispatch.c:118
#define DISP_E_MEMBERNOTFOUND
Definition: winerror.h:2512
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
void WINAPI VariantInit(VARIANTARG *pVarg)
Definition: variant.c:571
#define V_I4(A)
Definition: oleauto.h:247
#define DISPATCH_METHOD
Definition: oleauto.h:1006
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
unsigned char * LPBYTE
Definition: typedefs.h:52
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
LONG WINAPI RegOpenKeyW(HKEY hKey, LPCWSTR lpSubKey, PHKEY phkResult)
Definition: reg.c:3296
LONG WINAPI RegEnumValueW(_In_ HKEY hKey, _In_ DWORD index, _Out_ LPWSTR value, _Inout_ PDWORD val_count, _Reserved_ PDWORD reserved, _Out_opt_ PDWORD type, _Out_opt_ LPBYTE data, _Inout_opt_ PDWORD count)
Definition: reg.c:2853
smooth NULL
Definition: ftsmooth.c:416
BSTR WINAPI SysAllocString(LPCOLESTR str)
Definition: oleaut.c:241
#define DISP_E_TYPEMISMATCH
Definition: winerror.h:2514
GLsizeiptr size
Definition: glext.h:5919
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4116
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
#define V_BOOL(A)
Definition: oleauto.h:224
unsigned long DWORD
Definition: ntddk_ex.h:95
unsigned __int3264 UINT_PTR
Definition: mstsclib_h.h:274
LONG WINAPI RegQueryInfoKeyW(HKEY hKey, LPWSTR lpClass, LPDWORD lpcClass, LPDWORD lpReserved, LPDWORD lpcSubKeys, LPDWORD lpcMaxSubKeyLen, LPDWORD lpcMaxClassLen, LPDWORD lpcValues, LPDWORD lpcMaxValueNameLen, LPDWORD lpcMaxValueLen, LPDWORD lpcbSecurityDescriptor, PFILETIME lpftLastWriteTime)
Definition: reg.c:3686
int ret
HRESULT WINAPI DECLSPEC_HOTPATCH VariantClear(VARIANTARG *pVarg)
Definition: variant.c:651
#define V_VT(A)
Definition: oleauto.h:211
#define V_BSTR(A)
Definition: oleauto.h:226
LONG WINAPI RegEnumKeyW(HKEY hKey, DWORD dwIndex, LPWSTR lpName, DWORD cbName)
Definition: reg.c:2416
#define REG_INDEX_DYN_DATA
Definition: automation.c:43
static HRESULT DispGetParam_CopyOnly(DISPPARAMS *pdispparams, UINT *position, VARIANT *pvarResult)
Definition: automation.c:734
_In_ DWORD _Out_ _In_ WORD wFlags
Definition: wincon.h:519
unsigned int UINT
Definition: ndis.h:50
static BOOL msi_free(void *mem)
Definition: msipriv.h:1227
static void * msi_alloc(size_t len) __WINE_ALLOC_SIZE(1)
Definition: msipriv.h:1204
#define HKEY_CLASSES_ROOT
Definition: winreg.h:10
#define DISP_E_BADINDEX
Definition: winerror.h:2520
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define REG_INDEX_CLASSES_ROOT
Definition: automation.c:42

Referenced by installer_invoke().

◆ InstallerImpl_RelatedProducts()

static HRESULT InstallerImpl_RelatedProducts ( WORD  flags,
DISPPARAMS *  pDispParams,
VARIANT result,
EXCEPINFO *  pExcepInfo,
UINT puArgErr 
)
static

Definition at line 2316 of file automation.c.

2321 {
2323  VARIANTARG related;
2324  HRESULT hr;
2325 
2326  if (!(flags & DISPATCH_PROPERTYGET))
2327  return DISP_E_MEMBERNOTFOUND;
2328 
2329  VariantInit(&related);
2330  hr = DispGetParam(pDispParams, 0, VT_BSTR, &related, puArgErr);
2331  if (FAILED(hr))
2332  return hr;
2333 
2334  hr = create_list(V_BSTR(&related), &dispatch);
2335  VariantClear(&related);
2336 
2337  V_VT(result) = VT_DISPATCH;
2339 
2340  return hr;
2341 }
#define DISPATCH_PROPERTYGET
Definition: oleauto.h:1007
HRESULT hr
Definition: shlfolder.c:183
HRESULT WINAPI DispGetParam(DISPPARAMS *pdispparams, UINT position, VARTYPE vtTarg, VARIANT *pvarResult, UINT *puArgErr)
Definition: dispatch.c:118
#define DISP_E_MEMBERNOTFOUND
Definition: winerror.h:2512
void WINAPI VariantInit(VARIANTARG *pVarg)
Definition: variant.c:571
#define V_DISPATCH(A)
Definition: oleauto.h:239
LONG HRESULT
Definition: typedefs.h:77
GLbitfield flags
Definition: glext.h:7161
HRESULT WINAPI DECLSPEC_HOTPATCH VariantClear(VARIANTARG *pVarg)
Definition: variant.c:651
#define V_VT(A)
Definition: oleauto.h:211
void dispatch(HANDLE hStopEvent)
Definition: dispatch.c:66
#define V_BSTR(A)
Definition: oleauto.h:226
static HRESULT create_list(const WCHAR *product, IDispatch **dispatch)
Definition: automation.c:1118
GLuint64EXT * result
Definition: glext.h:11304

Referenced by installer_invoke().

◆ InstallerImpl_SummaryInformation()

static HRESULT InstallerImpl_SummaryInformation ( WORD  wFlags,
DISPPARAMS *  pDispParams,
VARIANT pVarResult,
EXCEPINFO *  pExcepInfo,
UINT puArgErr 
)
static

Definition at line 1832 of file automation.c.

1837 {
1838  UINT ret;
1839  HRESULT hr;
1840  MSIHANDLE hsuminfo;
1842  VARIANTARG varg0, varg1;
1843 
1844  if (!(wFlags & DISPATCH_PROPERTYGET))
1845  return DISP_E_MEMBERNOTFOUND;
1846 
1847  VariantInit(&varg1);
1848  hr = DispGetParam(pDispParams, 1, VT_I4, &varg1, puArgErr);
1849  if (FAILED(hr))
1850  return hr;
1851 
1852  VariantInit(&varg0);
1853  hr = DispGetParam(pDispParams, 0, VT_BSTR, &varg0, puArgErr);
1854  if (FAILED(hr))
1855  return hr;
1856 
1857  ret = MsiGetSummaryInformationW(0, V_BSTR(&varg0), V_I4(&varg1), &hsuminfo);
1858  VariantClear(&varg0);
1859  if (ret != ERROR_SUCCESS)
1860  return DISP_E_EXCEPTION;
1861 
1862  hr = create_summaryinfo(hsuminfo, &dispatch);
1863  if (FAILED(hr))
1864  return hr;
1865 
1866  V_VT(pVarResult) = VT_DISPATCH;
1867  V_DISPATCH(pVarResult) = dispatch;
1868  return S_OK;
1869 }
#define DISP_E_EXCEPTION
Definition: winerror.h:2518
Definition: compat.h:1947
#define DISPATCH_PROPERTYGET
Definition: oleauto.h:1007
#define ERROR_SUCCESS
Definition: deptool.c:10
HRESULT hr
Definition: shlfolder.c:183
HRESULT WINAPI DispGetParam(DISPPARAMS *pdispparams, UINT position, VARTYPE vtTarg, VARIANT *pvarResult, UINT *puArgErr)
Definition: dispatch.c:118
#define DISP_E_MEMBERNOTFOUND
Definition: winerror.h:2512
UINT WINAPI MsiGetSummaryInformationW(MSIHANDLE hDatabase, LPCWSTR szDatabase, UINT uiUpdateCount, MSIHANDLE *pHandle)
Definition: suminfo.c:514
void WINAPI VariantInit(VARIANTARG *pVarg)
Definition: variant.c:571
unsigned long MSIHANDLE
Definition: msiserver.idl:25
#define V_I4(A)
Definition: oleauto.h:247
#define V_DISPATCH(A)
Definition: oleauto.h:239
LONG HRESULT
Definition: typedefs.h:77
int ret
HRESULT WINAPI DECLSPEC_HOTPATCH VariantClear(VARIANTARG *pVarg)
Definition: variant.c:651
#define V_VT(A)
Definition: oleauto.h:211
void dispatch(HANDLE hStopEvent)
Definition: dispatch.c:66
#define V_BSTR(A)
Definition: oleauto.h:226
_In_ DWORD _Out_ _In_ WORD wFlags
Definition: wincon.h:519
#define S_OK
Definition: intsafe.h:59
unsigned int UINT
Definition: ndis.h:50
static HRESULT create_summaryinfo(MSIHANDLE, IDispatch **)
Definition: automation.c:2533

Referenced by installer_invoke().

◆ InstallerImpl_UILevel()

static HRESULT InstallerImpl_UILevel ( WORD  wFlags,
DISPPARAMS *  pDispParams,
VARIANT pVarResult,
EXCEPINFO *  pExcepInfo,
UINT puArgErr 
)
static

Definition at line 1871 of file automation.c.

1876 {
1877  HRESULT hr;
1878  VARIANTARG varg0;
1880 
1882  return DISP_E_MEMBERNOTFOUND;
1883 
1885  {
1886  VariantInit(&varg0);
1887  hr = DispGetParam(pDispParams, 0, VT_I4, &varg0, puArgErr);
1888  if (FAILED(hr))
1889  return hr;
1890 
1891  ui = MsiSetInternalUI(V_I4(&varg0), NULL);
1892  if (ui == INSTALLUILEVEL_NOCHANGE)
1893  return DISP_E_EXCEPTION;
1894  }
1895  else if (wFlags & DISPATCH_PROPERTYGET)
1896  {
1898  if (ui == INSTALLUILEVEL_NOCHANGE)
1899  return DISP_E_EXCEPTION;
1900 
1901  V_VT(pVarResult) = VT_I4;
1902  V_I4(pVarResult) = ui;
1903  }
1904 
1905  return S_OK;
1906 }
#define DISP_E_EXCEPTION
Definition: winerror.h:2518
Definition: compat.h:1947
#define DISPATCH_PROPERTYGET
Definition: oleauto.h:1007
HRESULT hr
Definition: shlfolder.c:183
enum tagINSTALLUILEVEL INSTALLUILEVEL
HRESULT WINAPI DispGetParam(DISPPARAMS *pdispparams, UINT position, VARTYPE vtTarg, VARIANT *pvarResult, UINT *puArgErr)
Definition: dispatch.c:118
UINT ui
Definition: oleauto.h:49
#define DISP_E_MEMBERNOTFOUND
Definition: winerror.h:2512
INSTALLUILEVEL WINAPI MsiSetInternalUI(INSTALLUILEVEL dwUILevel, HWND *phWnd)
Definition: msi.c:2313
void WINAPI VariantInit(VARIANTARG *pVarg)
Definition: variant.c:571
#define V_I4(A)
Definition: oleauto.h:247
smooth NULL
Definition: ftsmooth.c:416
#define DISPATCH_PROPERTYPUT
Definition: oleauto.h:1008
LONG HRESULT
Definition: typedefs.h:77
#define V_VT(A)
Definition: oleauto.h:211
_In_ DWORD _Out_ _In_ WORD wFlags
Definition: wincon.h:519
#define S_OK
Definition: intsafe.h:59

Referenced by installer_invoke().

◆ InstallerImpl_Version()

static HRESULT InstallerImpl_Version ( WORD  wFlags,
VARIANT pVarResult,
EXCEPINFO *  pExcepInfo,
UINT puArgErr 
)
static

Definition at line 1959 of file automation.c.

1963 {
1964  HRESULT hr;
1965  DLLVERSIONINFO verinfo;
1967 
1968  static const WCHAR format[] = {
1969  '%','d','.','%','d','.','%','d','.','%','d',0};
1970 
1971  if (!(wFlags & DISPATCH_PROPERTYGET))
1972  return DISP_E_MEMBERNOTFOUND;
1973 
1974  verinfo.cbSize = sizeof(DLLVERSIONINFO);
1975  hr = DllGetVersion(&verinfo);
1976  if (FAILED(hr))
1977  return hr;
1978 
1980  verinfo.dwBuildNumber, verinfo.dwPlatformID);
1981 
1982  V_VT(pVarResult) = VT_BSTR;
1983  V_BSTR(pVarResult) = SysAllocString(version);
1984  return S_OK;
1985 }
DWORD dwMinorVersion
Definition: shlwapi.h:1956
#define DISPATCH_PROPERTYGET
Definition: oleauto.h:1007
HRESULT hr
Definition: shlfolder.c:183
#define DISP_E_MEMBERNOTFOUND
Definition: winerror.h:2512
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: gl.h:1546
STDAPI DllGetVersion(DLLVERSIONINFO *info)
Definition: browseui.cpp:218
DWORD dwBuildNumber
Definition: shlwapi.h:1957
DWORD dwMajorVersion
Definition: shlwapi.h:1955
static const WCHAR version[]
Definition: asmname.c:66
BSTR WINAPI SysAllocString(LPCOLESTR str)
Definition: oleaut.c:241
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
#define MAX_PATH
Definition: compat.h:26
#define V_VT(A)
Definition: oleauto.h:211
DWORD dwPlatformID
Definition: shlwapi.h:1958
#define V_BSTR(A)
Definition: oleauto.h:226
_In_ DWORD _Out_ _In_ WORD wFlags
Definition: wincon.h:519
#define S_OK
Definition: intsafe.h:59
#define sprintfW
Definition: unicode.h:58
struct _DllVersionInfo DLLVERSIONINFO

Referenced by installer_invoke().

◆ list_free()

static void list_free ( AutomationObject This)
static

Definition at line 1080 of file automation.c.

1081 {
1083  int i;
1084 
1085  for (i = 0; i < list->count; i++)
1086  VariantClear(&list->data[i]);
1087  msi_free(list->data);
1088 }
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
HRESULT WINAPI DECLSPEC_HOTPATCH VariantClear(VARIANTARG *pVarg)
Definition: variant.c:651
Definition: _list.h:228
static BOOL msi_free(void *mem)
Definition: msipriv.h:1227

◆ list_invoke()

static HRESULT list_invoke ( AutomationObject This,
DISPID  dispIdMember,
REFIID  riid,
LCID  lcid,
WORD  wFlags,
DISPPARAMS *  pDispParams,
VARIANT pVarResult,
EXCEPINFO *  pExcepInfo,
UINT puArgErr 
)
static

Definition at line 1023 of file automation.c.

1033 {
1035  IUnknown *pUnk = NULL;
1036  HRESULT hr;
1037 
1038  switch (dispIdMember)
1039  {
1040  case DISPID_LIST__NEWENUM:
1041  if (wFlags & DISPATCH_METHOD) {
1042  V_VT(pVarResult) = VT_UNKNOWN;
1044  V_UNKNOWN(pVarResult) = pUnk;
1045  else
1046  ERR("Failed to create IEnumVARIANT object, hresult 0x%08x\n", hr);
1047  }
1048  else return DISP_E_MEMBERNOTFOUND;
1049  break;
1050 
1051  case DISPID_LIST_ITEM:
1052  if (wFlags & DISPATCH_PROPERTYGET) {
1053  VARIANTARG index;
1054 
1055  VariantInit(&index);
1056  hr = DispGetParam(pDispParams, 0, VT_I4, &index, puArgErr);
1057  if (FAILED(hr)) return hr;
1058  if (V_I4(&index) < 0 || V_I4(&index) >= list->count)
1059  return DISP_E_BADINDEX;
1060  VariantCopy(pVarResult, &list->data[V_I4(&index)]);
1061  }
1062  else return DISP_E_MEMBERNOTFOUND;
1063  break;
1064 
1065  case DISPID_LIST_COUNT:
1066  if (wFlags & DISPATCH_PROPERTYGET) {
1067  V_VT(pVarResult) = VT_I4;
1068  V_I4(pVarResult) = list->count;
1069  }
1070  else return DISP_E_MEMBERNOTFOUND;
1071  break;
1072 
1073  default:
1074  return DISP_E_MEMBERNOTFOUND;
1075  }
1076 
1077  return S_OK;
1078 }
Definition: compat.h:1947
#define DISPATCH_PROPERTYGET
Definition: oleauto.h:1007
HRESULT hr
Definition: shlfolder.c:183
HRESULT WINAPI DispGetParam(DISPPARAMS *pdispparams, UINT position, VARTYPE vtTarg, VARIANT *pvarResult, UINT *puArgErr)
Definition: dispatch.c:118
#define DISPID_LIST_ITEM
#define DISP_E_MEMBERNOTFOUND
Definition: winerror.h:2512
#define DISPID_LIST__NEWENUM
void WINAPI VariantInit(VARIANTARG *pVarg)
Definition: variant.c:571
#define DISPID_LIST_COUNT
#define V_I4(A)
Definition: oleauto.h:247
#define DISPATCH_METHOD
Definition: oleauto.h:1006
static HRESULT create_list_enumerator(ListObject *, void **)
Definition: automation.c:706
smooth NULL
Definition: ftsmooth.c:416
GLuint index
Definition: glext.h:6031
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
LONG HRESULT
Definition: typedefs.h:77
#define index(s, c)
Definition: various.h:29
#define V_VT(A)
Definition: oleauto.h:211
Definition: _list.h:228
#define V_UNKNOWN(A)
Definition: oleauto.h:281
_In_ DWORD _Out_ _In_ WORD wFlags
Definition: wincon.h:519
#define ERR(fmt,...)
Definition: debug.h:109
#define S_OK
Definition: intsafe.h:59
#define DISP_E_BADINDEX
Definition: winerror.h:2520
HRESULT WINAPI VariantCopy(VARIANTARG *pvargDest, VARIANTARG *pvargSrc)
Definition: variant.c:751
static void *static void *static LPDIRECTPLAY IUnknown * pUnk
Definition: dplayx.c:30
#define SUCCEEDED(hr)
Definition: intsafe.h:57

◆ ListEnumerator_AddRef()

static ULONG WINAPI ListEnumerator_AddRef ( IEnumVARIANT iface)
static

Definition at line 597 of file automation.c.

598 {
600 
601  TRACE("(%p/%p)\n", iface, This);
602 
603  return InterlockedIncrement(&This->ref);
604 }
#define TRACE(s)
Definition: solgame.cpp:4
#define InterlockedIncrement
Definition: armddk.h:53
static ListEnumerator * impl_from_IEnumVARIANT(IEnumVARIANT *iface)
Definition: automation.c:565

◆ ListEnumerator_Clone()

static HRESULT WINAPI ListEnumerator_Clone ( IEnumVARIANT iface,
IEnumVARIANT **  ppEnum 
)
static

Definition at line 673 of file automation.c.

674 {
676  HRESULT hr;
677 
678  TRACE("(%p,%p)\n", iface, ppEnum);
679 
680  if (ppEnum == NULL)
681  return S_FALSE;
682 
683  *ppEnum = NULL;
684  hr = create_list_enumerator(This->list, (LPVOID *)ppEnum);
685  if (FAILED(hr))
686  {
687  if (*ppEnum) IEnumVARIANT_Release(*ppEnum);
688  return hr;
689  }
690 
691  return S_OK;
692 }
HRESULT hr
Definition: shlfolder.c:183
static HRESULT create_list_enumerator(ListObject *, void **)
Definition: automation.c:706
#define S_FALSE
Definition: winerror.h:2357
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
#define S_OK
Definition: intsafe.h:59
static ListEnumerator * impl_from_IEnumVARIANT(IEnumVARIANT *iface)
Definition: automation.c:565

◆ ListEnumerator_Next()

static HRESULT WINAPI ListEnumerator_Next ( IEnumVARIANT iface,
ULONG  celt,
VARIANT rgVar,
ULONG fetched 
)
static

Definition at line 622 of file automation.c.

624 {
626  ULONG i, local;
627 
628  TRACE("(%p, %uld, %p, %p)\n", iface, celt, rgVar, fetched);
629 
630  if (fetched) *fetched = 0;
631 
632  if (!rgVar)
633  return S_FALSE;
634 
635  for (local = 0; local < celt; local++)
636  VariantInit(&rgVar[local]);
637 
638  for (i = This->pos, local = 0; i < This->list->count && local < celt; i++, local++)
639  VariantCopy(&rgVar[local], &This->list->data[i]);
640 
641  if (fetched) *fetched = local;
642  This->pos = i;
643 
644  return (local < celt) ? S_FALSE : S_OK;
645 }
void WINAPI VariantInit(VARIANTARG *pVarg)
Definition: variant.c:571
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define S_FALSE
Definition: winerror.h:2357
#define TRACE(s)
Definition: solgame.cpp:4
Definition: _list.h:228
#define local
Definition: zutil.h:30
#define S_OK
Definition: intsafe.h:59
unsigned int ULONG
Definition: retypes.h:1
static ListEnumerator * impl_from_IEnumVARIANT(IEnumVARIANT *iface)
Definition: automation.c:565
HRESULT WINAPI VariantCopy(VARIANTARG *pvargDest, VARIANTARG *pvargSrc)
Definition: variant.c:751

◆ ListEnumerator_QueryInterface()

static HRESULT WINAPI ListEnumerator_QueryInterface ( IEnumVARIANT iface,
REFIID  riid,
void **  ppvObject 
)
static

Definition at line 570 of file automation.c.

572 {
574 
575  TRACE("(%p/%p)->(%s,%p)\n", iface, This, debugstr_guid(riid), ppvObject);
576 
577  if (ppvObject == NULL)
578  return E_INVALIDARG;
579 
580  *ppvObject = 0;
581 
582  if (IsEqualGUID(riid, &IID_IUnknown) ||
583  IsEqualGUID(riid, &IID_IEnumVARIANT))
584  {
585  *ppvObject = &This->IEnumVARIANT_iface;
586  }
587  else
588  {
589  TRACE("() : asking for unsupported interface %s\n",debugstr_guid(riid));
590  return E_NOINTERFACE;
591  }
592 
593  IEnumVARIANT_AddRef(iface);
594  return S_OK;
595 }
#define E_NOINTERFACE
Definition: winerror.h:2364
REFIID riid
Definition: precomp.h:44
#define E_INVALIDARG
Definition: ddrawi.h:101
smooth NULL
Definition: ftsmooth.c:416
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
const GUID IID_IUnknown
REFIID LPVOID * ppvObject
Definition: precomp.h:44
#define S_OK
Definition: intsafe.h:59
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112
static ListEnumerator * impl_from_IEnumVARIANT(IEnumVARIANT *iface)
Definition: automation.c:565

◆ ListEnumerator_Release()

static ULONG WINAPI ListEnumerator_Release ( IEnumVARIANT iface)
static

Definition at line 606 of file automation.c.

607 {
610 
611  TRACE("(%p/%p)\n", iface, This);
612 
613  if (!ref)
614  {
615  if (This->list) IDispatch_Release(&This->list->autoobj.IDispatch_iface);
616  msi_free(This);
617  }
618 
619  return ref;
620 }
Definition: send.c:47
GLenum GLint ref
Definition: glext.h:6028
#define TRACE(s)
Definition: solgame.cpp:4
#define InterlockedDecrement
Definition: armddk.h:52
static BOOL msi_free(void *mem)
Definition: msipriv.h:1227
unsigned int ULONG
Definition: retypes.h:1
static ListEnumerator * impl_from_IEnumVARIANT(IEnumVARIANT *iface)
Definition: automation.c:565

◆ ListEnumerator_Reset()

static HRESULT WINAPI ListEnumerator_Reset ( IEnumVARIANT iface)
static

Definition at line 663 of file automation.c.

664 {
666 
667  TRACE("(%p)\n", iface);
668 
669  This->pos = 0;
670  return S_OK;
671 }
#define TRACE(s)
Definition: solgame.cpp:4
#define S_OK
Definition: intsafe.h:59
static ListEnumerator * impl_from_IEnumVARIANT(IEnumVARIANT *iface)
Definition: automation.c:565

◆ ListEnumerator_Skip()

static HRESULT WINAPI ListEnumerator_Skip ( IEnumVARIANT iface,
ULONG  celt 
)
static

Definition at line 647 of file automation.c.

648 {
650 
651  TRACE("(%p,%uld)\n", iface, celt);
652 
653  This->pos += celt;
654  if (This->pos >= This->list->count)
655  {
656  This->pos = This->list->count;
657  return S_FALSE;
658  }
659 
660  return S_OK;
661 }
#define S_FALSE
Definition: winerror.h:2357
#define TRACE(s)
Definition: solgame.cpp:4
#define S_OK
Definition: intsafe.h:59
static ListEnumerator * impl_from_IEnumVARIANT(IEnumVARIANT *iface)
Definition: automation.c:565

◆ ProvideMultipleClassInfo_AddRef()

static ULONG WINAPI ProvideMultipleClassInfo_AddRef ( IProvideMultipleClassInfo iface)
static

Definition at line 448 of file automation.c.

449 {
451  return IDispatch_AddRef(&This->IDispatch_iface);
452 }
static AutomationObject * impl_from_IProvideMultipleClassInfo(IProvideMultipleClassInfo *iface)
Definition: automation.c:183

◆ ProvideMultipleClassInfo_GetClassInfo()

static HRESULT WINAPI ProvideMultipleClassInfo_GetClassInfo ( IProvideMultipleClassInfo iface,
ITypeInfo **  ppTI 
)
static

Definition at line 460 of file automation.c.

461 {
463  HRESULT hr;
464 
465  TRACE("(%p/%p)->(%p)\n", iface, This, ppTI);
466 
467  hr = get_typeinfo(This->tid, ppTI);
468  if (SUCCEEDED(hr))
469  ITypeInfo_AddRef(*ppTI);
470 
471  return hr;
472 }
HRESULT hr
Definition: shlfolder.c:183
HRESULT get_typeinfo(tid_t tid, ITypeInfo **typeinfo)
Definition: automation.c:89
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
static AutomationObject * impl_from_IProvideMultipleClassInfo(IProvideMultipleClassInfo *iface)
Definition: automation.c:183
#define SUCCEEDED(hr)
Definition: intsafe.h:57

◆ ProvideMultipleClassInfo_GetGUID()

static HRESULT WINAPI ProvideMultipleClassInfo_GetGUID ( IProvideMultipleClassInfo iface,
DWORD  dwGuidKind,
GUID pGUID 
)
static

Definition at line 474 of file automation.c.

475 {
477  TRACE("(%p/%p)->(%d,%s)\n", iface, This, dwGuidKind, debugstr_guid(pGUID));
478 
479  if (dwGuidKind != GUIDKIND_DEFAULT_SOURCE_DISP_IID)
480  return E_INVALIDARG;
481  else {
482  *pGUID = *get_riid_from_tid(This->tid);
483  return S_OK;
484  }
485 }
static const IID * get_riid_from_tid(tid_t tid)
Definition: automation.c:84
#define E_INVALIDARG
Definition: ddrawi.h:101
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
#define S_OK
Definition: intsafe.h:59
static AutomationObject * impl_from_IProvideMultipleClassInfo(IProvideMultipleClassInfo *iface)
Definition: automation.c:183

◆ ProvideMultipleClassInfo_GetInfoOfIndex()

static HRESULT WINAPI ProvideMultipleClassInfo_GetInfoOfIndex ( IProvideMultipleClassInfo iface,
ULONG  iti,
DWORD  dwFlags,
ITypeInfo **  ti,
DWORD pdwTIFlags,
ULONG pcdispidReserved,
IID piidPrimary,
IID piidSource 
)
static

Definition at line 496 of file automation.c.

504 {
506 
507  TRACE("(%p/%p)->(%d,%d,%p,%p,%p,%p,%p)\n", iface, This, iti, dwFlags, ti, pdwTIFlags, pcdispidReserved, piidPrimary, piidSource);
508 
509  if (iti != 0)
510  return E_INVALIDARG;
511 
512  if (dwFlags & MULTICLASSINFO_GETTYPEINFO)
513  {
514  HRESULT hr = get_typeinfo(This->tid, ti);
515  if (FAILED(hr))
516  return hr;
517 
518  ITypeInfo_AddRef(*ti);
519  }
520 
521  if (dwFlags & MULTICLASSINFO_GETNUMRESERVEDDISPIDS)
522  {
523  *pdwTIFlags = 0;
524  *pcdispidReserved = 0;
525  }
526 
527  if (dwFlags & MULTICLASSINFO_GETIIDPRIMARY)
528  *piidPrimary = *get_riid_from_tid(This->tid);
529 
530  if (dwFlags & MULTICLASSINFO_GETIIDSOURCE)
531  *piidSource = *get_riid_from_tid(This->tid);
532 
533  return S_OK;
534 }
HRESULT hr
Definition: shlfolder.c:183
static const IID * get_riid_from_tid(tid_t tid)
Definition: automation.c:84
#define E_INVALIDARG
Definition: ddrawi.h:101
HRESULT get_typeinfo(tid_t tid, ITypeInfo **typeinfo)
Definition: automation.c:89
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
#define S_OK
Definition: intsafe.h:59
static AutomationObject * impl_from_IProvideMultipleClassInfo(IProvideMultipleClassInfo *iface)
Definition: automation.c:183

◆ ProvideMultipleClassInfo_GetMultiTypeInfoCount()

static HRESULT WINAPI ProvideMultipleClassInfo_GetMultiTypeInfoCount ( IProvideMultipleClassInfo iface,
ULONG pcti 
)
static

Definition at line 487 of file automation.c.

488 {
490 
491  TRACE("(%p/%p)->(%p)\n", iface, This, pcti);
492  *pcti = 1;
493  return S_OK;
494 }
#define TRACE(s)
Definition: solgame.cpp:4
#define S_OK
Definition: intsafe.h:59
static AutomationObject * impl_from_IProvideMultipleClassInfo(IProvideMultipleClassInfo *iface)
Definition: automation.c:183

◆ ProvideMultipleClassInfo_QueryInterface()

static HRESULT WINAPI ProvideMultipleClassInfo_QueryInterface ( IProvideMultipleClassInfo iface,
REFIID  riid,
VOID **  ppvoid 
)
static

Definition at line 439 of file automation.c.

443 {
445  return IDispatch_QueryInterface(&This->IDispatch_iface, riid, ppvoid);
446 }
REFIID riid
Definition: precomp.h:44
static AutomationObject * impl_from_IProvideMultipleClassInfo(IProvideMultipleClassInfo *iface)
Definition: automation.c:183

◆ ProvideMultipleClassInfo_Release()

static ULONG WINAPI ProvideMultipleClassInfo_Release ( IProvideMultipleClassInfo iface)
static

Definition at line 454 of file automation.c.

455 {
457  return IDispatch_Release(&This->IDispatch_iface);
458 }
static AutomationObject * impl_from_IProvideMultipleClassInfo(IProvideMultipleClassInfo *iface)
Definition: automation.c:183

◆ record_invoke()

static HRESULT record_invoke ( AutomationObject This,
DISPID  dispIdMember,
REFIID  riid,
LCID  lcid,
WORD  wFlags,
DISPPARAMS *  pDispParams,
VARIANT pVarResult,
EXCEPINFO *  pExcepInfo,
UINT puArgErr 
)
static

Definition at line 912 of file automation.c.

922 {
923  WCHAR *szString;
924  DWORD dwLen = 0;
925  UINT ret;
926  VARIANTARG varg0, varg1;
927  HRESULT hr;
928 
929  VariantInit(&varg0);
930  VariantInit(&varg1);
931 
932  switch (dispIdMember)
933  {
936  V_VT(pVarResult) = VT_I4;
937  V_I4(pVarResult) = MsiRecordGetFieldCount(This->msiHandle);
938  }
939  else return DISP_E_MEMBERNOTFOUND;
940  break;
941 
944  hr = DispGetParam(pDispParams, 0, VT_I4, &varg0, puArgErr);
945  if (FAILED(hr)) return hr;
946  V_VT(pVarResult) = VT_BSTR;
947  V_BSTR(pVarResult) = NULL;
948  if ((ret = MsiRecordGetStringW(This->msiHandle, V_I4(&varg0), NULL, &dwLen)) == ERROR_SUCCESS)
949  {
950  if (!(szString = msi_alloc((++dwLen)*sizeof(WCHAR))))
951  ERR("Out of memory\n");
952  else if ((ret = MsiRecordGetStringW(This->msiHandle, V_I4(&varg0), szString, &dwLen)) == ERROR_SUCCESS)
953  V_BSTR(pVarResult) = SysAllocString(szString);
954  msi_free(szString);
955  }
956  if (ret != ERROR_SUCCESS)
957  ERR("MsiRecordGetString returned %d\n", ret);
958  } else if (wFlags & DISPATCH_PROPERTYPUT) {
959  hr = DispGetParam(pDispParams, 0, VT_I4, &varg0, puArgErr);
960  if (FAILED(hr)) return hr;
961  hr = DispGetParam(pDispParams, 1, VT_BSTR, &varg1, puArgErr);
962  if (FAILED(hr)) return hr;
963  if ((ret = MsiRecordSetStringW(This->msiHandle, V_I4(&varg0), V_BSTR(&varg1))) != ERROR_SUCCESS)
964  {
965  VariantClear(&varg1);
966  ERR("MsiRecordSetString returned %d\n", ret);
967  return DISP_E_EXCEPTION;
968  }
969  }
970  else return DISP_E_MEMBERNOTFOUND;
971  break;
972 
975  hr = DispGetParam(pDispParams, 0, VT_I4, &varg0, puArgErr);
976  if (FAILED(hr)) return hr;
977  V_VT(pVarResult) = VT_I4;
978  V_I4(pVarResult) = MsiRecordGetInteger(This->msiHandle, V_I4(&varg0));
979  } else if (wFlags & DISPATCH_PROPERTYPUT) {
980  hr = DispGetParam(pDispParams, 0, VT_I4, &varg0, puArgErr);
981  if (FAILED(hr)) return hr;
982  hr = DispGetParam(pDispParams, 1, VT_I4, &varg1, puArgErr);
983  if (FAILED(hr)) return hr;
984  if ((ret = MsiRecordSetInteger(This->msiHandle, V_I4(&varg0), V_I4(&varg1))) != ERROR_SUCCESS)
985  {
986  ERR("MsiRecordSetInteger returned %d\n", ret);
987  return DISP_E_EXCEPTION;
988  }
989  }
990  else return DISP_E_MEMBERNOTFOUND;
991  break;
992 
993  default:
994  return DISP_E_MEMBERNOTFOUND;
995  }
996 
997  VariantClear(&varg1);
998  VariantClear(&varg0);
999 
1000  return S_OK;
1001 }
#define DISP_E_EXCEPTION
Definition: winerror.h:2518
Definition: compat.h:1947
#define DISPATCH_PROPERTYGET
Definition: oleauto.h:1007
UINT WINAPI MsiRecordSetInteger(MSIHANDLE handle, UINT iField, int iVal)
Definition: record.c:351
#define ERROR_SUCCESS
Definition: deptool.c:10
HRESULT hr
Definition: shlfolder.c:183
#define DISPID_RECORD_INTEGERDATA
int WINAPI MsiRecordGetInteger(MSIHANDLE handle, UINT iField)
Definition: record.c:271
HRESULT WINAPI DispGetParam(DISPPARAMS *pdispparams, UINT position, VARTYPE vtTarg, VARIANT *pvarResult, UINT *puArgErr)
Definition: dispatch.c:118
#define DISP_E_MEMBERNOTFOUND
Definition: winerror.h:2512
void WINAPI VariantInit(VARIANTARG *pVarg)
Definition: variant.c:571
#define V_I4(A)
Definition: oleauto.h:247
UINT WINAPI MsiRecordGetStringW(MSIHANDLE handle, UINT iField, LPWSTR szValue, LPDWORD pcchValue)
Definition: record.c:533
smooth NULL
Definition: ftsmooth.c:416
BSTR WINAPI SysAllocString(LPCOLESTR str)
Definition: oleaut.c:241
#define DISPATCH_PROPERTYPUT
Definition: oleauto.h:1008
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
#define DISPID_RECORD_STRINGDATA
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
HRESULT WINAPI DECLSPEC_HOTPATCH VariantClear(VARIANTARG *pVarg)
Definition: variant.c:651
#define V_VT(A)
Definition: oleauto.h:211
#define DISPID_RECORD_FIELDCOUNT
#define V_BSTR(A)
Definition: oleauto.h:226
_In_ DWORD _Out_ _In_ WORD wFlags
Definition: wincon.h:519
#define ERR(fmt,...)
Definition: debug.h:109
#define S_OK
Definition: intsafe.h:59
unsigned int UINT
Definition: ndis.h:50
static BOOL msi_free(void *mem)
Definition: msipriv.h:1227
UINT WINAPI MsiRecordSetStringW(MSIHANDLE handle, UINT iField, LPCWSTR szValue)
Definition: record.c:656
static void * msi_alloc(size_t len) __WINE_ALLOC_SIZE(1)
Definition: msipriv.h:1204
UINT WINAPI MsiRecordGetFieldCount(MSIHANDLE handle)
Definition: record.c:116

◆ release_typelib()

void release_typelib ( void  )

Definition at line 129 of file automation.c.

130 {
131  unsigned i;
132 
133  for (i = 0; i < sizeof(typeinfos)/sizeof(*typeinfos); i++)
134  if (typeinfos[i])
135  ITypeInfo_Release(typeinfos[i]);
136 
137  if (typelib)
138  ITypeLib_Release(typelib);
139 }
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
static ITypeInfo * typeinfos[LAST_tid]
Definition: automation.c:82
static ITypeLib * typelib
Definition: automation.c:81

◆ session_invoke()

static HRESULT session_invoke ( AutomationObject This,
DISPID  dispIdMember,
REFIID  riid,
LCID  lcid,
WORD  wFlags,
DISPPARAMS *  pDispParams,
VARIANT pVarResult,
EXCEPINFO *  pExcepInfo,
UINT puArgErr 
)
static

Definition at line 1359 of file automation.c.

1369 {
1370  SessionObject *session = CONTAINING_RECORD(This, SessionObject, autoobj);
1371  WCHAR *szString;
1372  DWORD dwLen = 0;
1373  MSIHANDLE msiHandle;
1374  LANGID langId;
1375  UINT ret;
1376  INSTALLSTATE iInstalled, iAction;
1377  VARIANTARG varg0, varg1;
1378  HRESULT hr;
1379 
1380  VariantInit(&varg0);
1381  VariantInit(&varg1);
1382 
1383  switch (dispIdMember)
1384  {
1386  if (wFlags & DISPATCH_PROPERTYGET) {
1387  V_VT(pVarResult) = VT_DISPATCH;
1388  IDispatch_AddRef(session->installer);
1389  V_DISPATCH(pVarResult) = session->installer;
1390  }
1391  else return DISP_E_MEMBERNOTFOUND;
1392  break;
1393 
1395  if (wFlags & DISPATCH_PROPERTYGET) {
1396  hr = DispGetParam(pDispParams, 0, VT_BSTR, &varg0, puArgErr);
1397  if (FAILED(hr)) return hr;
1398  V_VT(pVarResult) = VT_BSTR;
1399  V_BSTR(pVarResult) = NULL;
1400  if ((ret = MsiGetPropertyW(This->msiHandle, V_BSTR(&varg0), NULL, &dwLen)) == ERROR_SUCCESS)
1401  {
1402  if (!(szString = msi_alloc((++dwLen)*sizeof(WCHAR))))
1403  ERR("Out of memory\n");
1404  else if ((ret = MsiGetPropertyW(This->msiHandle, V_BSTR(&varg0), szString, &dwLen)) == ERROR_SUCCESS)
1405  V_BSTR(pVarResult) = SysAllocString(szString);
1406  msi_free(szString);
1407  }
1408  if (ret != ERROR_SUCCESS)
1409  ERR("MsiGetProperty returned %d\n", ret);
1410  } else if (wFlags & DISPATCH_PROPERTYPUT) {
1411  hr = DispGetParam(pDispParams, 0, VT_BSTR, &varg0, puArgErr);
1412  if (FAILED(hr)) return hr;
1413  hr = DispGetParam(pDispParams, 1, VT_BSTR, &varg1, puArgErr);
1414  if (FAILED(hr)) {
1415  VariantClear(&varg0);
1416  return hr;
1417  }
1418  if ((ret = MsiSetPropertyW(This->msiHandle, V_BSTR(&varg0), V_BSTR(&varg1))) != ERROR_SUCCESS)
1419  {
1420  VariantClear(&varg0);
1421  VariantClear(&varg1);
1422  ERR("MsiSetProperty returned %d\n", ret);
1423  return DISP_E_EXCEPTION;
1424  }
1425  }
1426  else return DISP_E_MEMBERNOTFOUND;
1427  break;
1428 
1430  if (wFlags & DISPATCH_PROPERTYGET) {
1431  langId = MsiGetLanguage(This->msiHandle);
1432  V_VT(pVarResult) = VT_I4;
1433  V_I4(pVarResult) = langId;
1434  }
1435  else return DISP_E_MEMBERNOTFOUND;
1436  break;
1437 
1438  case DISPID_SESSION_MODE:
1439  if (wFlags & DISPATCH_PROPERTYGET) {
1440  hr = DispGetParam(pDispParams, 0, VT_I4, &varg0, puArgErr);
1441  if (FAILED(hr)) return hr;
1442  V_VT(pVarResult) = VT_BOOL;
1443  V_BOOL(pVarResult) = MsiGetMode(This->msiHandle, V_I4(&varg0)) ? VARIANT_TRUE : VARIANT_FALSE;
1444  } else if (wFlags & DISPATCH_PROPERTYPUT) {
1445  hr = DispGetParam(pDispParams, 0, VT_I4, &varg0, puArgErr);
1446  if (FAILED(hr)) return hr;
1447  hr = DispGetParam(pDispParams, 1, VT_BOOL, &varg1, puArgErr);
1448  if (FAILED(hr)) return hr;
1449  if ((ret = MsiSetMode(This->msiHandle, V_I4(&varg0), V_BOOL(&varg1))) != ERROR_SUCCESS)
1450  {
1451  ERR("MsiSetMode returned %d\n", ret);
1452  return DISP_E_EXCEPTION;
1453  }
1454  }
1455  else return DISP_E_MEMBERNOTFOUND;
1456  break;
1457 
1459  if (wFlags & DISPATCH_PROPERTYGET) {
1460  V_VT(pVarResult) = VT_DISPATCH;
1461  if ((msiHandle = MsiGetActiveDatabase(This->msiHandle)))
1462  {
1464 
1465  if (SUCCEEDED(hr = create_database(msiHandle, &dispatch)))
1466  V_DISPATCH(pVarResult) = dispatch;
1467  else
1468  ERR("Failed to create Database object, hresult 0x%08x\n", hr);
1469  }
1470  else
1471  {
1472  ERR("MsiGetActiveDatabase failed\n");
1473  return DISP_E_EXCEPTION;
1474  }
1475  }
1476  else return DISP_E_MEMBERNOTFOUND;
1477  break;
1478 
1480  if (wFlags & DISPATCH_METHOD) {
1481  hr = DispGetParam(pDispParams, 0, VT_BSTR, &varg0, puArgErr);
1482  if (FAILED(hr)) return hr;
1483  ret = MsiDoActionW(This->msiHandle, V_BSTR(&varg0));
1484  V_VT(pVarResult) = VT_I4;
1485  switch (ret)
1486  {
1488  V_I4(pVarResult) = msiDoActionStatusNoAction;
1489  break;
1490  case ERROR_SUCCESS:
1491  V_I4(pVarResult) = msiDoActionStatusSuccess;
1492  break;
1494  V_I4(pVarResult) = msiDoActionStatusUserExit;
1495  break;
1496  case ERROR_INSTALL_FAILURE:
1497  V_I4(pVarResult) = msiDoActionStatusFailure;
1498  break;
1499  case ERROR_INSTALL_SUSPEND:
1500  V_I4(pVarResult) = msiDoActionStatusSuspend;
1501  break;
1502  case ERROR_MORE_DATA:
1503  V_I4(pVarResult) = msiDoActionStatusFinished;
1504  break;
1506  V_I4(pVarResult) = msiDoActionStatusWrongState;
1507  break;
1508  case ERROR_INVALID_DATA:
1509  V_I4(pVarResult) = msiDoActionStatusBadActionData;
1510  break;
1511  default:
1512  VariantClear(&varg0);
1513  FIXME("MsiDoAction returned unhandled value %d\n", ret);
1514  return DISP_E_EXCEPTION;
1515  }
1516  }
1517  else return DISP_E_MEMBERNOTFOUND;
1518  break;
1519 
1521  if (wFlags & DISPATCH_METHOD) {
1522  hr = DispGetParam(pDispParams, 0, VT_BSTR, &varg0, puArgErr);
1523  if (FAILED(hr)) return hr;
1524  V_VT(pVarResult) = VT_I4;
1525  V_I4(pVarResult) = MsiEvaluateConditionW(This->msiHandle, V_BSTR(&varg0));
1526  }
1527  else return DISP_E_MEMBERNOTFOUND;
1528  break;
1529 
1531  if(!(wFlags & DISPATCH_METHOD))
1532  return DISP_E_MEMBERNOTFOUND;
1533 
1534  hr = DispGetParam(pDispParams, 0, VT_I4, &varg0, puArgErr);
1535  if (FAILED(hr)) return hr;
1536  hr = DispGetParam(pDispParams, 1, VT_DISPATCH, &varg1, puArgErr);
1537  if (FAILED(hr)) return hr;
1538 
1539  V_VT(pVarResult) = VT_I4;
1540  V_I4(pVarResult) =
1541  MsiProcessMessage(This->msiHandle, V_I4(&varg0), ((AutomationObject *)V_DISPATCH(&varg1))->msiHandle);
1542  break;
1543 
1545  if (wFlags & DISPATCH_METHOD) {
1546  hr = DispGetParam(pDispParams, 0, VT_I4, &varg0, puArgErr);
1547  if (FAILED(hr)) return hr;
1548  if ((ret = MsiSetInstallLevel(This->msiHandle, V_I4(&varg0))) != ERROR_SUCCESS)
1549  {
1550  ERR("MsiSetInstallLevel returned %d\n", ret);
1551  return DISP_E_EXCEPTION;
1552  }
1553  }
1554  else return DISP_E_MEMBERNOTFOUND;
1555  break;
1556 
1558  if (wFlags & DISPATCH_PROPERTYGET) {
1559  hr = DispGetParam(pDispParams, 0, VT_BSTR, &varg0, puArgErr);
1560  if (FAILED(hr)) return hr;
1561  V_VT(pVarResult) = VT_I4;
1562  if ((ret = MsiGetFeatureStateW(This->msiHandle, V_BSTR(&varg0), &iInstalled, &iAction)) == ERROR_SUCCESS)
1563  V_I4(pVarResult) = iInstalled;
1564  else
1565  {
1566  ERR("MsiGetFeatureState returned %d\n", ret);
1567  V_I4(pVarResult) = msiInstallStateUnknown;
1568  }
1569  }
1570  else return DISP_E_MEMBERNOTFOUND;
1571  break;
1572 
1574  if (wFlags & DISPATCH_PROPERTYGET) {
1575  hr = DispGetParam(pDispParams, 0, VT_BSTR, &varg0, puArgErr);
1576  if (FAILED(hr)) return hr;
1577  V_VT(pVarResult) = VT_I4;
1578  if ((ret = MsiGetFeatureStateW(This->msiHandle, V_BSTR(&varg0), &iInstalled, &iAction)) == ERROR_SUCCESS)
1579  V_I4(pVarResult) = iAction;
1580  else
1581  {
1582  ERR("MsiGetFeatureState returned %d\n", ret);
1583  V_I4(pVarResult) = msiInstallStateUnknown;
1584  }
1585  } else if (wFlags & DISPATCH_PROPERTYPUT) {
1586  hr = DispGetParam(pDispParams, 0, VT_BSTR, &varg0, puArgErr);
1587  if (FAILED(hr)) return hr;
1588  hr = DispGetParam(pDispParams, 1, VT_I4, &varg1, puArgErr);
1589  if (FAILED(hr)) {
1590  VariantClear(&varg0);
1591  return hr;
1592  }
1593  if ((ret = MsiSetFeatureStateW(This->msiHandle, V_BSTR(&varg0), V_I4(&varg1))) != ERROR_SUCCESS)
1594  {
1595  VariantClear(&varg0);
1596  ERR("MsiSetFeatureState returned %d\n", ret);
1597  return DISP_E_EXCEPTION;
1598  }
1599  }
1600  else return DISP_E_MEMBERNOTFOUND;
1601  break;
1602 
1603  default:
1604  return DISP_E_MEMBERNOTFOUND;
1605  }
1606 
1607  VariantClear(&varg1);
1608  VariantClear(&varg0);
1609 
1610  return S_OK;
1611 }
WindowsInstaller::enum msiDoActionStatusUserExit
#define DISPID_SESSION_LANGUAGE
#define DISP_E_EXCEPTION
Definition: winerror.h:2518
WindowsInstaller::enum msiDoActionStatusWrongState
UINT WINAPI MsiSetPropertyW(MSIHANDLE hInstall, LPCWSTR szName, LPCWSTR szValue)
Definition: package.c:2211
Definition: compat.h:1947
#define DISPATCH_PROPERTYGET
Definition: oleauto.h:1007
#define ERROR_SUCCESS
Definition: deptool.c:10
WindowsInstaller::enum msiDoActionStatusFinished
HRESULT hr
Definition: shlfolder.c:183
#define DISPID_SESSION_EVALUATECONDITION
MSICONDITION WINAPI MsiEvaluateConditionW(MSIHANDLE hInstall, LPCWSTR szCondition)
Definition: cond.tab.c:2496
HRESULT WINAPI DispGetParam(DISPPARAMS *pdispparams, UINT position, VARTYPE vtTarg, VARIANT *pvarResult, UINT *puArgErr)
Definition: dispatch.c:118
WindowsInstaller::enum msiDoActionStatusBadActionData
#define DISP_E_MEMBERNOTFOUND
Definition: winerror.h:2512
#define DISPID_SESSION_PROPERTY
#define DISPID_SESSION_DOACTION
WORD LANGID
Definition: typedefs.h:79
void WINAPI VariantInit(VARIANTARG *pVarg)
Definition: variant.c:571
#define DISPID_SESSION_FEATURECURRENTSTATE
unsigned long MSIHANDLE
Definition: msiserver.idl:25
#define V_I4(A)
Definition: oleauto.h:247
#define DISPATCH_METHOD
Definition: oleauto.h:1006
#define V_DISPATCH(A)
Definition: oleauto.h:239
WindowsInstaller::enum msiDoActionStatusSuccess
BOOL WINAPI MsiGetMode(MSIHANDLE hInstall, MSIRUNMODE iRunMode)
Definition: install.c:690
MSIHANDLE WINAPI MsiGetActiveDatabase(MSIHANDLE hInstall)
Definition: package.c:1692
UINT WINAPI MsiSetMode(MSIHANDLE hInstall, MSIRUNMODE iRunMode, BOOL fState)
Definition: install.c:782
#define FIXME(fmt,...)
Definition: debug.h:110
UINT WINAPI MsiDoActionW(MSIHANDLE hInstall, LPCWSTR szAction)
Definition: install.c:64
#define ERROR_INVALID_HANDLE_STATE
Definition: winerror.h:967
#define ERROR_FUNCTION_NOT_CALLED
Definition: winerror.h:984
smooth NULL
Definition: ftsmooth.c:416
BSTR WINAPI SysAllocString(LPCOLESTR str)
Definition: oleaut.c:241
INT WINAPI MsiProcessMessage(MSIHANDLE hInstall, INSTALLMESSAGE eMessageType, MSIHANDLE hRecord)
Definition: package.c:2052
#define DISPATCH_PROPERTYPUT
Definition: oleauto.h:1008
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
#define ERROR_INSTALL_USEREXIT
Definition: winerror.h:960
UINT WINAPI MsiGetFeatureStateW(MSIHANDLE hInstall, LPCWSTR szFeature, INSTALLSTATE *piInstalled, INSTALLSTATE *piAction)
Definition: install.c:1123
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
#define ERROR_INSTALL_FAILURE
Definition: winerror.h:961
#define V_BOOL(A)
Definition: oleauto.h:224
unsigned long DWORD
Definition: ntddk_ex.h:95
#define DISPID_SESSION_INSTALLER
UINT WINAPI MsiGetPropertyW(MSIHANDLE hInstall, LPCWSTR szName, LPWSTR szValueBuf, LPDWORD pchValueBuf)
Definition: package.c:2507
#define DISPID_SESSION_MODE
int ret
HRESULT WINAPI DECLSPEC_HOTPATCH VariantClear(VARIANTARG *pVarg)
Definition: variant.c:651
UINT WINAPI MsiSetInstallLevel(MSIHANDLE hInstall, int iInstallLevel)
Definition: install.c:1670
#define V_VT(A)
Definition: oleauto.h:211
#define DISPID_SESSION_SETINSTALLLEVEL
void dispatch(HANDLE hStopEvent)
Definition: dispatch.c:66
#define ERROR_MORE_DATA
Definition: dderror.h:13
#define V_BSTR(A)
Definition: oleauto.h:226
#define ERROR_INVALID_DATA
Definition: winerror.h:116
_In_ DWORD _Out_ _In_ WORD wFlags
Definition: wincon.h:519
#define ERR(fmt,...)
Definition: debug.h:109
#define ERROR_INSTALL_SUSPEND
Definition: winerror.h:962
static HRESULT create_database(MSIHANDLE, IDispatch **)
Definition: automation.c:2489
#define S_OK
Definition: intsafe.h:59
int INSTALLSTATE
Definition: msiserver.idl:35
#define DISPID_SESSION_FEATUREREQUESTSTATE
unsigned int UINT
Definition: ndis.h:50
WindowsInstaller::enum msiDoActionStatusFailure
static BOOL msi_free(void *mem)
Definition: msipriv.h:1227
LANGID WINAPI MsiGetLanguage(MSIHANDLE hInstall)
Definition: install.c:1615
WindowsInstaller::enum msiDoActionStatusSuspend
static void * msi_alloc(size_t len) __WINE_ALLOC_SIZE(1)
Definition: msipriv.h:1204
UINT WINAPI MsiSetFeatureStateW(MSIHANDLE hInstall, LPCWSTR szFeature, INSTALLSTATE iState)
Definition: install.c:972
#define DISPID_SESSION_DATABASE
IDispatch * installer
Definition: automation.c:180
#define DISPID_SESSION_MESSAGE
#define SUCCEEDED(hr)
Definition: intsafe.h:57

◆ summaryinfo_invoke()

static HRESULT summaryinfo_invoke ( AutomationObject This,
DISPID  dispIdMember,
REFIID  riid,
LCID  lcid,
WORD  wFlags,
DISPPARAMS *  pDispParams,
VARIANT pVarResult,
EXCEPINFO *  pExcepInfo,
UINT puArgErr 
)
static

Definition at line 760 of file automation.c.

770 {
771  UINT ret;
772  VARIANTARG varg0, varg1;
773  FILETIME ft, ftlocal;
774  SYSTEMTIME st;
775  HRESULT hr;
776 
777  VariantInit(&varg0);
778  VariantInit(&varg1);
779 
780  switch (dispIdMember)
781  {
784  {
785  UINT type;
786  INT value;
787  DWORD size = 0;
788  DATE date;
789  LPWSTR str;
790 
791  static WCHAR szEmpty[] = {0};
792 
793  hr = DispGetParam(pDispParams, 0, VT_I4, &varg0, puArgErr);
794  if (FAILED(hr)) return hr;
795  ret = MsiSummaryInfoGetPropertyW(This->msiHandle, V_I4(&varg0), &type, &value,
796  &ft, szEmpty, &size);
797  if (ret != ERROR_SUCCESS &&
798  ret != ERROR_MORE_DATA)
799  {
800  ERR("MsiSummaryInfoGetProperty returned %d\n", ret);
801  return DISP_E_EXCEPTION;
802  }
803 
804  switch (type)
805  {
806  case VT_EMPTY:
807  break;
808 
809  case VT_I2:
810  case VT_I4:
811  V_VT(pVarResult) = VT_I4;
812  V_I4(pVarResult) = value;
813  break;
814 
815  case VT_LPSTR:
816  if (!(str = msi_alloc(++size * sizeof(WCHAR))))
817  ERR("Out of memory\n");
818  else if ((ret = MsiSummaryInfoGetPropertyW(This->msiHandle, V_I4(&varg0), &type, NULL,
819  NULL, str, &size)) != ERROR_SUCCESS)
820  ERR("MsiSummaryInfoGetProperty returned %d\n", ret);
821  else
822  {
823  V_VT(pVarResult) = VT_BSTR;
824  V_BSTR(pVarResult) = SysAllocString(str);
825  }
826  msi_free(str);
827  break;
828 
829  case VT_FILETIME:
830  FileTimeToLocalFileTime(&ft, &ftlocal);
831  FileTimeToSystemTime(&ftlocal, &st);
833 
834  V_VT(pVarResult) = VT_DATE;
835  V_DATE(pVarResult) = date;
836  break;
837 
838  default:
839  ERR("Unhandled variant type %d\n", type);
840  }
841  }
842  else if (wFlags & DISPATCH_PROPERTYPUT)
843  {
844  UINT posValue = DISPID_PROPERTYPUT;
845 
846  hr = DispGetParam(pDispParams, 0, VT_I4, &varg0, puArgErr);
847  if (FAILED(hr)) return hr;
848  hr = DispGetParam_CopyOnly(pDispParams, &posValue, &varg1);
849  if (