ReactOS  0.4.15-dev-5137-g826bd41
automation.c File Reference
#include <stdio.h>
#include <initguid.h>
#include <windows.h>
#include <msiquery.h>
#include <msidefs.h>
#include <msi.h>
#include <fci.h>
#include <oaidl.h>
#include "wine/test.h"
Include dependency graph for automation.c:

Go to the source code of this file.

Classes

struct  _msi_table
 
struct  _msi_summary_info
 
struct  get_did_t
 

Macros

#define COBJMACROS
 
#define ADD_TABLE(x)   {#x".idt", x##_dat, sizeof(x##_dat)}
 
#define ADD_INFO_I2(property, iValue)   {property, VT_I2, iValue, NULL, NULL}
 
#define ADD_INFO_I4(property, iValue)   {property, VT_I4, iValue, NULL, NULL}
 
#define ADD_INFO_LPSTR(property, szValue)   {property, VT_LPSTR, 0, NULL, szValue}
 
#define ADD_INFO_FILETIME(property, pftValue)   {property, VT_FILETIME, 0, pftValue, NULL}
 
#define GET_PROC(dll, func)
 
#define ok_w2(format, szString1, szString2)
 
#define ok_w2n(format, szString1, szString2, len)
 
#define ok_aw(format, aString, wString)
 
#define ok_awplus(format, extra, aString, wString)
 
#define ok_exception(hr, szDescription)
 
#define TEST_SUMMARYINFO_PROPERTIES_MODIFIED   4
 

Typedefs

typedef struct _msi_table msi_table
 
typedef struct _msi_summary_info msi_summary_info
 

Functions

static LONG (WINAPI *pRegDeleteKeyExA)(HKEY
 
static BOOL (WINAPI *pIsWow64Process)(HANDLE
 
 DEFINE_GUID (GUID_NULL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
 
static void init_functionpointers (void)
 
static BOOL is_process_limited (void)
 
static LONG delete_key_portable (HKEY key, LPCSTR subkey, REGSAM access)
 
static void write_file (const CHAR *filename, const char *data, int data_size)
 
static void write_msi_summary_info (MSIHANDLE db, const msi_summary_info *info, int num_info)
 
static void create_database (const CHAR *name, const msi_table *tables, int num_tables, const msi_summary_info *info, int num_info)
 
static BOOL create_package (LPWSTR path)
 
static BOOL get_program_files_dir (LPSTR buf)
 
static void create_file (const CHAR *name, DWORD size)
 
static void create_test_files (void)
 
static BOOL delete_pf (const CHAR *rel_path, BOOL is_file)
 
static void delete_test_files (void)
 
static DISPID get_dispid (IDispatch *disp, const char *name)
 
static void test_dispid (void)
 
static void test_dispatch (void)
 
static HRESULT invoke (IDispatch *pDispatch, LPCSTR szName, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, VARTYPE vtResult)
 
static HRESULT Installer_CreateRecord (int count, IDispatch **pRecord)
 
static HRESULT Installer_RegistryValue (HKEY hkey, LPCWSTR szKey, VARIANT vValue, VARIANT *pVarResult, VARTYPE vtExpect)
 
static HRESULT Installer_RegistryValueE (HKEY hkey, LPCWSTR szKey, BOOL *pBool)
 
static HRESULT Installer_RegistryValueW (HKEY hkey, LPCWSTR szKey, LPCWSTR szValue, LPWSTR szString)
 
static HRESULT Installer_RegistryValueI (HKEY hkey, LPCWSTR szKey, int iValue, LPWSTR szString, VARTYPE vtResult)
 
static HRESULT Installer_OpenPackage (LPCWSTR szPackagePath, int options, IDispatch **pSession)
 
static HRESULT Installer_OpenDatabase (LPCWSTR szDatabasePath, int openmode, IDispatch **pDatabase)
 
static HRESULT Installer_InstallProduct (LPCWSTR szPackagePath, LPCWSTR szPropertyValues)
 
static HRESULT Installer_ProductState (LPCWSTR szProduct, int *pInstallState)
 
static HRESULT Installer_ProductInfo (LPCWSTR szProduct, LPCWSTR szAttribute, LPWSTR szString)
 
static HRESULT Installer_Products (IDispatch **pStringList)
 
static HRESULT Installer_RelatedProducts (LPCWSTR szProduct, IDispatch **pStringList)
 
static HRESULT Installer_VersionGet (LPWSTR szVersion)
 
static HRESULT Installer_UILevelPut (int level)
 
static HRESULT Installer_SummaryInformation (BSTR PackagePath, int UpdateCount, IDispatch **pSumInfo)
 
static HRESULT Session_Installer (IDispatch *pSession, IDispatch **pInst)
 
static HRESULT Session_PropertyGet (IDispatch *pSession, LPCWSTR szName, LPWSTR szReturn)
 
static HRESULT Session_PropertyPut (IDispatch *pSession, LPCWSTR szName, LPCWSTR szValue)
 
static HRESULT Session_LanguageGet (IDispatch *pSession, UINT *pLangId)
 
static HRESULT Session_ModeGet (IDispatch *pSession, int iFlag, VARIANT_BOOL *mode)
 
static HRESULT Session_ModePut (IDispatch *pSession, int iFlag, VARIANT_BOOL mode)
 
static HRESULT Session_Database (IDispatch *pSession, IDispatch **pDatabase)
 
static HRESULT Session_DoAction (IDispatch *pSession, LPCWSTR szAction, int *iReturn)
 
static HRESULT Session_EvaluateCondition (IDispatch *pSession, LPCWSTR szCondition, int *iReturn)
 
static HRESULT Session_Message (IDispatch *pSession, LONG kind, IDispatch *record, int *ret)
 
static HRESULT Session_SetInstallLevel (IDispatch *pSession, LONG iInstallLevel)
 
static HRESULT Session_FeatureCurrentState (IDispatch *pSession, LPCWSTR szName, int *pState)
 
static HRESULT Session_FeatureRequestStateGet (IDispatch *pSession, LPCWSTR szName, int *pState)
 
static HRESULT Session_FeatureRequestStatePut (IDispatch *pSession, LPCWSTR szName, int iState)
 
static HRESULT Database_OpenView (IDispatch *pDatabase, LPCWSTR szSql, IDispatch **pView)
 
static HRESULT Database_SummaryInformation (IDispatch *pDatabase, int iUpdateCount, IDispatch **pSummaryInfo)
 
static HRESULT View_Execute (IDispatch *pView, IDispatch *pRecord)
 
static HRESULT View_Fetch (IDispatch *pView, IDispatch **ppRecord)
 
static HRESULT View_Modify (IDispatch *pView, int iMode, IDispatch *pRecord)
 
static HRESULT View_Close (IDispatch *pView)
 
static HRESULT Record_FieldCountGet (IDispatch *pRecord, int *pFieldCount)
 
static HRESULT Record_StringDataGet (IDispatch *pRecord, int iField, LPWSTR szString)
 
static HRESULT Record_StringDataPut (IDispatch *pRecord, int iField, LPCWSTR szString)
 
static HRESULT Record_IntegerDataGet (IDispatch *pRecord, int iField, int *pValue)
 
static HRESULT Record_IntegerDataPut (IDispatch *pRecord, int iField, int iValue)
 
static HRESULT StringList__NewEnum (IDispatch *pList, IUnknown **ppEnumVARIANT)
 
static HRESULT StringList_Item (IDispatch *pStringList, int iIndex, LPWSTR szString)
 
static HRESULT StringList_Count (IDispatch *pStringList, int *pCount)
 
static HRESULT SummaryInfo_PropertyGet (IDispatch *pSummaryInfo, int pid, VARIANT *pVarResult, VARTYPE vtExpect)
 
static HRESULT SummaryInfo_PropertyPut (IDispatch *pSummaryInfo, int pid, VARIANT *pVariant)
 
static HRESULT SummaryInfo_PropertyCountGet (IDispatch *pSummaryInfo, int *pCount)
 
static void test_SummaryInfo (IDispatch *pSummaryInfo, const msi_summary_info *info, int num_info, BOOL readonly)
 
static void test_Database (IDispatch *pDatabase, BOOL readonly)
 
static void test_Session (IDispatch *pSession)
 
static DWORD delete_key (HKEY hkey)
 
static void test_Installer_RegistryValue (void)
 
static void test_Installer_Products (BOOL bProductInstalled)
 
static UINT delete_registry_key (HKEY hkeyParent, LPCSTR subkey, REGSAM access)
 
static UINT find_registry_key (HKEY hkeyParent, LPCSTR subkey, LPCSTR findkey, REGSAM access, HKEY *phkey)
 
static void test_Installer_InstallProduct (void)
 
static void test_Installer (void)
 
 START_TEST (automation)
 

Variables

static BOOL is_wow64
 
static LPCSTR
 
static REGSAM
 
static DWORD
 
static PBOOL
 
static const charmsifile = "winetest-automation.msi"
 
static FILETIME systemtime
 
static CHAR CURR_DIR [MAX_PATH]
 
static EXCEPINFO excepinfo
 
static IDispatchpInstaller
 
static const CHAR component_dat []
 
static const CHAR directory_dat []
 
static const CHAR feature_dat []
 
static const CHAR feature_comp_dat []
 
static const CHAR file_dat []
 
static const CHAR install_exec_seq_dat []
 
static const CHAR media_dat []
 
static const CHAR property_dat []
 
static const CHAR registry_dat []
 
static const msi_table tables []
 
static const msi_summary_info summary_info []
 
static char PROG_FILES_DIR [MAX_PATH]
 
static CHAR string1 [MAX_PATH]
 
static CHAR string2 [MAX_PATH]
 
static const get_did_t get_did_data []
 
static int _invoke_todo_vtResult = 0
 

Macro Definition Documentation

◆ ADD_INFO_FILETIME

#define ADD_INFO_FILETIME (   property,
  pftValue 
)    {property, VT_FILETIME, 0, pftValue, NULL}

Definition at line 193 of file automation.c.

◆ ADD_INFO_I2

#define ADD_INFO_I2 (   property,
  iValue 
)    {property, VT_I2, iValue, NULL, NULL}

Definition at line 190 of file automation.c.

◆ ADD_INFO_I4

#define ADD_INFO_I4 (   property,
  iValue 
)    {property, VT_I4, iValue, NULL, NULL}

Definition at line 191 of file automation.c.

◆ ADD_INFO_LPSTR

#define ADD_INFO_LPSTR (   property,
  szValue 
)    {property, VT_LPSTR, 0, NULL, szValue}

Definition at line 192 of file automation.c.

◆ ADD_TABLE

#define ADD_TABLE (   x)    {#x".idt", x##_dat, sizeof(x##_dat)}

Definition at line 166 of file automation.c.

◆ COBJMACROS

#define COBJMACROS

Definition at line 22 of file automation.c.

◆ GET_PROC

#define GET_PROC (   dll,
  func 
)
Value:
p ## func = (void *)GetProcAddress(dll, #func); \
if(!p ## func) \
trace("GetProcAddress(%s) failed\n", #func);
GLenum func
Definition: glext.h:6028
static HMODULE dll
Definition: str.c:188
#define GetProcAddress(x, y)
Definition: compat.h:612
GLfloat GLfloat p
Definition: glext.h:8902

◆ ok_aw

#define ok_aw (   format,
  aString,
  wString 
)
Value:
\
WideCharToMultiByte(CP_ACP, 0, wString, -1, string1, MAX_PATH, NULL, NULL); \
if (lstrcmpA(string1, aString) != 0) \
ok(0, format, string1, aString); \
#define CP_ACP
Definition: compat.h:109
static CHAR string1[MAX_PATH]
Definition: automation.c:449
int WINAPI lstrcmpA(LPCSTR lpString1, LPCSTR lpString2)
Definition: lstring.c:18
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: gl.h:1546
#define MAX_PATH
Definition: compat.h:34
#define NULL
Definition: types.h:112

Definition at line 469 of file automation.c.

◆ ok_awplus

#define ok_awplus (   format,
  extra,
  aString,
  wString 
)
Value:
\
WideCharToMultiByte(CP_ACP, 0, wString, -1, string1, MAX_PATH, NULL, NULL); \
if (lstrcmpA(string1, aString) != 0) \
ok(0, format, extra, string1, aString); \
#define CP_ACP
Definition: compat.h:109
static CHAR string1[MAX_PATH]
Definition: automation.c:449
int WINAPI lstrcmpA(LPCSTR lpString1, LPCSTR lpString2)
Definition: lstring.c:18
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: gl.h:1546
Definition: id3.c:95
#define MAX_PATH
Definition: compat.h:34
#define NULL
Definition: types.h:112

Definition at line 475 of file automation.c.

◆ ok_exception

#define ok_exception (   hr,
  szDescription 
)
Value:
{ \
/* Compare wtype, source, and destination */ \
ok(excepinfo.wCode == 1000, "Exception info was %d, expected 1000\n", excepinfo.wCode); \
ok(excepinfo.bstrSource != NULL, "Exception source was NULL\n"); \
if (excepinfo.bstrSource) \
ok_w2("Exception source was \"%s\" but expected to be \"%s\"\n", excepinfo.bstrSource, L"Msi API Error"); \
ok(excepinfo.bstrDescription != NULL, "Exception description was NULL\n"); \
if (excepinfo.bstrDescription) \
ok_w2("Exception description was \"%s\" but expected to be \"%s\"\n", excepinfo.bstrDescription, szDescription); \
SysFreeString(excepinfo.bstrSource); \
SysFreeString(excepinfo.bstrDescription); \
SysFreeString(excepinfo.bstrHelpFile); \
}
#define DISP_E_EXCEPTION
Definition: winerror.h:2518
HRESULT hr
Definition: shlfolder.c:183
#define L(x)
Definition: ntvdm.h:50
#define ok(value,...)
Definition: atltest.h:57
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
Definition: oleaut.c:271
#define NULL
Definition: types.h:112
static EXCEPINFO excepinfo
Definition: automation.c:50
static const WCHAR szDescription[]
Definition: provider.c:55

Definition at line 482 of file automation.c.

◆ ok_w2

#define ok_w2 (   format,
  szString1,
  szString2 
)
Value:
\
do { \
WideCharToMultiByte(CP_ACP, 0, szString1, -1, string1, MAX_PATH, NULL, NULL); \
WideCharToMultiByte(CP_ACP, 0, szString2, -1, string2, MAX_PATH, NULL, NULL); \
if (lstrcmpA(string1, string2) != 0) \
ok(0, format, string1, string2); \
} while(0);
#define CP_ACP
Definition: compat.h:109
static CHAR string2[MAX_PATH]
Definition: automation.c:449
static CHAR string1[MAX_PATH]
Definition: automation.c:449
int WINAPI lstrcmpA(LPCSTR lpString1, LPCSTR lpString2)
Definition: lstring.c:18
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: gl.h:1546
#define MAX_PATH
Definition: compat.h:34
#define NULL
Definition: types.h:112

Definition at line 451 of file automation.c.

◆ ok_w2n

#define ok_w2n (   format,
  szString1,
  szString2,
  len 
)
Value:
\
if (memcmp(szString1, szString2, len * sizeof(WCHAR)) != 0) \
{ \
WideCharToMultiByte(CP_ACP, 0, szString1, -1, string1, MAX_PATH, NULL, NULL); \
WideCharToMultiByte(CP_ACP, 0, szString2, -1, string2, MAX_PATH, NULL, NULL); \
ok(0, format, string1, string2); \
}
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112
#define CP_ACP
Definition: compat.h:109
static CHAR string2[MAX_PATH]
Definition: automation.c:449
static CHAR string1[MAX_PATH]
Definition: automation.c:449
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: gl.h:1546
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define MAX_PATH
Definition: compat.h:34
GLenum GLsizei len
Definition: glext.h:6722
#define NULL
Definition: types.h:112

Definition at line 460 of file automation.c.

◆ TEST_SUMMARYINFO_PROPERTIES_MODIFIED

#define TEST_SUMMARYINFO_PROPERTIES_MODIFIED   4

Definition at line 1580 of file automation.c.

Typedef Documentation

◆ msi_summary_info

◆ msi_table

Function Documentation

◆ BOOL()

static BOOL ( WINAPI pIsWow64Process)
static

◆ create_database()

static void create_database ( const CHAR name,
const msi_table tables,
int  num_tables,
const msi_summary_info info,
int  num_info 
)
static

Definition at line 304 of file automation.c.

306 {
307  MSIHANDLE db;
308  UINT r;
309  WCHAR *nameW;
310  int j, len;
311 
312  len = MultiByteToWideChar( CP_ACP, 0, name, -1, NULL, 0 );
313  if (!(nameW = malloc( len * sizeof(WCHAR) ))) return;
314  MultiByteToWideChar( CP_ACP, 0, name, -1, nameW, len );
315 
317  ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
318 
319  /* import the tables into the database */
320  for (j = 0; j < num_tables; j++)
321  {
322  const msi_table *table = &tables[j];
323 
324  write_file(table->filename, table->data, (table->size - 1) * sizeof(char));
325 
326  r = MsiDatabaseImportA(db, CURR_DIR, table->filename);
327  ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
328 
329  DeleteFileA(table->filename);
330  }
331 
332  write_msi_summary_info(db, info, num_info);
333 
334  r = MsiDatabaseCommit(db);
335  ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
336 
337  MsiCloseHandle(db);
338  free( nameW );
339 }
#define ERROR_SUCCESS
Definition: deptool.c:10
static void write_file(const CHAR *filename, const char *data, int data_size)
Definition: automation.c:268
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
#define CP_ACP
Definition: compat.h:109
#define free
Definition: debug_ros.c:5
static CHAR CURR_DIR[MAX_PATH]
Definition: automation.c:49
unsigned long MSIHANDLE
Definition: winemsi.idl:24
BOOL WINAPI DeleteFileA(IN LPCSTR lpFileName)
Definition: delete.c:24
static const msi_table tables[]
Definition: automation.c:168
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 GLint GLint j
Definition: glfuncs.h:250
static const WCHAR nameW[]
Definition: main.c:46
static void write_msi_summary_info(MSIHANDLE db, const msi_summary_info *info, int num_info)
Definition: automation.c:278
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define MSIDBOPEN_CREATE
Definition: msiquery.h:69
GLenum GLsizei len
Definition: glext.h:6722
UINT WINAPI MsiCloseHandle(MSIHANDLE handle)
Definition: handle.c:269
BYTE * data
UINT WINAPI MsiDatabaseCommit(MSIHANDLE hdb)
Definition: msiquery.c:963
#define ok(value,...)
Definition: atltest.h:57
UINT WINAPI MsiOpenDatabaseW(LPCWSTR szDBPath, LPCWSTR szPersist, MSIHANDLE *phDB)
Definition: database.c:298
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
#define MultiByteToWideChar
Definition: compat.h:110
Definition: name.c:38
#define malloc
Definition: debug_ros.c:4
UINT WINAPI MsiDatabaseImportA(MSIHANDLE handle, const char *szFolder, const char *szFilename)
Definition: database.c:853

Referenced by create_package().

◆ create_file()

static void create_file ( const CHAR name,
DWORD  size 
)
static

Definition at line 381 of file automation.c.

382 {
383  HANDLE file;
384  DWORD written, left;
385 
387  ok(file != INVALID_HANDLE_VALUE, "Failure to open file %s\n", name);
388  WriteFile(file, name, strlen(name), &written, NULL);
389  WriteFile(file, "\n", strlen("\n"), &written, NULL);
390 
391  left = size - lstrlenA(name) - 1;
392 
395 
396  CloseHandle(file);
397 }
BOOL WINAPI WriteFile(IN HANDLE hFile, IN LPCVOID lpBuffer, IN DWORD nNumberOfBytesToWrite OPTIONAL, OUT LPDWORD lpNumberOfBytesWritten, IN LPOVERLAPPED lpOverlapped OPTIONAL)
Definition: rw.c:24
#define CloseHandle
Definition: compat.h:598
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
#define FILE_CURRENT
Definition: winbase.h:113
BOOL WINAPI SetEndOfFile(HANDLE hFile)
Definition: fileinfo.c:1004
#define INVALID_HANDLE_VALUE
Definition: compat.h:590
#define GENERIC_WRITE
Definition: nt_native.h:90
GLsizeiptr size
Definition: glext.h:5919
const char file[]
Definition: icontest.c:11
unsigned long DWORD
Definition: ntddk_ex.h:95
GLint left
Definition: glext.h:7726
#define CREATE_ALWAYS
Definition: disk.h:72
int WINAPI lstrlenA(LPCSTR lpString)
Definition: lstring.c:145
#define ok(value,...)
Definition: atltest.h:57
#define NULL
Definition: types.h:112
Definition: name.c:38
#define CreateFileA(a, b, c, d, e, f, g)
Definition: compat.h:599
#define SetFilePointer
Definition: compat.h:602
Definition: fci.c:126

Referenced by create_test_files().

◆ create_package()

static BOOL create_package ( LPWSTR  path)
static

Definition at line 341 of file automation.c.

342 {
343  DWORD len;
344 
345  /* Prepare package */
347 
349  CURR_DIR, -1, path, MAX_PATH);
350  ok(len, "MultiByteToWideChar returned error %lu\n", GetLastError());
351  if (!len)
352  return FALSE;
353 
354  lstrcatW(path, L"\\winetest-automation.msi");
355  return TRUE;
356 }
static const msi_summary_info summary_info[]
Definition: automation.c:195
#define TRUE
Definition: types.h:120
#define CP_ACP
Definition: compat.h:109
#define MB_PRECOMPOSED
Definition: winnls.h:281
static CHAR CURR_DIR[MAX_PATH]
Definition: automation.c:49
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1040
#define L(x)
Definition: ntvdm.h:50
#define FALSE
Definition: types.h:117
static const msi_table tables[]
Definition: automation.c:168
static const char * msifile
Definition: automation.c:47
#define MAX_PATH
Definition: compat.h:34
unsigned long DWORD
Definition: ntddk_ex.h:95
GLenum GLsizei len
Definition: glext.h:6722
#define ARRAY_SIZE(a)
Definition: main.h:24
#define ok(value,...)
Definition: atltest.h:57
#define MultiByteToWideChar
Definition: compat.h:110
LPWSTR WINAPI lstrcatW(LPWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:274
static void create_database(const CHAR *name, const msi_table *tables, int num_tables, const msi_summary_info *info, int num_info)
Definition: automation.c:304

Referenced by test_dispatch(), and test_Installer().

◆ create_test_files()

static void create_test_files ( void  )
static

Definition at line 399 of file automation.c.

400 {
401  CreateDirectoryA("msitest", NULL);
402  create_file("msitest\\one.txt", 100);
403  CreateDirectoryA("msitest\\first", NULL);
404  create_file("msitest\\first\\two.txt", 100);
405  CreateDirectoryA("msitest\\second", NULL);
406  create_file("msitest\\second\\three.txt", 100);
407  CreateDirectoryA("msitest\\cabout",NULL);
408  create_file("msitest\\cabout\\four.txt", 100);
409  CreateDirectoryA("msitest\\cabout\\new",NULL);
410  create_file("msitest\\cabout\\new\\five.txt", 100);
411  create_file("msitest\\filename", 100);
412 }
BOOL WINAPI CreateDirectoryA(IN LPCSTR lpPathName, IN LPSECURITY_ATTRIBUTES lpSecurityAttributes)
Definition: dir.c:37
#define NULL
Definition: types.h:112
static void create_file(const CHAR *name, DWORD size)
Definition: automation.c:381

Referenced by test_Installer_InstallProduct().

◆ Database_OpenView()

static HRESULT Database_OpenView ( IDispatch pDatabase,
LPCWSTR  szSql,
IDispatch **  pView 
)
static

Definition at line 1346 of file automation.c.

1347 {
1348  VARIANT varresult;
1349  VARIANTARG vararg[1];
1350  DISPPARAMS dispparams = {vararg, NULL, ARRAY_SIZE(vararg), 0};
1351  HRESULT hr;
1352 
1353  VariantInit(&vararg[0]);
1354  V_VT(&vararg[0]) = VT_BSTR;
1355  V_BSTR(&vararg[0]) = SysAllocString(szSql);
1356 
1357  hr = invoke(pDatabase, "OpenView", DISPATCH_METHOD, &dispparams, &varresult, VT_DISPATCH);
1358  *pView = V_DISPATCH(&varresult);
1359  return hr;
1360 }
HRESULT hr
Definition: shlfolder.c:183
void WINAPI VariantInit(VARIANTARG *pVarg)
Definition: variant.c:568
#define DISPATCH_METHOD
Definition: oleauto.h:1006
#define V_DISPATCH(A)
Definition: oleauto.h:239
BSTR WINAPI SysAllocString(LPCOLESTR str)
Definition: oleaut.c:238
LONG HRESULT
Definition: typedefs.h:79
static HRESULT invoke(IDispatch *pDispatch, LPCSTR szName, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, VARTYPE vtResult)
Definition: automation.c:840
#define V_VT(A)
Definition: oleauto.h:211
#define V_BSTR(A)
Definition: oleauto.h:226
#define ARRAY_SIZE(a)
Definition: main.h:24
#define NULL
Definition: types.h:112
struct stdole::DISPPARAMS DISPPARAMS

Referenced by test_Database().

◆ Database_SummaryInformation()

static HRESULT Database_SummaryInformation ( IDispatch pDatabase,
int  iUpdateCount,
IDispatch **  pSummaryInfo 
)
static

Definition at line 1362 of file automation.c.

1363 {
1364  VARIANT varresult;
1365  VARIANTARG vararg[1];
1366  DISPPARAMS dispparams = {vararg, NULL, ARRAY_SIZE(vararg), 0};
1367  HRESULT hr;
1368 
1369  VariantInit(&vararg[0]);
1370  V_VT(&vararg[0]) = VT_I4;
1371  V_I4(&vararg[0]) = iUpdateCount;
1372 
1373  hr = invoke(pDatabase, "SummaryInformation", DISPATCH_PROPERTYGET, &dispparams, &varresult, VT_DISPATCH);
1374  *pSummaryInfo = V_DISPATCH(&varresult);
1375  return hr;
1376 }
Definition: compat.h:2157
#define DISPATCH_PROPERTYGET
Definition: oleauto.h:1007
HRESULT hr
Definition: shlfolder.c:183
void WINAPI VariantInit(VARIANTARG *pVarg)
Definition: variant.c:568
#define V_I4(A)
Definition: oleauto.h:247
#define V_DISPATCH(A)
Definition: oleauto.h:239
LONG HRESULT
Definition: typedefs.h:79
static HRESULT invoke(IDispatch *pDispatch, LPCSTR szName, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, VARTYPE vtResult)
Definition: automation.c:840
#define V_VT(A)
Definition: oleauto.h:211
#define ARRAY_SIZE(a)
Definition: main.h:24
#define NULL
Definition: types.h:112
struct stdole::DISPPARAMS DISPPARAMS

Referenced by test_Database().

◆ DEFINE_GUID()

DEFINE_GUID ( GUID_NULL  ,
,
,
,
,
,
,
,
,
,
,
 
)

◆ delete_key()

static DWORD delete_key ( HKEY  hkey)
static

Definition at line 1998 of file automation.c.

1999 {
2000  char name[MAX_PATH];
2001  DWORD ret;
2002 
2003  while (!(ret = RegEnumKeyA(hkey, 0, name, sizeof(name))))
2004  {
2005  HKEY tmp;
2006  if (!(ret = RegOpenKeyExA( hkey, name, 0, KEY_ENUMERATE_SUB_KEYS, &tmp )))
2007  {
2008  ret = delete_key( tmp );
2009  RegCloseKey( tmp );
2010  }
2011  if (ret) break;
2012  }
2013  if (ret != ERROR_NO_MORE_ITEMS) return ret;
2014  RegDeleteKeyA( hkey, "" );
2015  return 0;
2016 }
#define ERROR_NO_MORE_ITEMS
Definition: compat.h:105
static DWORD delete_key(HKEY hkey)
Definition: automation.c:1998
LONG WINAPI RegOpenKeyExA(_In_ HKEY hKey, _In_ LPCSTR lpSubKey, _In_ DWORD ulOptions, _In_ REGSAM samDesired, _Out_ PHKEY phkResult)
Definition: reg.c:3321
#define MAX_PATH
Definition: compat.h:34
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
LONG WINAPI RegEnumKeyA(HKEY hKey, DWORD dwIndex, LPSTR lpName, DWORD cbName)
Definition: reg.c:2391
LONG WINAPI RegDeleteKeyA(_In_ HKEY hKey, _In_ LPCSTR lpSubKey)
Definition: reg.c:1222
Definition: name.c:38
#define RegCloseKey(hKey)
Definition: registry.h:47
#define KEY_ENUMERATE_SUB_KEYS
Definition: nt_native.h:1019

Referenced by test_Installer_RegistryValue().

◆ delete_key_portable()

static LONG delete_key_portable ( HKEY  key,
LPCSTR  subkey,
REGSAM  access 
)
static

Definition at line 257 of file automation.c.

258 {
259  if (pRegDeleteKeyExA)
260  return pRegDeleteKeyExA( key, subkey, access, 0 );
261  return RegDeleteKeyA( key, subkey );
262 }
LONG WINAPI RegDeleteKeyA(_In_ HKEY hKey, _In_ LPCSTR lpSubKey)
Definition: reg.c:1222
GLuint GLint GLboolean GLint GLenum access
Definition: glext.h:7866
Definition: copy.c:22

Referenced by delete_registry_key(), and test_Installer_InstallProduct().

◆ delete_pf()

static BOOL delete_pf ( const CHAR rel_path,
BOOL  is_file 
)
static

Definition at line 414 of file automation.c.

415 {
416  CHAR path[MAX_PATH];
417 
419  lstrcatA(path, "\\");
420  lstrcatA(path, rel_path);
421 
422  if (is_file)
423  return DeleteFileA(path);
424  else
425  return RemoveDirectoryA(path);
426 }
static char PROG_FILES_DIR[MAX_PATH]
Definition: automation.c:362
char CHAR
Definition: xmlstorage.h:175
BOOL WINAPI DeleteFileA(IN LPCSTR lpFileName)
Definition: delete.c:24
LPSTR WINAPI lstrcatA(LPSTR lpString1, LPCSTR lpString2)
Definition: lstring.c:123
#define MAX_PATH
Definition: compat.h:34
LPSTR WINAPI lstrcpyA(LPSTR lpString1, LPCSTR lpString2)
Definition: lstring.c:100
BOOL WINAPI RemoveDirectoryA(IN LPCSTR lpPathName)
Definition: dir.c:714

Referenced by test_concurrentinstall(), test_create_remove_shortcut(), test_delete_services(), test_duplicate_files(), test_find_related_products(), test_ini_values(), test_install_remove_odbc(), test_install_services(), test_Installer_InstallProduct(), test_move_files(), test_MsiConfigureProductEx(), test_process_components(), test_publish_components(), test_publish_features(), test_publish_product(), test_register_class_info(), test_register_extension_info(), test_register_font(), test_register_mime_info(), test_register_product(), test_register_progid_info(), test_register_typelib(), test_register_user(), test_remove_duplicate_files(), test_remove_existing_products(), test_remove_files(), test_self_registration(), test_setpropertyfolder(), test_sourcedir_props(), test_start_stop_services(), and test_validate_product_id().

◆ delete_registry_key()

static UINT delete_registry_key ( HKEY  hkeyParent,
LPCSTR  subkey,
REGSAM  access 
)
static

Definition at line 2326 of file automation.c.

2327 {
2328  UINT ret;
2329  CHAR *string = NULL;
2330  HKEY hkey;
2331  DWORD dwSize;
2332 
2333  ret = RegOpenKeyExA(hkeyParent, subkey, 0, access, &hkey);
2334  if (ret != ERROR_SUCCESS) return ret;
2336  if (ret != ERROR_SUCCESS) return ret;
2337  if (!(string = malloc(++dwSize))) return ERROR_NOT_ENOUGH_MEMORY;
2338 
2339  while (RegEnumKeyA(hkey, 0, string, dwSize) == ERROR_SUCCESS)
2340  delete_registry_key(hkey, string, access);
2341 
2342  RegCloseKey(hkey);
2343  free(string);
2344  delete_key_portable(hkeyParent, subkey, access);
2345  return ERROR_SUCCESS;
2346 }
#define ERROR_SUCCESS
Definition: deptool.c:10
LONG WINAPI RegQueryInfoKeyA(HKEY hKey, LPSTR lpClass, LPDWORD lpcClass, LPDWORD lpReserved, LPDWORD lpcSubKeys, LPDWORD lpcMaxSubKeyLen, LPDWORD lpcMaxClassLen, LPDWORD lpcValues, LPDWORD lpcMaxValueNameLen, LPDWORD lpcMaxValueLen, LPDWORD lpcbSecurityDescriptor, PFILETIME lpftLastWriteTime)
Definition: reg.c:3611
char CHAR
Definition: xmlstorage.h:175
#define free
Definition: debug_ros.c:5
LONG WINAPI RegOpenKeyExA(_In_ HKEY hKey, _In_ LPCSTR lpSubKey, _In_ DWORD ulOptions, _In_ REGSAM samDesired, _Out_ PHKEY phkResult)
Definition: reg.c:3321
#define ERROR_NOT_ENOUGH_MEMORY
Definition: dderror.h:7
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
LONG WINAPI RegEnumKeyA(HKEY hKey, DWORD dwIndex, LPSTR lpName, DWORD cbName)
Definition: reg.c:2391
static LONG delete_key_portable(HKEY key, LPCSTR subkey, REGSAM access)
Definition: automation.c:257
GLuint GLint GLboolean GLint GLenum access
Definition: glext.h:7866
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
#define malloc
Definition: debug_ros.c:4
static UINT delete_registry_key(HKEY hkeyParent, LPCSTR subkey, REGSAM access)
Definition: automation.c:2326
#define RegCloseKey(hKey)
Definition: registry.h:47
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
Definition: env.c:56

Referenced by test_Installer_InstallProduct().

◆ delete_test_files()

static void delete_test_files ( void  )
static

Definition at line 428 of file automation.c.

429 {
431  DeleteFileA("msitest\\cabout\\new\\five.txt");
432  DeleteFileA("msitest\\cabout\\four.txt");
433  DeleteFileA("msitest\\second\\three.txt");
434  DeleteFileA("msitest\\first\\two.txt");
435  DeleteFileA("msitest\\one.txt");
436  DeleteFileA("msitest\\filename");
437  RemoveDirectoryA("msitest\\cabout\\new");
438  RemoveDirectoryA("msitest\\cabout");
439  RemoveDirectoryA("msitest\\second");
440  RemoveDirectoryA("msitest\\first");
441  RemoveDirectoryA("msitest");
442 }
BOOL WINAPI DeleteFileA(IN LPCSTR lpFileName)
Definition: delete.c:24
static const char * msifile
Definition: automation.c:47
BOOL WINAPI RemoveDirectoryA(IN LPCSTR lpPathName)
Definition: dir.c:714

Referenced by test_Installer_InstallProduct().

◆ find_registry_key()

static UINT find_registry_key ( HKEY  hkeyParent,
LPCSTR  subkey,
LPCSTR  findkey,
REGSAM  access,
HKEY phkey 
)
static

Definition at line 2349 of file automation.c.

2350 {
2351  UINT ret;
2352  CHAR *string = NULL;
2353  int idx = 0;
2354  HKEY hkey;
2355  DWORD dwSize;
2356  BOOL found = FALSE;
2357 
2358  *phkey = 0;
2359 
2360  ret = RegOpenKeyExA(hkeyParent, subkey, 0, access, &hkey);
2361  if (ret != ERROR_SUCCESS) return ret;
2363  if (ret != ERROR_SUCCESS) return ret;
2364  if (!(string = malloc(++dwSize))) return ERROR_NOT_ENOUGH_MEMORY;
2365 
2366  while (!found &&
2367  RegEnumKeyA(hkey, idx++, string, dwSize) == ERROR_SUCCESS)
2368  {
2369  if (!strcmp(string, findkey))
2370  {
2371  *phkey = hkey;
2372  found = TRUE;
2373  }
2374  else if (find_registry_key(hkey, string, findkey, access, phkey) == ERROR_SUCCESS) found = TRUE;
2375  }
2376 
2377  if (*phkey != hkey) RegCloseKey(hkey);
2378  free(string);
2379  return (found ? ERROR_SUCCESS : ERROR_FILE_NOT_FOUND);
2380 }
#define ERROR_SUCCESS
Definition: deptool.c:10
#define TRUE
Definition: types.h:120
LONG WINAPI RegQueryInfoKeyA(HKEY hKey, LPSTR lpClass, LPDWORD lpcClass, LPDWORD lpReserved, LPDWORD lpcSubKeys, LPDWORD lpcMaxSubKeyLen, LPDWORD lpcMaxClassLen, LPDWORD lpcValues, LPDWORD lpcMaxValueNameLen, LPDWORD lpcMaxValueLen, LPDWORD lpcbSecurityDescriptor, PFILETIME lpftLastWriteTime)
Definition: reg.c:3611
char CHAR
Definition: xmlstorage.h:175
#define free
Definition: debug_ros.c:5
LONG WINAPI RegOpenKeyExA(_In_ HKEY hKey, _In_ LPCSTR lpSubKey, _In_ DWORD ulOptions, _In_ REGSAM samDesired, _Out_ PHKEY phkResult)
Definition: reg.c:3321
#define ERROR_NOT_ENOUGH_MEMORY
Definition: dderror.h:7
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
static UINT find_registry_key(HKEY hkeyParent, LPCSTR subkey, LPCSTR findkey, REGSAM access, HKEY *phkey)
Definition: automation.c:2349
unsigned int idx
Definition: utils.c:41
#define ERROR_FILE_NOT_FOUND
Definition: disk.h:79
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
LONG WINAPI RegEnumKeyA(HKEY hKey, DWORD dwIndex, LPSTR lpName, DWORD cbName)
Definition: reg.c:2391
GLuint GLint GLboolean GLint GLenum access
Definition: glext.h:7866
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
#define malloc
Definition: debug_ros.c:4
#define RegCloseKey(hKey)
Definition: registry.h:47
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
Definition: env.c:56

Referenced by test_Installer_InstallProduct().

◆ get_dispid()

static DISPID get_dispid ( IDispatch disp,
const char name 
)
static

Definition at line 501 of file automation.c.

502 {
503  LPOLESTR str;
504  UINT len;
505  DISPID id = -1;
506  HRESULT r;
507 
508  len = MultiByteToWideChar(CP_ACP, 0, name, -1, NULL, 0 );
509  str = malloc( len * sizeof(WCHAR) );
510  if (str)
511  {
512  MultiByteToWideChar(CP_ACP, 0, name, -1, str, len );
513  r = IDispatch_GetIDsOfNames( disp, &IID_NULL, &str, 1, 0, &id );
514  free( str );
515  if (r != S_OK)
516  return -1;
517  }
518 
519  return id;
520 }
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
#define CP_ACP
Definition: compat.h:109
#define free
Definition: debug_ros.c:5
static LPOLESTR
Definition: stg_prop.c:27
const WCHAR * str
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:79
#define IID_NULL
Definition: guiddef.h:98
GLenum GLsizei len
Definition: glext.h:6722
#define S_OK
Definition: intsafe.h:52
static VARIANTARG static DISPID
Definition: ordinal.c:49
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
#define MultiByteToWideChar
Definition: compat.h:110
Definition: name.c:38
GLenum GLuint id
Definition: glext.h:5579
#define malloc
Definition: debug_ros.c:4

Referenced by test_dispid().

◆ get_program_files_dir()

static BOOL get_program_files_dir ( LPSTR  buf)
static

Definition at line 364 of file automation.c.

365 {
366  HKEY hkey;
368 
369  if (RegOpenKeyA(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Windows\\CurrentVersion", &hkey))
370  return FALSE;
371 
372  size = MAX_PATH;
373  if (RegQueryValueExA(hkey, "ProgramFilesDir (x86)", 0, &type, (LPBYTE)buf, &size) &&
374  RegQueryValueExA(hkey, "ProgramFilesDir", 0, &type, (LPBYTE)buf, &size))
375  return FALSE;
376 
377  RegCloseKey(hkey);
378  return TRUE;
379 }
LONG WINAPI RegOpenKeyA(HKEY hKey, LPCSTR lpSubKey, PHKEY phkResult)
Definition: reg.c:3257
LONG WINAPI RegQueryValueExA(_In_ HKEY hkeyorg, _In_ LPCSTR name, _In_ LPDWORD reserved, _Out_opt_ LPDWORD type, _Out_opt_ LPBYTE data, _Inout_opt_ LPDWORD count)
Definition: reg.c:4027
#define TRUE
Definition: types.h:120
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
unsigned char * LPBYTE
Definition: typedefs.h:53
#define FALSE
Definition: types.h:117
GLsizeiptr size
Definition: glext.h:5919
#define MAX_PATH
Definition: compat.h:34
unsigned long DWORD
Definition: ntddk_ex.h:95
#define REG_EXPAND_SZ
Definition: nt_native.h:1494
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
#define RegCloseKey(hKey)
Definition: registry.h:47
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12

Referenced by START_TEST().

◆ init_functionpointers()

static void init_functionpointers ( void  )
static

Definition at line 205 of file automation.c.

206 {
207  HMODULE hadvapi32 = GetModuleHandleA("advapi32.dll");
208  HMODULE hkernel32 = GetModuleHandleA("kernel32.dll");
209 
210 #define GET_PROC(dll, func) \
211  p ## func = (void *)GetProcAddress(dll, #func); \
212  if(!p ## func) \
213  trace("GetProcAddress(%s) failed\n", #func);
214 
215  GET_PROC(hadvapi32, RegDeleteKeyExA)
217 
218 #undef GET_PROC
219 }
LONG WINAPI RegDeleteKeyExA(_In_ HKEY hKey, _In_ LPCSTR lpSubKey, _In_ REGSAM samDesired, _In_ DWORD Reserved)
Definition: reg.c:1252
static HINSTANCE hkernel32
Definition: process.c:66
#define GET_PROC(dll, func)
BOOL WINAPI IsWow64Process(IN HANDLE hProcess, OUT PBOOL Wow64Process)
Definition: proc.c:1975
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
Definition: loader.c:812

Referenced by START_TEST().

◆ Installer_CreateRecord()

static HRESULT Installer_CreateRecord ( int  count,
IDispatch **  pRecord 
)
static

Definition at line 882 of file automation.c.

883 {
884  VARIANT varresult;
885  VARIANTARG vararg[1];
886  DISPPARAMS dispparams = {vararg, NULL, ARRAY_SIZE(vararg), 0};
887  HRESULT hr;
888 
889  VariantInit(&vararg[0]);
890  V_VT(&vararg[0]) = VT_I4;
891  V_I4(&vararg[0]) = count;
892 
893  hr = invoke(pInstaller, "CreateRecord", DISPATCH_METHOD, &dispparams, &varresult, VT_DISPATCH);
894  *pRecord = V_DISPATCH(&varresult);
895  return hr;
896 }
Definition: compat.h:2157
HRESULT hr
Definition: shlfolder.c:183
GLuint GLuint GLsizei count
Definition: gl.h:1545
void WINAPI VariantInit(VARIANTARG *pVarg)
Definition: variant.c:568
#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:79
static HRESULT invoke(IDispatch *pDispatch, LPCSTR szName, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, VARTYPE vtResult)
Definition: automation.c:840
static IDispatch * pInstaller
Definition: automation.c:55
#define V_VT(A)
Definition: oleauto.h:211
#define ARRAY_SIZE(a)
Definition: main.h:24
#define NULL
Definition: types.h:112
struct stdole::DISPPARAMS DISPPARAMS

Referenced by test_Installer(), and test_Session().

◆ Installer_InstallProduct()

static HRESULT Installer_InstallProduct ( LPCWSTR  szPackagePath,
LPCWSTR  szPropertyValues 
)
static

Definition at line 1000 of file automation.c.

1001 {
1002  VARIANT varresult;
1003  VARIANTARG vararg[2];
1004  DISPPARAMS dispparams = {vararg, NULL, ARRAY_SIZE(vararg), 0};
1005 
1006  VariantInit(&vararg[1]);
1007  V_VT(&vararg[1]) = VT_BSTR;
1008  V_BSTR(&vararg[1]) = SysAllocString(szPackagePath);
1009  VariantInit(&vararg[0]);
1010  V_VT(&vararg[0]) = VT_BSTR;
1011  V_BSTR(&vararg[0]) = SysAllocString(szPropertyValues);
1012 
1013  return invoke(pInstaller, "InstallProduct", DISPATCH_METHOD, &dispparams, &varresult, VT_EMPTY);
1014 }
void WINAPI VariantInit(VARIANTARG *pVarg)
Definition: variant.c:568
#define DISPATCH_METHOD
Definition: oleauto.h:1006
BSTR WINAPI SysAllocString(LPCOLESTR str)
Definition: oleaut.c:238
static HRESULT invoke(IDispatch *pDispatch, LPCSTR szName, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, VARTYPE vtResult)
Definition: automation.c:840
static IDispatch * pInstaller
Definition: automation.c:55
#define V_VT(A)
Definition: oleauto.h:211
#define V_BSTR(A)
Definition: oleauto.h:226
#define ARRAY_SIZE(a)
Definition: main.h:24
#define NULL
Definition: types.h:112
struct stdole::DISPPARAMS DISPPARAMS

Referenced by test_Installer_InstallProduct().

◆ Installer_OpenDatabase()

static HRESULT Installer_OpenDatabase ( LPCWSTR  szDatabasePath,
int  openmode,
IDispatch **  pDatabase 
)
static

Definition at line 981 of file automation.c.

982 {
983  VARIANT varresult;
984  VARIANTARG vararg[2];
985  DISPPARAMS dispparams = {vararg, NULL, ARRAY_SIZE(vararg), 0};
986  HRESULT hr;
987 
988  VariantInit(&vararg[1]);
989  V_VT(&vararg[1]) = VT_BSTR;
990  V_BSTR(&vararg[1]) = SysAllocString(szDatabasePath);
991  VariantInit(&vararg[0]);
992  V_VT(&vararg[0]) = VT_I4;
993  V_I4(&vararg[0]) = openmode;
994 
995  hr = invoke(pInstaller, "OpenDatabase", DISPATCH_METHOD, &dispparams, &varresult, VT_DISPATCH);
996  *pDatabase = V_DISPATCH(&varresult);
997  return hr;
998 }
Definition: compat.h:2157
HRESULT hr
Definition: shlfolder.c:183
void WINAPI VariantInit(VARIANTARG *pVarg)
Definition: variant.c:568
#define V_I4(A)
Definition: oleauto.h:247
#define DISPATCH_METHOD
Definition: oleauto.h:1006
#define V_DISPATCH(A)
Definition: oleauto.h:239
BSTR WINAPI SysAllocString(LPCOLESTR str)
Definition: oleaut.c:238
LONG HRESULT
Definition: typedefs.h:79
static HRESULT invoke(IDispatch *pDispatch, LPCSTR szName, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, VARTYPE vtResult)
Definition: automation.c:840
static IDispatch * pInstaller
Definition: automation.c:55
#define V_VT(A)
Definition: oleauto.h:211
#define V_BSTR(A)
Definition: oleauto.h:226
#define ARRAY_SIZE(a)
Definition: main.h:24
#define NULL
Definition: types.h:112
struct stdole::DISPPARAMS DISPPARAMS

Referenced by test_Installer().

◆ Installer_OpenPackage()

static HRESULT Installer_OpenPackage ( LPCWSTR  szPackagePath,
int  options,
IDispatch **  pSession 
)
static

Definition at line 962 of file automation.c.

963 {
964  VARIANT varresult;
965  VARIANTARG vararg[2];
966  DISPPARAMS dispparams = {vararg, NULL, ARRAY_SIZE(vararg), 0};
967  HRESULT hr;
968 
969  VariantInit(&vararg[1]);
970  V_VT(&vararg[1]) = VT_BSTR;
971  V_BSTR(&vararg[1]) = SysAllocString(szPackagePath);
972  VariantInit(&vararg[0]);
973  V_VT(&vararg[0]) = VT_I4;
974  V_I4(&vararg[0]) = options;
975 
976  hr = invoke(pInstaller, "OpenPackage", DISPATCH_METHOD, &dispparams, &varresult, VT_DISPATCH);
977  *pSession = V_DISPATCH(&varresult);
978  return hr;
979 }
Definition: compat.h:2157
HRESULT hr
Definition: shlfolder.c:183
void WINAPI VariantInit(VARIANTARG *pVarg)
Definition: variant.c:568
#define V_I4(A)
Definition: oleauto.h:247
#define DISPATCH_METHOD
Definition: oleauto.h:1006
#define V_DISPATCH(A)
Definition: oleauto.h:239
BSTR WINAPI SysAllocString(LPCOLESTR str)
Definition: oleaut.c:238
int options
Definition: main.c:106
LONG HRESULT
Definition: typedefs.h:79
static HRESULT invoke(IDispatch *pDispatch, LPCSTR szName, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, VARTYPE vtResult)
Definition: automation.c:840
static IDispatch * pInstaller
Definition: automation.c:55
#define V_VT(A)
Definition: oleauto.h:211
#define V_BSTR(A)
Definition: oleauto.h:226
#define ARRAY_SIZE(a)
Definition: main.h:24
#define NULL
Definition: types.h:112
struct stdole::DISPPARAMS DISPPARAMS

Referenced by test_Installer().

◆ Installer_ProductInfo()

static HRESULT Installer_ProductInfo ( LPCWSTR  szProduct,
LPCWSTR  szAttribute,
LPWSTR  szString 
)
static

Definition at line 1033 of file automation.c.

1034 {
1035  VARIANT varresult;
1036  VARIANTARG vararg[2];
1037  DISPPARAMS dispparams = {vararg, NULL, ARRAY_SIZE(vararg), 0};
1038  HRESULT hr;
1039 
1040  VariantInit(&vararg[1]);
1041  V_VT(&vararg[1]) = VT_BSTR;
1042  V_BSTR(&vararg[1]) = SysAllocString(szProduct);
1043  VariantInit(&vararg[0]);
1044  V_VT(&vararg[0]) = VT_BSTR;
1045  V_BSTR(&vararg[0]) = SysAllocString(szAttribute);
1046 
1047  hr = invoke(pInstaller, "ProductInfo", DISPATCH_PROPERTYGET, &dispparams, &varresult, VT_BSTR);
1048  if (V_BSTR(&varresult)) lstrcpyW(szString, V_BSTR(&varresult));
1049  VariantClear(&varresult);
1050  return hr;
1051 }
#define DISPATCH_PROPERTYGET
Definition: oleauto.h:1007
HRESULT hr
Definition: shlfolder.c:183
void WINAPI VariantInit(VARIANTARG *pVarg)
Definition: variant.c:568
static const WCHAR szAttribute[]
Definition: domdoc.c:1179
BSTR WINAPI SysAllocString(LPCOLESTR str)
Definition: oleaut.c:238
LONG HRESULT
Definition: typedefs.h:79
static HRESULT invoke(IDispatch *pDispatch, LPCSTR szName, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, VARTYPE vtResult)
Definition: automation.c:840
static IDispatch * pInstaller
Definition: automation.c:55
HRESULT WINAPI DECLSPEC_HOTPATCH VariantClear(VARIANTARG *pVarg)
Definition: variant.c:648
#define V_VT(A)
Definition: oleauto.h:211
#define V_BSTR(A)
Definition: oleauto.h:226
#define lstrcpyW
Definition: compat.h:608
#define ARRAY_SIZE(a)
Definition: main.h:24
#define NULL
Definition: types.h:112
struct stdole::DISPPARAMS DISPPARAMS

Referenced by test_Installer(), and test_Installer_InstallProduct().

◆ Installer_Products()

static HRESULT Installer_Products ( IDispatch **  pStringList)
static

Definition at line 1053 of file automation.c.

1054 {
1055  VARIANT varresult;
1056  DISPPARAMS dispparams = {NULL, NULL, 0, 0};
1057  HRESULT hr;
1058 
1059  hr = invoke(pInstaller, "Products", DISPATCH_PROPERTYGET, &dispparams, &varresult, VT_DISPATCH);
1060  *pStringList = V_DISPATCH(&varresult);
1061  return hr;
1062 }
#define DISPATCH_PROPERTYGET
Definition: oleauto.h:1007
HRESULT hr
Definition: shlfolder.c:183
#define V_DISPATCH(A)
Definition: oleauto.h:239
LONG HRESULT
Definition: typedefs.h:79
static HRESULT invoke(IDispatch *pDispatch, LPCSTR szName, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, VARTYPE vtResult)
Definition: automation.c:840
static IDispatch * pInstaller
Definition: automation.c:55
#define NULL
Definition: types.h:112
struct stdole::DISPPARAMS DISPPARAMS

Referenced by test_Installer_Products().

◆ Installer_ProductState()

static HRESULT Installer_ProductState ( LPCWSTR  szProduct,
int pInstallState 
)
static

Definition at line 1016 of file automation.c.

1017 {
1018  VARIANT varresult;
1019  VARIANTARG vararg[1];
1020  DISPPARAMS dispparams = {vararg, NULL, ARRAY_SIZE(vararg), 0};
1021  HRESULT hr;
1022 
1023  VariantInit(&vararg[0]);
1024  V_VT(&vararg[0]) = VT_BSTR;
1025  V_BSTR(&vararg[0]) = SysAllocString(szProduct);
1026 
1027  hr = invoke(pInstaller, "ProductState", DISPATCH_PROPERTYGET, &dispparams, &varresult, VT_I4);
1028  *pInstallState = V_I4(&varresult);
1029  VariantClear(&varresult);
1030  return hr;
1031 }
Definition: compat.h:2157
#define DISPATCH_PROPERTYGET
Definition: oleauto.h:1007
HRESULT hr
Definition: shlfolder.c:183
void WINAPI VariantInit(VARIANTARG *pVarg)
Definition: variant.c:568
#define V_I4(A)
Definition: oleauto.h:247
BSTR WINAPI SysAllocString(LPCOLESTR str)
Definition: oleaut.c:238
LONG HRESULT
Definition: typedefs.h:79
static HRESULT invoke(IDispatch *pDispatch, LPCSTR szName, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, VARTYPE vtResult)
Definition: automation.c:840
static IDispatch * pInstaller
Definition: automation.c:55
HRESULT WINAPI DECLSPEC_HOTPATCH VariantClear(VARIANTARG *pVarg)
Definition: variant.c:648
#define V_VT(A)
Definition: oleauto.h:211
#define V_BSTR(A)
Definition: oleauto.h:226
#define ARRAY_SIZE(a)
Definition: main.h:24
#define NULL
Definition: types.h:112
struct stdole::DISPPARAMS DISPPARAMS

Referenced by test_Installer(), test_Installer_InstallProduct(), and test_Installer_Products().

◆ Installer_RegistryValue()

static HRESULT Installer_RegistryValue ( HKEY  hkey,
LPCWSTR  szKey,
VARIANT  vValue,
VARIANT pVarResult,
VARTYPE  vtExpect 
)
static

Definition at line 898 of file automation.c.

899 {
900  VARIANTARG vararg[3];
901  DISPPARAMS dispparams = {vararg, NULL, ARRAY_SIZE(vararg), 0};
902 
903  VariantInit(&vararg[2]);
904  V_VT(&vararg[2]) = VT_I4;
905  V_I4(&vararg[2]) = (INT_PTR)hkey;
906  VariantInit(&vararg[1]);
907  V_VT(&vararg[1]) = VT_BSTR;
908  V_BSTR(&vararg[1]) = SysAllocString(szKey);
909  VariantInit(&vararg[0]);
910  VariantCopy(&vararg[0], &vValue);
911  VariantClear(&vValue);
912 
913  return invoke(pInstaller, "RegistryValue", DISPATCH_METHOD, &dispparams, pVarResult, vtExpect);
914 }
Definition: compat.h:2157
void WINAPI VariantInit(VARIANTARG *pVarg)
Definition: variant.c:568
int32_t INT_PTR
Definition: typedefs.h:64
#define V_I4(A)
Definition: oleauto.h:247
#define DISPATCH_METHOD
Definition: oleauto.h:1006
BSTR WINAPI SysAllocString(LPCOLESTR str)
Definition: oleaut.c:238
static HRESULT invoke(IDispatch *pDispatch, LPCSTR szName, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, VARTYPE vtResult)
Definition: automation.c:840
static IDispatch * pInstaller
Definition: automation.c:55
HRESULT WINAPI DECLSPEC_HOTPATCH VariantClear(VARIANTARG *pVarg)
Definition: variant.c:648
#define V_VT(A)
Definition: oleauto.h:211
#define V_BSTR(A)
Definition: oleauto.h:226
#define ARRAY_SIZE(a)
Definition: main.h:24
#define NULL
Definition: types.h:112
struct stdole::DISPPARAMS DISPPARAMS
HRESULT WINAPI VariantCopy(VARIANTARG *pvargDest, VARIANTARG *pvargSrc)
Definition: variant.c:748

Referenced by Installer_RegistryValueE(), Installer_RegistryValueI(), Installer_RegistryValueW(), and test_Installer_RegistryValue().

◆ Installer_RegistryValueE()

static HRESULT Installer_RegistryValueE ( HKEY  hkey,
LPCWSTR  szKey,
BOOL pBool 
)
static

Definition at line 916 of file automation.c.

917 {
918  VARIANT varresult;
919  VARIANTARG vararg;
920  HRESULT hr;
921 
922  VariantInit(&vararg);
923  V_VT(&vararg) = VT_EMPTY;
924  hr = Installer_RegistryValue(hkey, szKey, vararg, &varresult, VT_BOOL);
925  *pBool = V_BOOL(&varresult);
926  VariantClear(&varresult);
927  return hr;
928 }
HRESULT hr
Definition: shlfolder.c:183
void WINAPI VariantInit(VARIANTARG *pVarg)
Definition: variant.c:568
LONG HRESULT
Definition: typedefs.h:79
#define V_BOOL(A)
Definition: oleauto.h:224
static HRESULT Installer_RegistryValue(HKEY hkey, LPCWSTR szKey, VARIANT vValue, VARIANT *pVarResult, VARTYPE vtExpect)
Definition: automation.c:898
HRESULT WINAPI DECLSPEC_HOTPATCH VariantClear(VARIANTARG *pVarg)
Definition: variant.c:648
#define V_VT(A)
Definition: oleauto.h:211

Referenced by test_Installer_RegistryValue().

◆ Installer_RegistryValueI()

static HRESULT Installer_RegistryValueI ( HKEY  hkey,
LPCWSTR  szKey,
int  iValue,
LPWSTR  szString,
VARTYPE  vtResult 
)
static

Definition at line 946 of file automation.c.

947 {
948  VARIANT varresult;
949  VARIANTARG vararg;
950  HRESULT hr;
951 
952  VariantInit(&vararg);
953  V_VT(&vararg) = VT_I4;
954  V_I4(&vararg) = iValue;
955 
956  hr = Installer_RegistryValue(hkey, szKey, vararg, &varresult, vtResult);
957  if (SUCCEEDED(hr) && vtResult == VT_BSTR) lstrcpyW(szString, V_BSTR(&varresult));
958  VariantClear(&varresult);
959  return hr;
960 }
Definition: compat.h:2157
HRESULT hr
Definition: shlfolder.c:183
void WINAPI VariantInit(VARIANTARG *pVarg)
Definition: variant.c:568
#define V_I4(A)
Definition: oleauto.h:247
if SUCCEEDED(hr)
LONG HRESULT
Definition: typedefs.h:79
static HRESULT Installer_RegistryValue(HKEY hkey, LPCWSTR szKey, VARIANT vValue, VARIANT *pVarResult, VARTYPE vtExpect)
Definition: automation.c:898
HRESULT WINAPI DECLSPEC_HOTPATCH VariantClear(VARIANTARG *pVarg)
Definition: variant.c:648
#define V_VT(A)
Definition: oleauto.h:211
#define V_BSTR(A)
Definition: oleauto.h:226
#define lstrcpyW
Definition: compat.h:608

Referenced by test_Installer_RegistryValue().

◆ Installer_RegistryValueW()

static HRESULT Installer_RegistryValueW ( HKEY  hkey,
LPCWSTR  szKey,
LPCWSTR  szValue,
LPWSTR  szString 
)
static

Definition at line 930 of file automation.c.

931 {
932  VARIANT varresult;
933  VARIANTARG vararg;
934  HRESULT hr;
935 
936  VariantInit(&vararg);
937  V_VT(&vararg) = VT_BSTR;
938  V_BSTR(&vararg) = SysAllocString(szValue);
939 
940  hr = Installer_RegistryValue(hkey, szKey, vararg, &varresult, VT_BSTR);
941  if (V_BSTR(&varresult)) lstrcpyW(szString, V_BSTR(&varresult));
942  VariantClear(&varresult);
943  return hr;
944 }
HRESULT hr
Definition: shlfolder.c:183
void WINAPI VariantInit(VARIANTARG *pVarg)
Definition: variant.c:568
BSTR WINAPI SysAllocString(LPCOLESTR str)
Definition: oleaut.c:238
LONG HRESULT
Definition: typedefs.h:79
static HRESULT Installer_RegistryValue(HKEY hkey, LPCWSTR szKey, VARIANT vValue, VARIANT *pVarResult, VARTYPE vtExpect)
Definition: automation.c:898
HRESULT WINAPI DECLSPEC_HOTPATCH VariantClear(VARIANTARG *pVarg)
Definition: variant.c:648
#define V_VT(A)
Definition: oleauto.h:211
#define V_BSTR(A)
Definition: oleauto.h:226
#define lstrcpyW
Definition: compat.h:608

Referenced by test_Installer_RegistryValue().

◆ Installer_RelatedProducts()

static HRESULT Installer_RelatedProducts ( LPCWSTR  szProduct,
IDispatch **  pStringList 
)
static

Definition at line 1064 of file automation.c.

1065 {
1066  VARIANT varresult;
1067  VARIANTARG vararg[1];
1068  DISPPARAMS dispparams = {vararg, NULL, ARRAY_SIZE(vararg), 0};
1069  HRESULT hr;
1070 
1071  VariantInit(&vararg[0]);
1072  V_VT(&vararg[0]) = VT_BSTR;
1073  V_BSTR(&vararg[0]) = SysAllocString(szProduct);
1074 
1075  hr = invoke(pInstaller, "RelatedProducts", DISPATCH_PROPERTYGET, &dispparams, &varresult, VT_DISPATCH);
1076  *pStringList = V_DISPATCH(&varresult);
1077  return hr;
1078 }
#define DISPATCH_PROPERTYGET
Definition: oleauto.h:1007
HRESULT hr
Definition: shlfolder.c:183
void WINAPI VariantInit(VARIANTARG *pVarg)
Definition: variant.c:568
#define V_DISPATCH(A)
Definition: oleauto.h:239
BSTR WINAPI SysAllocString(LPCOLESTR str)
Definition: oleaut.c:238
LONG HRESULT
Definition: typedefs.h:79
static HRESULT invoke(IDispatch *pDispatch, LPCSTR szName, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, VARTYPE vtResult)
Definition: automation.c:840
static IDispatch * pInstaller
Definition: automation.c:55
#define V_VT(A)
Definition: oleauto.h:211
#define V_BSTR(A)
Definition: oleauto.h:226
#define ARRAY_SIZE(a)
Definition: main.h:24
#define NULL
Definition: types.h:112
struct stdole::DISPPARAMS DISPPARAMS

Referenced by test_Installer(), and test_Installer_InstallProduct().

◆ Installer_SummaryInformation()

static HRESULT Installer_SummaryInformation ( BSTR  PackagePath,
int  UpdateCount,
IDispatch **  pSumInfo 
)
static

Definition at line 1106 of file automation.c.

1107 {
1108  VARIANT varresult;
1109  VARIANTARG vararg[2];
1110  DISPPARAMS dispparams = {vararg, NULL, ARRAY_SIZE(vararg), 0};
1111  HRESULT hr;
1112 
1113  VariantInit(&vararg[1]);
1114  V_VT(&vararg[1]) = VT_BSTR;
1115  V_BSTR(&vararg[1]) = SysAllocString(PackagePath);
1116  VariantInit(&vararg[0]);
1117  V_VT(&vararg[0]) = VT_I4;
1118  V_I4(&vararg[0]) = UpdateCount;
1119 
1120  hr = invoke(pInstaller, "SummaryInformation", DISPATCH_PROPERTYGET, &dispparams, &varresult, VT_DISPATCH);
1121  *pSumInfo = V_DISPATCH(&varresult);
1122  return hr;
1123 }
Definition: compat.h:2157
#define DISPATCH_PROPERTYGET
Definition: oleauto.h:1007
HRESULT hr
Definition: shlfolder.c:183
void WINAPI VariantInit(VARIANTARG *pVarg)
Definition: variant.c:568
#define V_I4(A)
Definition: oleauto.h:247
#define V_DISPATCH(A)
Definition: oleauto.h:239
BSTR WINAPI SysAllocString(LPCOLESTR str)
Definition: oleaut.c:238
LONG HRESULT
Definition: typedefs.h:79
static HRESULT invoke(IDispatch *pDispatch, LPCSTR szName, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, VARTYPE vtResult)
Definition: automation.c:840
static IDispatch * pInstaller
Definition: automation.c:55
#define V_VT(A)
Definition: oleauto.h:211
#define V_BSTR(A)
Definition: oleauto.h:226
#define ARRAY_SIZE(a)
Definition: main.h:24
#define NULL
Definition: types.h:112
struct stdole::DISPPARAMS DISPPARAMS

Referenced by test_Installer().

◆ Installer_UILevelPut()

static HRESULT Installer_UILevelPut ( int  level)
static

Definition at line 1092 of file automation.c.

1093 {
1094  VARIANT varresult;
1095  VARIANTARG vararg;
1096  DISPID dispid = DISPID_PROPERTYPUT;
1097  DISPPARAMS dispparams = {&vararg, &dispid, sizeof(vararg)/sizeof(VARIANTARG), 1};
1098 
1099  VariantInit(&vararg);
1100  V_VT(&vararg) = VT_I4;
1101  V_I4(&vararg) = level;
1102 
1103  return invoke(pInstaller, "UILevel", DISPATCH_PROPERTYPUT, &dispparams, &varresult, VT_EMPTY);
1104 }
GLint level
Definition: gl.h:1546
Definition: compat.h:2157
void WINAPI VariantInit(VARIANTARG *pVarg)
Definition: variant.c:568
#define V_I4(A)
Definition: oleauto.h:247
#define DISPATCH_PROPERTYPUT
Definition: oleauto.h:1008
static HRESULT invoke(IDispatch *pDispatch, LPCSTR szName, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, VARTYPE vtResult)
Definition: automation.c:840
static IDispatch * pInstaller
Definition: automation.c:55
#define V_VT(A)
Definition: oleauto.h:211
static VARIANTARG static DISPID
Definition: ordinal.c:49
struct stdole::DISPPARAMS DISPPARAMS

Referenced by test_Installer_InstallProduct().

◆ Installer_VersionGet()

static HRESULT Installer_VersionGet ( LPWSTR  szVersion)
static

Definition at line 1080 of file automation.c.

1081 {
1082  VARIANT varresult;
1083  DISPPARAMS dispparams = {NULL, NULL, 0, 0};
1084  HRESULT hr;
1085 
1086  hr = invoke(pInstaller, "Version", DISPATCH_PROPERTYGET, &dispparams, &varresult, VT_BSTR);
1087  if (V_BSTR(&varresult)) lstrcpyW(szVersion, V_BSTR(&varresult));
1088  VariantClear(&varresult);
1089  return hr;
1090 }
#define DISPATCH_PROPERTYGET
Definition: oleauto.h:1007
HRESULT hr
Definition: shlfolder.c:183
LONG HRESULT
Definition: typedefs.h:79
static HRESULT invoke(IDispatch *pDispatch, LPCSTR szName, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, VARTYPE vtResult)
Definition: automation.c:840
static IDispatch * pInstaller
Definition: automation.c:55
static LPCWSTR szVersion
Definition: asmcache.c:748
HRESULT WINAPI DECLSPEC_HOTPATCH VariantClear(VARIANTARG *pVarg)
Definition: variant.c:648
#define V_BSTR(A)
Definition: oleauto.h:226
#define lstrcpyW
Definition: compat.h:608
#define NULL
Definition: types.h:112
struct stdole::DISPPARAMS DISPPARAMS

Referenced by test_Installer().

◆ invoke()

static HRESULT invoke ( IDispatch pDispatch,
LPCSTR  szName,
WORD  wFlags,
DISPPARAMS *  pDispParams,
VARIANT pVarResult,
VARTYPE  vtResult 
)
static

Definition at line 840 of file automation.c.

841 {
842  OLECHAR *name = NULL;
843  DISPID dispid;
844  HRESULT hr;
845  UINT i;
846  UINT len;
847 
848  memset(pVarResult, 0, sizeof(VARIANT));
849  VariantInit(pVarResult);
850 
851  len = MultiByteToWideChar(CP_ACP, 0, szName, -1, NULL, 0 );
852  name = malloc(len * sizeof(WCHAR));
853  if (!name) return E_FAIL;
855  hr = IDispatch_GetIDsOfNames(pDispatch, &IID_NULL, &name, 1, LOCALE_USER_DEFAULT, &dispid);
856  free(name);
857  ok(hr == S_OK, "IDispatch::GetIDsOfNames returned %#lx\n", hr);
858  if (hr != S_OK) return hr;
859 
860  memset(&excepinfo, 0, sizeof(excepinfo));
861  hr = IDispatch_Invoke(pDispatch, dispid, &IID_NULL, LOCALE_NEUTRAL, wFlags, pDispParams, pVarResult, &excepinfo, NULL);
862 
863  if (hr == S_OK)
864  {
866  ok(V_VT(pVarResult) == vtResult, "Variant result type is %d, expected %d\n", V_VT(pVarResult), vtResult);
867  if (vtResult != VT_EMPTY)
868  {
869  hr = VariantChangeTypeEx(pVarResult, pVarResult, LOCALE_NEUTRAL, 0, vtResult);
870  ok(hr == S_OK, "VariantChangeTypeEx returned %#lx\n", hr);
871  }
872  }
873 
874  for (i=0; i<pDispParams->cArgs; i++)
875  VariantClear(&pDispParams->rgvarg[i]);
876 
877  return hr;
878 }
WCHAR OLECHAR
Definition: compat.h:2151
static const WCHAR szName[]
Definition: powrprof.c:45
HRESULT hr
Definition: shlfolder.c:183
#define CP_ACP
Definition: compat.h:109
#define LOCALE_USER_DEFAULT
#define free
Definition: debug_ros.c:5
void WINAPI VariantInit(VARIANTARG *pVarg)
Definition: variant.c:568
#define E_FAIL
Definition: ddrawi.h:102
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:79
#define todo_wine_if(is_todo)
Definition: custom.c:76
static int _invoke_todo_vtResult
Definition: automation.c:838
HRESULT WINAPI DECLSPEC_HOTPATCH VariantClear(VARIANTARG *pVarg)
Definition: variant.c:648
#define IID_NULL
Definition: guiddef.h:98
#define V_VT(A)
Definition: oleauto.h:211
GLenum GLsizei len
Definition: glext.h:6722
_In_ DWORD _Out_ _In_ WORD wFlags
Definition: wincon.h:531
#define S_OK
Definition: intsafe.h:52
static VARIANTARG static DISPID
Definition: ordinal.c:49
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 ok(value,...)
Definition: atltest.h:57
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
#define MultiByteToWideChar
Definition: compat.h:110
Definition: name.c:38
static EXCEPINFO excepinfo
Definition: automation.c:50
#define LOCALE_NEUTRAL
#define malloc
Definition: debug_ros.c:4
#define memset(x, y, z)
Definition: compat.h:39
HRESULT WINAPI VariantChangeTypeEx(VARIANTARG *pvargDest, VARIANTARG *pvargSrc, LCID lcid, USHORT wFlags, VARTYPE vt)
Definition: variant.c:988

Referenced by Database_OpenView(), Database_SummaryInformation(), Installer_CreateRecord(), Installer_InstallProduct(), Installer_OpenDatabase(), Installer_OpenPackage(), Installer_ProductInfo(), Installer_Products(), Installer_ProductState(), Installer_RegistryValue(), Installer_RelatedProducts(), Installer_SummaryInformation(), Installer_UILevelPut(), Installer_VersionGet(), Record_FieldCountGet(), Record_IntegerDataGet(), Record_IntegerDataPut(), Record_StringDataGet(), Record_StringDataPut(), Session_Database(), Session_DoAction(), Session_EvaluateCondition(), Session_FeatureCurrentState(), Session_FeatureRequestStateGet(), Session_FeatureRequestStatePut(), Session_Installer(), Session_LanguageGet(), Session_Message(), Session_ModeGet(), Session_ModePut(), Session_PropertyGet(), Session_PropertyPut(), Session_SetInstallLevel(), StringList__NewEnum(), StringList_Count(), StringList_Item(), SummaryInfo_PropertyCountGet(), SummaryInfo_PropertyGet(), SummaryInfo_PropertyPut(), View_Close(), View_Execute(), View_Fetch(), and View_Modify().

◆ is_process_limited()

static BOOL is_process_limited ( void  )
static

Definition at line 221 of file automation.c.

222 {
224  PSID Group = NULL;
225  BOOL IsInGroup;
226  HANDLE token;
227 
229  DOMAIN_ALIAS_RID_ADMINS, 0, 0, 0, 0, 0, 0, &Group) ||
230  !CheckTokenMembership(NULL, Group, &IsInGroup))
231  {
232  trace("Could not check if the current user is an administrator\n");
233  FreeSid(Group);
234  return FALSE;
235  }
236  FreeSid(Group);
237 
238  if (!IsInGroup)
239  {
240  /* Only administrators have enough privileges for these tests */
241  return TRUE;
242  }
243 
245  {
246  BOOL ret;
248  DWORD size;
249 
252  return (ret && type == TokenElevationTypeLimited);
253  }
254  return FALSE;
255 }
enum _TOKEN_ELEVATION_TYPE TOKEN_ELEVATION_TYPE
#define CloseHandle
Definition: compat.h:598
#define TRUE
Definition: types.h:120
_In_opt_ PSID Group
Definition: rtlfuncs.h:1632
BOOL WINAPI CheckTokenMembership(IN HANDLE ExistingTokenHandle, IN PSID SidToCheck, OUT PBOOL IsMember)
Definition: token.c:21
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
PVOID WINAPI FreeSid(PSID pSid)
Definition: security.c:700
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 token
Definition: glfuncs.h:210
#define SECURITY_NT_AUTHORITY
Definition: setypes.h:554
GLsizeiptr size
Definition: glext.h:5919
#define trace
Definition: atltest.h:70
#define SECURITY_BUILTIN_DOMAIN_RID
Definition: setypes.h:581
#define TOKEN_QUERY
Definition: setypes.h:924
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
static SID_IDENTIFIER_AUTHORITY NtAuthority
Definition: security.c:40
#define GetCurrentProcess()
Definition: compat.h:618
#define NULL
Definition: types.h:112
BOOL WINAPI OpenProcessToken(HANDLE ProcessHandle, DWORD DesiredAccess, PHANDLE TokenHandle)
Definition: security.c:296
BOOL WINAPI GetTokenInformation(HANDLE TokenHandle, TOKEN_INFORMATION_CLASS TokenInformationClass, LPVOID TokenInformation, DWORD TokenInformationLength, PDWORD ReturnLength)
Definition: security.c:413
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
#define DOMAIN_ALIAS_RID_ADMINS
Definition: setypes.h:652
BOOL WINAPI AllocateAndInitializeSid(PSID_IDENTIFIER_AUTHORITY pIdentifierAuthority, BYTE nSubAuthorityCount, DWORD nSubAuthority0, DWORD nSubAuthority1, DWORD nSubAuthority2, DWORD nSubAuthority3, DWORD nSubAuthority4, DWORD nSubAuthority5, DWORD nSubAuthority6, DWORD nSubAuthority7, PSID *pSid)
Definition: security.c:676

Referenced by test_Installer_InstallProduct().

◆ LONG()

static LONG ( WINAPI pRegDeleteKeyExA)
static

◆ Record_FieldCountGet()

static HRESULT Record_FieldCountGet ( IDispatch pRecord,
int pFieldCount 
)
static

Definition at line 1425 of file automation.c.

1426 {
1427  VARIANT varresult;
1428  DISPPARAMS dispparams = {NULL, NULL, 0, 0};
1429  HRESULT hr = invoke(pRecord, "FieldCount", DISPATCH_PROPERTYGET, &dispparams, &varresult, VT_I4);
1430  *pFieldCount = V_I4(&varresult);
1431  VariantClear(&varresult);
1432  return hr;
1433 }
Definition: compat.h:2157
#define DISPATCH_PROPERTYGET
Definition: oleauto.h:1007
HRESULT hr
Definition: shlfolder.c:183
#define V_I4(A)
Definition: oleauto.h:247
LONG HRESULT
Definition: typedefs.h:79
static HRESULT invoke(IDispatch *pDispatch, LPCSTR szName, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, VARTYPE vtResult)
Definition: automation.c:840
HRESULT WINAPI DECLSPEC_HOTPATCH VariantClear(VARIANTARG *pVarg)
Definition: variant.c:648
#define NULL
Definition: types.h:112
struct stdole::DISPPARAMS DISPPARAMS

Referenced by test_Installer().

◆ Record_IntegerDataGet()

static HRESULT Record_IntegerDataGet ( IDispatch pRecord,
int  iField,
int pValue 
)
static

Definition at line 1469 of file automation.c.

1470 {
1471  VARIANT varresult;
1472  VARIANTARG vararg[1];
1473  DISPPARAMS dispparams = {vararg, NULL, ARRAY_SIZE(vararg), 0};
1474  HRESULT hr;
1475 
1476  VariantInit(&vararg[0]);
1477  V_VT(&vararg[0]) = VT_I4;
1478  V_I4(&vararg[0]) = iField;
1479 
1480  hr = invoke(pRecord, "IntegerData", DISPATCH_PROPERTYGET, &dispparams, &varresult, VT_I4);
1481  *pValue = V_I4(&varresult);
1482  VariantClear(&varresult);
1483  return hr;
1484 }
Definition: compat.h:2157
#define DISPATCH_PROPERTYGET
Definition: oleauto.h:1007
HRESULT hr
Definition: shlfolder.c:183
PWCHAR pValue
void WINAPI VariantInit(VARIANTARG *pVarg)
Definition: variant.c:568
#define V_I4(A)
Definition: oleauto.h:247
LONG HRESULT
Definition: typedefs.h:79
static HRESULT invoke(IDispatch *pDispatch, LPCSTR szName, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, VARTYPE vtResult)
Definition: automation.c:840
HRESULT WINAPI DECLSPEC_HOTPATCH VariantClear(VARIANTARG *pVarg)
Definition: variant.c:648
#define V_VT(A)
Definition: oleauto.h:211
#define ARRAY_SIZE(a)
Definition: main.h:24
#define NULL
Definition: types.h:112
struct stdole::DISPPARAMS DISPPARAMS

Referenced by test_Installer().

◆ Record_IntegerDataPut()

static HRESULT Record_IntegerDataPut ( IDispatch pRecord,
int  iField,
int  iValue 
)
static

Definition at line 1486 of file automation.c.

1487 {
1488  VARIANT varresult;
1489  VARIANTARG vararg[2];
1490  DISPID dispid = DISPID_PROPERTYPUT;
1491  DISPPARAMS dispparams = {vararg, &dispid, ARRAY_SIZE(vararg), 1};
1492 
1493  VariantInit(&vararg[1]);
1494  V_VT(&vararg[1]) = VT_I4;
1495  V_I4(&vararg[1]) = iField;
1496  VariantInit(&vararg[0]);
1497  V_VT(&vararg[0]) = VT_I4;
1498  V_I4(&vararg[0]) = iValue;
1499 
1500  return invoke(pRecord, "IntegerData", DISPATCH_PROPERTYPUT, &dispparams, &varresult, VT_EMPTY);
1501 }
Definition: compat.h:2157
void WINAPI VariantInit(VARIANTARG *pVarg)
Definition: variant.c:568
#define V_I4(A)
Definition: oleauto.h:247
#define DISPATCH_PROPERTYPUT
Definition: oleauto.h:1008
static HRESULT invoke(IDispatch *pDispatch, LPCSTR szName, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, VARTYPE vtResult)
Definition: automation.c:840
#define V_VT(A)
Definition: oleauto.h:211
static VARIANTARG static DISPID
Definition: ordinal.c:49
#define ARRAY_SIZE(a)
Definition: main.h:24
struct stdole::DISPPARAMS DISPPARAMS

Referenced by test_Installer().

◆ Record_StringDataGet()

static HRESULT Record_StringDataGet ( IDispatch pRecord,
int  iField,
LPWSTR  szString 
)
static

Definition at line 1435 of file automation.c.

1436 {
1437  VARIANT varresult;
1438  VARIANTARG vararg[1];
1439  DISPPARAMS dispparams = {vararg, NULL, ARRAY_SIZE(vararg), 0};
1440  HRESULT hr;
1441 
1442  VariantInit(&vararg[0]);
1443  V_VT(&vararg[0]) = VT_I4;
1444  V_I4(&vararg[0]) = iField;
1445 
1446  hr = invoke(pRecord, "StringData", DISPATCH_PROPERTYGET, &dispparams, &varresult, VT_BSTR);
1447  if (V_BSTR(&varresult)) lstrcpyW(szString, V_BSTR(&varresult));
1448  VariantClear(&varresult);
1449  return hr;
1450 }
Definition: compat.h:2157
#define DISPATCH_PROPERTYGET
Definition: oleauto.h:1007
HRESULT hr
Definition: shlfolder.c:183
void WINAPI VariantInit(VARIANTARG *pVarg)
Definition: variant.c:568
#define V_I4(A)
Definition: oleauto.h:247
LONG HRESULT
Definition: typedefs.h:79
static HRESULT invoke(IDispatch *pDispatch, LPCSTR szName, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, VARTYPE vtResult)
Definition: automation.c:840
HRESULT WINAPI DECLSPEC_HOTPATCH VariantClear(VARIANTARG *pVarg)
Definition: variant.c:648
#define V_VT(A)
Definition: oleauto.h:211
#define V_BSTR(A)
Definition: oleauto.h:226
#define lstrcpyW
Definition: compat.h:608
#define ARRAY_SIZE(a)
Definition: main.h:24
#define NULL
Definition: types.h:112
struct stdole::DISPPARAMS DISPPARAMS

Referenced by test_Database().

◆ Record_StringDataPut()

static HRESULT Record_StringDataPut ( IDispatch pRecord,
int  iField,
LPCWSTR  szString 
)
static

Definition at line 1452 of file automation.c.

1453 {
1454  VARIANT varresult;
1455  VARIANTARG vararg[2];
1456  DISPID dispid = DISPID_PROPERTYPUT;
1457  DISPPARAMS dispparams = {vararg, &dispid, ARRAY_SIZE(vararg), 1};
1458 
1459  VariantInit(&vararg[1]);
1460  V_VT(&vararg[1]) = VT_I4;
1461  V_I4(&vararg[1]) = iField;
1462  VariantInit(&vararg[0]);
1463  V_VT(&vararg[0]) = VT_BSTR;
1464  V_BSTR(&vararg[0]) = SysAllocString(szString);
1465 
1466  return invoke(pRecord, "StringData", DISPATCH_PROPERTYPUT, &dispparams, &varresult, VT_EMPTY);
1467 }
Definition: compat.h:2157
void WINAPI VariantInit(VARIANTARG *pVarg)
Definition: variant.c:568
#define V_I4(A)
Definition: oleauto.h:247
BSTR WINAPI SysAllocString(LPCOLESTR str)
Definition: oleaut.c:238
#define DISPATCH_PROPERTYPUT
Definition: oleauto.h:1008
static HRESULT invoke(IDispatch *pDispatch, LPCSTR szName, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, VARTYPE vtResult)
Definition: automation.c:840
#define V_VT(A)
Definition: oleauto.h:211
#define V_BSTR(A)
Definition: oleauto.h:226
static VARIANTARG static DISPID
Definition: ordinal.c:49
#define ARRAY_SIZE(a)
Definition: main.h:24
struct stdole::DISPPARAMS DISPPARAMS

Referenced by test_Database().

◆ Session_Database()

static HRESULT Session_Database ( IDispatch pSession,
IDispatch **  pDatabase 
)
static

Definition at line 1216 of file automation.c.

1217 {
1218  VARIANT varresult;
1219  DISPPARAMS dispparams = {NULL, NULL, 0, 0};
1220  HRESULT hr;
1221 
1222  hr = invoke(pSession, "Database", DISPATCH_PROPERTYGET, &dispparams, &varresult, VT_DISPATCH);
1223  *pDatabase = V_DISPATCH(&varresult);
1224  return hr;
1225 }
#define DISPATCH_PROPERTYGET
Definition: oleauto.h:1007
HRESULT hr
Definition: shlfolder.c:183
#define V_DISPATCH(A)
Definition: oleauto.h:239
LONG HRESULT
Definition: typedefs.h:79
static HRESULT invoke(IDispatch *pDispatch, LPCSTR szName, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, VARTYPE vtResult)
Definition: automation.c:840
#define NULL
Definition: types.h:112
struct stdole::DISPPARAMS DISPPARAMS

Referenced by test_Session().

◆ Session_DoAction()

static HRESULT Session_DoAction ( IDispatch pSession,
LPCWSTR  szAction,
int iReturn 
)
static

Definition at line 1227 of file automation.c.

1228 {
1229  VARIANT varresult;
1230  VARIANTARG vararg[1];
1231  DISPPARAMS dispparams = {vararg, NULL, ARRAY_SIZE(vararg), 0};
1232  HRESULT hr;
1233 
1234  VariantInit(&vararg[0]);
1235  V_VT(&vararg[0]) = VT_BSTR;
1236  V_BSTR(&vararg[0]) = SysAllocString(szAction);
1237 
1238  hr = invoke(pSession, "DoAction", DISPATCH_METHOD, &dispparams, &varresult, VT_I4);
1239  *iReturn = V_I4(&varresult);
1240  VariantClear(&varresult);
1241  return hr;
1242 }
Definition: compat.h:2157
HRESULT hr
Definition: shlfolder.c:183
void WINAPI VariantInit(VARIANTARG *pVarg)
Definition: variant.c:568
#define V_I4(A)
Definition: oleauto.h:247
#define DISPATCH_METHOD
Definition: oleauto.h:1006
BSTR WINAPI SysAllocString(LPCOLESTR str)
Definition: oleaut.c:238
LONG HRESULT
Definition: typedefs.h:79
static HRESULT invoke(IDispatch *pDispatch, LPCSTR szName, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, VARTYPE vtResult)
Definition: automation.c:840
HRESULT WINAPI DECLSPEC_HOTPATCH VariantClear(VARIANTARG *pVarg)
Definition: variant.c:648
#define V_VT(A)
Definition: oleauto.h:211
#define V_BSTR(A)
Definition: oleauto.h:226
#define ARRAY_SIZE(a)
Definition: main.h:24
#define NULL
Definition: types.h:112
struct stdole::DISPPARAMS DISPPARAMS

Referenced by test_Session().

◆ Session_EvaluateCondition()

static HRESULT Session_EvaluateCondition ( IDispatch pSession,
LPCWSTR  szCondition,
int iReturn 
)
static

Definition at line 1244 of file automation.c.

1245 {
1246  VARIANT varresult;
1247  VARIANTARG vararg[1];
1248  DISPPARAMS dispparams = {vararg, NULL, ARRAY_SIZE(vararg), 0};
1249  HRESULT hr;
1250 
1251  VariantInit(&vararg[0]);
1252  V_VT(&vararg[0]) = VT_BSTR;
1253  V_BSTR(&vararg[0]) = SysAllocString(szCondition);
1254 
1255  hr = invoke(pSession, "EvaluateCondition", DISPATCH_METHOD, &dispparams, &varresult, VT_I4);
1256  *iReturn = V_I4(&varresult);
1257  VariantClear(&varresult);
1258  return hr;
1259 }
Definition: compat.h:2157
HRESULT hr
Definition: shlfolder.c:183
void WINAPI VariantInit(VARIANTARG *pVarg)
Definition: variant.c:568
#define V_I4(A)
Definition: oleauto.h:247
#define DISPATCH_METHOD
Definition: oleauto.h:1006
BSTR WINAPI SysAllocString(LPCOLESTR str)
Definition: oleaut.c:238
LONG HRESULT
Definition: typedefs.h:79
static HRESULT invoke(IDispatch *pDispatch, LPCSTR szName, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, VARTYPE vtResult)
Definition: automation.c:840
HRESULT WINAPI DECLSPEC_HOTPATCH VariantClear(VARIANTARG *pVarg)
Definition: variant.c:648
#define V_VT(A)
Definition: oleauto.h:211
#define V_BSTR(A)
Definition: oleauto.h:226
#define ARRAY_SIZE(a)
Definition: main.h:24
#define NULL
Definition: types.h:112
struct stdole::DISPPARAMS DISPPARAMS

Referenced by test_Session().

◆ Session_FeatureCurrentState()

static HRESULT Session_FeatureCurrentState ( IDispatch pSession,
LPCWSTR  szName,
int pState 
)
static

Definition at line 1295 of file automation.c.

1296 {
1297  VARIANT varresult;
1298  VARIANTARG vararg[1];
1299  DISPPARAMS dispparams = {vararg, NULL, ARRAY_SIZE(vararg), 0};
1300  HRESULT hr;
1301 
1302  VariantInit(&vararg[0]);
1303  V_VT(&vararg[0]) = VT_BSTR;
1304  V_BSTR(&vararg[0]) = SysAllocString(szName);
1305 
1306  hr = invoke(pSession, "FeatureCurrentState", DISPATCH_PROPERTYGET, &dispparams, &varresult, VT_I4);
1307  *pState = V_I4(&varresult);
1308  VariantClear(&varresult);
1309  return hr;
1310 }
static const WCHAR szName[]
Definition: powrprof.c:45
Definition: compat.h:2157
#define DISPATCH_PROPERTYGET
Definition: oleauto.h:1007
HRESULT hr
Definition: shlfolder.c:183
void WINAPI VariantInit(VARIANTARG *pVarg)
Definition: variant.c:568
#define V_I4(A)
Definition: oleauto.h:247
BSTR WINAPI SysAllocString(LPCOLESTR str)
Definition: oleaut.c:238
LONG HRESULT
Definition: typedefs.h:79
static HRESULT invoke(IDispatch *pDispatch, LPCSTR szName, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, VARTYPE vtResult)
Definition: automation.c:840
HRESULT WINAPI DECLSPEC_HOTPATCH VariantClear(VARIANTARG *pVarg)
Definition: variant.c:648
#define V_VT(A)
Definition: oleauto.h:211
#define V_BSTR(A)
Definition: oleauto.h:226
#define ARRAY_SIZE(a)
Definition: main.h:24
#define NULL
Definition: types.h:112
struct stdole::DISPPARAMS DISPPARAMS

Referenced by test_Session().

◆ Session_FeatureRequestStateGet()

static HRESULT Session_FeatureRequestStateGet ( IDispatch pSession,
LPCWSTR  szName,
int pState 
)
static

Definition at line 1312 of file automation.c.

1313 {
1314  VARIANT varresult;
1315  VARIANTARG vararg[1];
1316  DISPPARAMS dispparams = {vararg, NULL, ARRAY_SIZE(vararg), 0};
1317  HRESULT hr;
1318 
1319  VariantInit(&vararg[0]);
1320  V_VT(&vararg[0]) = VT_BSTR;
1321  V_BSTR(&vararg[0]) = SysAllocString(szName);
1322 
1323  hr = invoke(pSession, "FeatureRequestState", DISPATCH_PROPERTYGET, &dispparams, &varresult, VT_I4);
1324  *pState = V_I4(&varresult);
1325  VariantClear(&varresult);
1326  return hr;
1327 }
static const WCHAR szName[]
Definition: powrprof.c:45
Definition: compat.h:2157
#define DISPATCH_PROPERTYGET
Definition: oleauto.h:1007
HRESULT hr
Definition: shlfolder.c:183
void WINAPI VariantInit(VARIANTARG *pVarg)
Definition: variant.c:568
#define V_I4(A)
Definition: oleauto.h:247
BSTR WINAPI SysAllocString(LPCOLESTR str)
Definition: oleaut.c:238
LONG HRESULT
Definition: typedefs.h:79
static HRESULT invoke(IDispatch *pDispatch, LPCSTR szName, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, VARTYPE vtResult)
Definition: automation.c:840
HRESULT WINAPI DECLSPEC_HOTPATCH VariantClear(VARIANTARG *pVarg)
Definition: variant.c:648
#define V_VT(A)
Definition: oleauto.h:211
#define V_BSTR(A)
Definition: oleauto.h:226
#define ARRAY_SIZE(a)
Definition: main.h:24
#define NULL
Definition: types.h:112
struct stdole::DISPPARAMS DISPPARAMS

Referenced by test_Session().

◆ Session_FeatureRequestStatePut()

static HRESULT Session_FeatureRequestStatePut ( IDispatch pSession,
LPCWSTR  szName,
int  iState 
)
static

Definition at line 1329 of file automation.c.

1330 {
1331  VARIANT varresult;
1332  VARIANTARG vararg[2];
1333  DISPID dispid = DISPID_PROPERTYPUT;
1334  DISPPARAMS dispparams = {vararg, &dispid, ARRAY_SIZE(vararg), 1};
1335 
1336  VariantInit(&vararg[1]);
1337  V_VT(&vararg[1]) = VT_BSTR;
1338  V_BSTR(&vararg[1]) = SysAllocString(szName);
1339  VariantInit(&vararg[0]);
1340  V_VT(&vararg[0]) = VT_I4;
1341  V_I4(&vararg[0]) = iState;
1342 
1343  return invoke(pSession, "FeatureRequestState", DISPATCH_PROPERTYPUT, &dispparams, &varresult, VT_EMPTY);
1344 }
static const WCHAR szName[]
Definition: powrprof.c:45
Definition: compat.h:2157
void WINAPI VariantInit(VARIANTARG *pVarg)
Definition: variant.c:568
#define V_I4(A)
Definition: oleauto.h:247
BSTR WINAPI SysAllocString(LPCOLESTR str)
Definition: oleaut.c:238
#define DISPATCH_PROPERTYPUT
Definition: oleauto.h:1008
static HRESULT invoke(IDispatch *pDispatch, LPCSTR szName, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, VARTYPE vtResult)
Definition: automation.c:840
#define V_VT(A)
Definition: oleauto.h:211
#define V_BSTR(A)
Definition: oleauto.h:226
static VARIANTARG static DISPID
Definition: ordinal.c:49
#define ARRAY_SIZE(a)
Definition: main.h:24
struct stdole::DISPPARAMS DISPPARAMS

Referenced by test_Session().

◆ Session_Installer()

static HRESULT Session_Installer ( IDispatch pSession,
IDispatch **  pInst 
)
static

Definition at line 1125 of file automation.c.

1126 {
1127  VARIANT varresult;
1128  DISPPARAMS dispparams = {NULL, NULL, 0, 0};
1129  HRESULT hr;
1130 
1131  hr = invoke(pSession, "Installer", DISPATCH_PROPERTYGET, &dispparams, &varresult, VT_DISPATCH);
1132  *pInst = V_DISPATCH(&varresult);
1133  return hr;
1134 }
#define DISPATCH_PROPERTYGET
Definition: oleauto.h:1007
HRESULT hr
Definition: shlfolder.c:183
#define V_DISPATCH(A)
Definition: oleauto.h:239
LONG HRESULT
Definition: typedefs.h:79
static HRESULT invoke(IDispatch *pDispatch, LPCSTR szName, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, VARTYPE vtResult)
Definition: automation.c:840
#define NULL
Definition: types.h:112
struct stdole::DISPPARAMS DISPPARAMS

Referenced by test_Session().

◆ Session_LanguageGet()

static HRESULT Session_LanguageGet ( IDispatch pSession,
UINT pLangId 
)
static

Definition at line 1170 of file automation.c.

1171 {
1172  VARIANT varresult;
1173  DISPPARAMS dispparams = {NULL, NULL, 0, 0};
1174  HRESULT hr;
1175 
1176  hr = invoke(pSession, "Language", DISPATCH_PROPERTYGET, &dispparams, &varresult, VT_I4);
1177  *pLangId = V_I4(&varresult);
1178  VariantClear(&varresult);
1179  return hr;
1180 }
Definition: compat.h:2157
#define DISPATCH_PROPERTYGET
Definition: oleauto.h:1007
HRESULT hr
Definition: shlfolder.c:183
#define V_I4(A)
Definition: oleauto.h:247
LONG HRESULT
Definition: typedefs.h:79
static HRESULT invoke(IDispatch *pDispatch, LPCSTR szName, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, VARTYPE vtResult)
Definition: automation.c:840
HRESULT WINAPI DECLSPEC_HOTPATCH VariantClear(VARIANTARG *pVarg)
Definition: variant.c:648
#define NULL
Definition: types.h:112
struct stdole::DISPPARAMS DISPPARAMS

Referenced by test_Session().

◆ Session_Message()

static HRESULT Session_Message ( IDispatch pSession,
LONG  kind,
IDispatch record,
int ret 
)
static

Definition at line 1261 of file automation.c.

1262 {
1263  VARIANT varresult;
1264  VARIANTARG vararg[2];
1265  DISPPARAMS dispparams = {vararg, NULL, ARRAY_SIZE(vararg), 0};
1266  HRESULT hr;
1267 
1268  VariantInit(&varresult);
1269  V_VT(vararg) = VT_DISPATCH;
1270  V_DISPATCH(vararg) = record;
1271  V_VT(vararg+1) = VT_I4;
1272  V_I4(vararg+1) = kind;
1273 
1274  hr = invoke(pSession, "Message", DISPATCH_METHOD, &dispparams, &varresult, VT_I4);
1275 
1276  ok(V_VT(&varresult) == VT_I4, "V_VT(varresult) = %d\n", V_VT(&varresult));
1277  *ret = V_I4(&varresult);
1278 
1279  return hr;
1280 }
Definition: compat.h:2157
HRESULT hr
Definition: shlfolder.c:183
void WINAPI VariantInit(VARIANTARG *pVarg)
Definition: variant.c:568
#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:79
static HRESULT invoke(IDispatch *pDispatch, LPCSTR szName, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, VARTYPE vtResult)
Definition: automation.c:840
int ret
#define V_VT(A)
Definition: oleauto.h:211
#define ARRAY_SIZE(a)
Definition: main.h:24
#define ok(value,...)
Definition: atltest.h:57
#define NULL
Definition: types.h:112
struct stdole::DISPPARAMS DISPPARAMS

Referenced by test_Session().

◆ Session_ModeGet()

static HRESULT Session_ModeGet ( IDispatch pSession,
int  iFlag,
VARIANT_BOOL mode 
)
static

Definition at line 1182 of file automation.c.

1183 {
1184  VARIANT varresult;
1185  VARIANTARG vararg[1];
1186  DISPPARAMS dispparams = {vararg, NULL, ARRAY_SIZE(vararg), 0};
1187  HRESULT hr;
1188 
1189  VariantInit(&vararg[0]);
1190  V_VT(&vararg[0]) = VT_I4;
1191  V_I4(&vararg[0]) = iFlag;
1192 
1193  hr = invoke(pSession, "Mode", DISPATCH_PROPERTYGET, &dispparams, &varresult, VT_BOOL);
1194  *mode = V_BOOL(&varresult);
1195  VariantClear(&varresult);
1196  return hr;
1197 }
Definition: compat.h:2157
#define DISPATCH_PROPERTYGET
Definition: oleauto.h:1007
HRESULT hr
Definition: shlfolder.c:183
void WINAPI VariantInit(VARIANTARG *pVarg)
Definition: variant.c:568
#define V_I4(A)
Definition: oleauto.h:247
LONG HRESULT
Definition: typedefs.h:79
static HRESULT invoke(IDispatch *pDispatch, LPCSTR szName, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, VARTYPE vtResult)
Definition: automation.c:840
#define V_BOOL(A)
Definition: oleauto.h:224
HRESULT WINAPI DECLSPEC_HOTPATCH VariantClear(VARIANTARG *pVarg)
Definition: variant.c:648
#define V_VT(A)
Definition: oleauto.h:211
GLenum mode
Definition: glext.h:6217
#define ARRAY_SIZE(a)
Definition: main.h:24
#define NULL
Definition: types.h:112
struct stdole::DISPPARAMS DISPPARAMS

Referenced by test_Session().

◆ Session_ModePut()

static HRESULT Session_ModePut ( IDispatch pSession,
int  iFlag,
VARIANT_BOOL  mode 
)
static

Definition at line 1199 of file automation.c.

1200 {
1201  VARIANT varresult;
1202  VARIANTARG vararg[2];
1203  DISPID dispid = DISPID_PROPERTYPUT;
1204  DISPPARAMS dispparams = {vararg, &dispid, ARRAY_SIZE(vararg), 1};
1205 
1206  VariantInit(&vararg[1]);
1207  V_VT(&vararg[1]) = VT_I4;
1208  V_I4(&vararg[1]) = iFlag;
1209  VariantInit(&vararg[0]);
1210  V_VT(&vararg[0]) = VT_BOOL;
1211  V_BOOL(&vararg[0]) = mode;
1212 
1213  return invoke(pSession, "Mode", DISPATCH_PROPERTYPUT, &dispparams, &varresult, VT_EMPTY);
1214 }
Definition: compat.h:2157
void WINAPI VariantInit(VARIANTARG *pVarg)
Definition: variant.c:568
#define V_I4(A)
Definition: oleauto.h:247
#define DISPATCH_PROPERTYPUT
Definition: oleauto.h:1008
static HRESULT invoke(IDispatch *pDispatch, LPCSTR szName, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, VARTYPE vtResult)
Definition: automation.c:840
#define V_BOOL(A)
Definition: oleauto.h:224
#define V_VT(A)
Definition: oleauto.h:211
GLenum mode
Definition: glext.h:6217
static VARIANTARG static DISPID
Definition: ordinal.c:49
#define ARRAY_SIZE(a)
Definition: main.h:24
struct stdole::DISPPARAMS DISPPARAMS

Referenced by test_Session().

◆ Session_PropertyGet()

static HRESULT Session_PropertyGet ( IDispatch pSession,
LPCWSTR  szName,
LPWSTR  szReturn 
)
static

Definition at line 1136 of file automation.c.

1137 {
1138  VARIANT varresult;
1139  VARIANTARG vararg[1];
1140  DISPPARAMS dispparams = {vararg, NULL, ARRAY_SIZE(vararg), 0};
1141  HRESULT hr;
1142 
1143  VariantInit(&vararg[0]);
1144  V_VT(&vararg[0]) = VT_BSTR;
1145  V_BSTR(&vararg[0]) = SysAllocString(szName);
1146 
1147  hr = invoke(pSession, "Property", DISPATCH_PROPERTYGET, &dispparams, &varresult, VT_BSTR);
1148  if (V_BSTR(&varresult)) lstrcpyW(szReturn, V_BSTR(&varresult));
1149  VariantClear(&varresult);
1150  return hr;
1151 }
static const WCHAR szName[]
Definition: powrprof.c:45
#define DISPATCH_PROPERTYGET
Definition: oleauto.h:1007
HRESULT hr
Definition: shlfolder.c:183
void WINAPI VariantInit(VARIANTARG *pVarg)
Definition: variant.c:568
BSTR WINAPI SysAllocString(LPCOLESTR str)
Definition: oleaut.c:238
LONG HRESULT
Definition: typedefs.h:79
static HRESULT invoke(IDispatch *pDispatch, LPCSTR szName, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, VARTYPE vtResult)
Definition: automation.c:840
HRESULT WINAPI DECLSPEC_HOTPATCH VariantClear(VARIANTARG *pVarg)
Definition: variant.c:648
#define V_VT(A)
Definition: oleauto.h:211
#define V_BSTR(A)
Definition: oleauto.h:226
#define lstrcpyW
Definition: compat.h:608
#define ARRAY_SIZE(a)
Definition: main.h:24
#define NULL
Definition: types.h:112
struct stdole::DISPPARAMS DISPPARAMS

Referenced by test_Session().

◆ Session_PropertyPut()

static HRESULT Session_PropertyPut ( IDispatch pSession,
LPCWSTR  szName,
LPCWSTR  szValue 
)
static

Definition at line 1153 of file automation.c.

1154 {
1155  VARIANT varresult;
1156  VARIANTARG vararg[2];
1157  DISPID dispid = DISPID_PROPERTYPUT;
1158  DISPPARAMS dispparams = {vararg, &dispid, ARRAY_SIZE(vararg), 1};
1159 
1160  VariantInit(&vararg[1]);
1161  V_VT(&vararg[1]) = VT_BSTR;
1162  V_BSTR(&vararg[1]) = SysAllocString(szName);
1163  VariantInit(&vararg[0]);
1164  V_VT(&vararg[0]) = VT_BSTR;
1165  V_BSTR(&vararg[0]) = SysAllocString(szValue);
1166 
1167  return invoke(pSession, "Property", DISPATCH_PROPERTYPUT, &dispparams, &varresult, VT_EMPTY);
1168 }
static const WCHAR szName[]
Definition: powrprof.c:45
void WINAPI VariantInit(VARIANTARG *pVarg)
Definition: variant.c:568
BSTR WINAPI SysAllocString(LPCOLESTR str)
Definition: oleaut.c:238
#define DISPATCH_PROPERTYPUT
Definition: oleauto.h:1008
static HRESULT invoke(IDispatch *pDispatch, LPCSTR szName, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, VARTYPE vtResult)
Definition: automation.c:840
#define V_VT(A)
Definition: oleauto.h:211
#define V_BSTR(A)
Definition: oleauto.h:226
static VARIANTARG static DISPID
Definition: ordinal.c:49
#define ARRAY_SIZE(a)
Definition: main.h:24
struct stdole::DISPPARAMS DISPPARAMS

Referenced by test_Session().

◆ Session_SetInstallLevel()

static HRESULT Session_SetInstallLevel ( IDispatch pSession,
LONG  iInstallLevel 
)
static

Definition at line 1282 of file automation.c.

1283 {
1284  VARIANT varresult;
1285  VARIANTARG vararg[1];
1286  DISPPARAMS dispparams = {vararg, NULL, ARRAY_SIZE(vararg), 0};
1287 
1288  VariantInit(&vararg[0]);
1289  V_VT(&vararg[0]) = VT_I4;
1290  V_I4(&vararg[0]) = iInstallLevel;
1291 
1292  return invoke(pSession, "SetInstallLevel", DISPATCH_METHOD, &dispparams, &varresult, VT_EMPTY);
1293 }
Definition: compat.h:2157
void WINAPI VariantInit(VARIANTARG *pVarg)
Definition: variant.c:568
#define V_I4(A)
Definition: oleauto.h:247
#define DISPATCH_METHOD
Definition: oleauto.h:1006
static HRESULT invoke(IDispatch *pDispatch, LPCSTR szName, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, VARTYPE vtResult)
Definition: automation.c:840
#define V_VT(A)
Definition: oleauto.h:211
#define ARRAY_SIZE(a)
Definition: main.h:24
#define NULL
Definition: types.h:112
struct stdole::DISPPARAMS DISPPARAMS

Referenced by test_Session().

◆ START_TEST()

START_TEST ( automation  )

Definition at line 2700 of file automation.c.

2701 {
2702  DWORD len;
2703  char temp_path[MAX_PATH], prev_path[MAX_PATH];
2704  HRESULT hr;
2705  CLSID clsid;
2706  IUnknown *pUnk;
2707 
2709 
2710  if (pIsWow64Process)
2711  pIsWow64Process(GetCurrentProcess(), &is_wow64);
2712 
2714 
2715  GetCurrentDirectoryA(MAX_PATH, prev_path);
2718 
2720  len = lstrlenA(CURR_DIR);
2721 
2722  if(len && (CURR_DIR[len - 1] == '\\'))
2723  CURR_DIR[len - 1] = 0;
2724 
2726 
2727  hr = OleInitialize(NULL);
2728  ok (hr == S_OK, "OleInitialize returned %#lx\n", hr);
2729  hr = CLSIDFromProgID(L"WindowsInstaller.Installer", &clsid);
2730  ok (hr == S_OK, "CLSIDFromProgID returned %#lx\n", hr);
2731  hr = CoCreateInstance(&clsid, NULL, CLSCTX_INPROC_SERVER, &IID_IUnknown, (void **)&pUnk);
2732  ok(hr == S_OK, "CoCreateInstance returned %#lx\n", hr);
2733 
2734  if (pUnk)
2735  {
2736  hr = IUnknown_QueryInterface(pUnk, &IID_IDispatch, (void **)&pInstaller);
2737  ok (hr == S_OK, "IUnknown::QueryInterface returned %#lx\n", hr);
2738 
2739  test_dispid();
2740  test_dispatch();
2741  test_Installer();
2742 
2743  IDispatch_Release(pInstaller);
2744  IUnknown_Release(pUnk);
2745  }
2746 
2747  OleUninitialize();
2748 
2749  SetCurrentDirectoryA(prev_path);
2750 }
VOID WINAPI GetSystemTimeAsFileTime(OUT PFILETIME lpFileTime)
Definition: time.c:128
static BOOL get_program_files_dir(LPSTR buf)
Definition: automation.c:364
HRESULT hr
Definition: shlfolder.c:183
static char PROG_FILES_DIR[MAX_PATH]
Definition: automation.c:362
static CHAR CURR_DIR[MAX_PATH]
Definition: automation.c:49
static void init_functionpointers(void)
Definition: automation.c:205
HRESULT WINAPI DECLSPEC_HOTPATCH CLSIDFromProgID(LPCOLESTR progid, LPCLSID clsid)
Definition: compobj.c:2602
static void test_Installer(void)
Definition: automation.c:2561
#define L(x)
Definition: ntvdm.h:50
static FILETIME systemtime
Definition: automation.c:48
LONG HRESULT
Definition: typedefs.h:79
const GUID IID_IUnknown
#define MAX_PATH
Definition: compat.h:34
static IDispatch * pInstaller
Definition: automation.c:55
unsigned long DWORD
Definition: ntddk_ex.h:95
LPSTR WINAPI lstrcpyA(LPSTR lpString1, LPCSTR lpString2)
Definition: lstring.c:100
const GUID IID_IDispatch
REFCLSID clsid
Definition: msctf.c:82
BOOL WINAPI SetCurrentDirectoryA(IN LPCSTR lpPathName)
Definition: path.c:2206
GLenum GLsizei len
Definition: glext.h:6722
#define GetCurrentProcess()
Definition: compat.h:618
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
Definition: compobj.c:3325
HRESULT WINAPI DECLSPEC_HOTPATCH OleInitialize(LPVOID reserved)
Definition: ole2.c:169
static void test_dispid(void)
Definition: automation.c:579
#define S_OK
Definition: intsafe.h:52
int WINAPI lstrlenA(LPCSTR lpString)
Definition: lstring.c:145
DWORD WINAPI GetTempPathA(IN DWORD nBufferLength, OUT LPSTR lpBuffer)
Definition: path.c:2054
static BOOL is_wow64
Definition: automation.c:40
#define ok(value,...)
Definition: atltest.h:57
DWORD WINAPI GetCurrentDirectoryA(IN DWORD nBufferLength, OUT LPSTR lpBuffer)
Definition: path.c:2146
#define NULL
Definition: types.h:112
static void test_dispatch(void)
Definition: automation.c:617
void WINAPI DECLSPEC_HOTPATCH OleUninitialize(void)
Definition: ole2.c:230
static void *static void *static LPDIRECTPLAY IUnknown * pUnk
Definition: dplayx.c:30
char temp_path[MAX_PATH]
Definition: mspatcha.c:123

◆ StringList__NewEnum()

static HRESULT StringList__NewEnum ( IDispatch pList,
IUnknown **  ppEnumVARIANT 
)
static

Definition at line 1503 of file automation.c.

1504 {
1505  VARIANT varresult;
1506  DISPPARAMS dispparams = {NULL, NULL, 0, 0};
1507  HRESULT hr = invoke(pList, "_NewEnum", DISPATCH_METHOD, &dispparams, &varresult, VT_UNKNOWN);
1508  *ppEnumVARIANT = V_UNKNOWN(&varresult);
1509  return hr;
1510 }
HRESULT hr
Definition: shlfolder.c:183
#define DISPATCH_METHOD
Definition: oleauto.h:1006
FxChildList * pList
LONG HRESULT
Definition: typedefs.h:79
static HRESULT invoke(IDispatch *pDispatch, LPCSTR szName, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, VARTYPE vtResult)
Definition: automation.c:840
#define V_UNKNOWN(A)
Definition: oleauto.h:281
#define NULL
Definition: types.h:112
struct stdole::DISPPARAMS DISPPARAMS

Referenced by test_Installer_Products().

◆ StringList_Count()

static HRESULT StringList_Count ( IDispatch pStringList,
int pCount 
)
static

Definition at line 1529 of file automation.c.

1530 {
1531  VARIANT varresult;
1532  DISPPARAMS dispparams = {NULL, NULL, 0, 0};
1533  HRESULT hr = invoke(pStringList, "Count", DISPATCH_PROPERTYGET, &dispparams, &varresult, VT_I4);
1534  *pCount = V_I4(&varresult);
1535  VariantClear(&varresult);
1536  return hr;
1537 }
Definition: compat.h:2157
#define DISPATCH_PROPERTYGET
Definition: oleauto.h:1007
HRESULT hr
Definition: shlfolder.c:183
#define V_I4(A)
Definition: oleauto.h:247
LONG HRESULT
Definition: typedefs.h:79
static HRESULT invoke(IDispatch *pDispatch, LPCSTR szName, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, VARTYPE vtResult)
Definition: automation.c:840
HRESULT WINAPI DECLSPEC_HOTPATCH VariantClear(VARIANTARG *pVarg)
Definition: variant.c:648
#define NULL
Definition: types.h:112
struct stdole::DISPPARAMS DISPPARAMS

Referenced by test_Installer(), test_Installer_InstallProduct(), and test_Installer_Products().

◆ StringList_Item()

static HRESULT StringList_Item ( IDispatch pStringList,
int  iIndex,
LPWSTR  szString 
)
static

Definition at line 1512 of file automation.c.

1513 {
1514  VARIANT varresult;
1515  VARIANTARG vararg[1];
1516  DISPPARAMS dispparams = {vararg, NULL, ARRAY_SIZE(vararg), 0};
1517  HRESULT hr;
1518 
1519  VariantInit(&vararg[0]);
1520  V_VT(&vararg[0]) = VT_I4;
1521  V_I4(&vararg[0]) = iIndex;
1522 
1523  hr = invoke(pStringList, "Item", DISPATCH_PROPERTYGET, &dispparams, &varresult, VT_BSTR);
1524  if (V_BSTR(&varresult)) lstrcpyW(szString, V_BSTR(&varresult));
1525  VariantClear(&varresult);
1526  return hr;
1527 }
Definition: compat.h:2157
#define DISPATCH_PROPERTYGET
Definition: oleauto.h:1007
HRESULT hr
Definition: shlfolder.c:183
void WINAPI VariantInit(VARIANTARG *pVarg)
Definition: variant.c:568
#define V_I4(A)
Definition: oleauto.h:247
LONG HRESULT
Definition: typedefs.h:79
static HRESULT invoke(IDispatch *pDispatch, LPCSTR szName, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, VARTYPE vtResult)
Definition: automation.c:840
HRESULT WINAPI DECLSPEC_HOTPATCH VariantClear(VARIANTARG *pVarg)
Definition: variant.c:648
#define V_VT(A)
Definition: oleauto.h:211
#define V_BSTR(A)
Definition: oleauto.h:226
#define lstrcpyW
Definition: compat.h:608
#define ARRAY_SIZE(a)
Definition: main.h:24
#define NULL
Definition: types.h:112
struct stdole::DISPPARAMS DISPPARAMS

Referenced by test_Installer_InstallProduct(), and test_Installer_Products().

◆ SummaryInfo_PropertyCountGet()

static HRESULT SummaryInfo_PropertyCountGet ( IDispatch pSummaryInfo,
int pCount 
)
static

Definition at line 1566 of file automation.c.

1567 {
1568  VARIANT varresult;
1569  DISPPARAMS dispparams = {NULL, NULL, 0, 0};
1570  HRESULT hr;
1571 
1572  hr = invoke(pSummaryInfo, "PropertyCount", DISPATCH_PROPERTYGET, &dispparams, &varresult, VT_I4);
1573  *pCount = V_I4(&varresult);
1574  VariantClear(&varresult);
1575  return hr;
1576 }
Definition: compat.h:2157
#define DISPATCH_PROPERTYGET
Definition: oleauto.h:1007
HRESULT hr
Definition: shlfolder.c:183
#define V_I4(A)
Definition: oleauto.h:247
LONG HRESULT
Definition: typedefs.h:79
static HRESULT invoke(IDispatch *pDispatch, LPCSTR szName, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, VARTYPE vtResult)
Definition: automation.c:840
HRESULT WINAPI DECLSPEC_HOTPATCH VariantClear(VARIANTARG *pVarg)
Definition: variant.c:648
#define NULL
Definition: types.h:112
struct stdole::DISPPARAMS DISPPARAMS

Referenced by test_SummaryInfo().

◆ SummaryInfo_PropertyGet()

static HRESULT SummaryInfo_PropertyGet ( IDispatch pSummaryInfo,
int  pid,
VARIANT pVarResult,
VARTYPE  vtExpect 
)
static

Definition at line 1539 of file automation.c.

1540 {
1541  VARIANTARG vararg[1];
1542  DISPPARAMS dispparams = {vararg, NULL, ARRAY_SIZE(vararg), 0};
1543 
1544  VariantInit(&vararg[0]);
1545  V_VT(&vararg[0]) = VT_I4;
1546  V_I4(&vararg[0]) = pid;
1547  return invoke(pSummaryInfo, "Property", DISPATCH_PROPERTYGET, &dispparams, pVarResult, vtExpect);
1548 }
_In_ ULONG_PTR _In_ ULONG _Out_ ULONG_PTR * pid
Definition: winddi.h:3835
Definition: compat.h:2157
#define DISPATCH_PROPERTYGET
Definition: oleauto.h:1007
void WINAPI VariantInit(VARIANTARG *pVarg)
Definition: variant.c:568
#define V_I4(A)
Definition: oleauto.h:247
static HRESULT invoke(IDispatch *pDispatch, LPCSTR szName, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, VARTYPE vtResult)
Definition: automation.c:840
#define V_VT(A)
Definition: oleauto.h:211
#define ARRAY_SIZE(a)
Definition: main.h:24
#define NULL
Definition: types.h:112
struct stdole::DISPPARAMS DISPPARAMS

Referenced by test_SummaryInfo().

◆ SummaryInfo_PropertyPut()

static HRESULT SummaryInfo_PropertyPut ( IDispatch pSummaryInfo,
int  pid,
VARIANT pVariant 
)
static

Definition at line 1550 of file automation.c.

1551 {
1552  VARIANT varresult;
1553  VARIANTARG vararg[2];
1554  DISPID dispid = DISPID_PROPERTYPUT;
1555  DISPPARAMS dispparams = {vararg, &dispid, ARRAY_SIZE(vararg), 1};
1556 
1557  VariantInit(&vararg[1]);
1558  V_VT(&vararg[1]) = VT_I4;
1559  V_I4(&vararg[1]) = pid;
1560  VariantInit(&vararg[0]);
1561  VariantCopyInd(vararg, pVariant);
1562 
1563  return invoke(pSummaryInfo, "Property", DISPATCH_PROPERTYPUT, &dispparams, &varresult, VT_EMPTY);
1564 }
_In_ ULONG_PTR _In_ ULONG _Out_ ULONG_PTR * pid
Definition: winddi.h:3835
Definition: compat.h:2157
HRESULT WINAPI VariantCopyInd(VARIANT *pvargDest, VARIANTARG *pvargSrc)
Definition: variant.c:847
void WINAPI VariantInit(VARIANTARG *pVarg)
Definition: variant.c:568
#define V_I4(A)
Definition: oleauto.h:247
#define DISPATCH_PROPERTYPUT
Definition: oleauto.h:1008
static HRESULT invoke(IDispatch *pDispatch, LPCSTR szName, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, VARTYPE vtResult)
Definition: automation.c:840
#define V_VT(A)
Definition: oleauto.h:211
static VARIANTARG static DISPID
Definition: ordinal.c:49
#define ARRAY_SIZE(a)
Definition: main.h:24
struct stdole::DISPPARAMS DISPPARAMS

Referenced by test_SummaryInfo().

◆ test_Database()

static void test_Database ( IDispatch pDatabase,
BOOL  readonly 
)
static

Definition at line 1723 of file automation.c.

1724 {
1725  IDispatch *pView = NULL, *pSummaryInfo = NULL;
1726  HRESULT hr;
1727 
1728  hr = Database_OpenView(pDatabase, L"SELECT `Feature` FROM `Feature` WHERE `Feature_Parent`='One'", &pView);
1729  ok(hr == S_OK, "Database_OpenView failed, hresult %#lx\n", hr);
1730  if (hr == S_OK)
1731  {
1732  IDispatch *pRecord = NULL;
1733  WCHAR szString[MAX_PATH];
1734 
1735  /* View::Execute */
1736  hr = View_Execute(pView, NULL);
1737  ok(hr == S_OK, "View_Execute failed, hresult %#lx\n", hr);
1738 
1739  /* View::Fetch */
1740  hr = View_Fetch(pView, &pRecord);
1741  ok(hr == S_OK, "View_Fetch failed, hresult %#lx\n", hr);
1742  ok(pRecord != NULL, "View_Fetch should not have returned NULL record\n");
1743  if (pRecord)
1744  {
1745  /* Record::StringDataGet */
1746  memset(szString, 0, sizeof(szString));
1747  hr = Record_StringDataGet(pRecord, 1, szString);
1748  ok(hr == S_OK, "Record_StringDataGet failed, hresult %#lx\n", hr);
1749  ok_w2("Record_StringDataGet result was %s but expected %s\n", szString, L"Three");
1750 
1751  /* Record::StringDataPut with correct index */
1752  hr = Record_StringDataPut(pRecord, 1, L"Two");
1753  ok(hr == S_OK, "Record_StringDataPut failed, hresult %#lx\n", hr);
1754 
1755  /* Record::StringDataGet */
1756  memset(szString, 0, sizeof(szString));
1757  hr = Record_StringDataGet(pRecord, 1, szString);
1758  ok(hr == S_OK, "Record_StringDataGet failed, hresult %#lx\n", hr);
1759  ok_w2("Record_StringDataGet result was %s but expected %s\n", szString, L"Two");
1760 
1761  /* Record::StringDataPut with incorrect index */
1762  hr = Record_StringDataPut(pRecord, -1, szString);
1763  ok(hr == DISP_E_EXCEPTION, "Record_StringDataPut failed, hresult %#lx\n", hr);
1764  ok_exception(hr, L"StringData,Field");
1765 
1766  /* View::Modify with incorrect parameters */
1767  hr = View_Modify(pView, -5, NULL);
1768  ok(hr == DISP_E_EXCEPTION, "View_Modify failed, hresult %#lx\n", hr);
1769  ok_exception(hr, L"Modify,Mode,Record");
1770 
1771  hr = View_Modify(pView, -5, pRecord);
1772  ok(hr == DISP_E_EXCEPTION, "View_Modify failed, hresult %#lx\n", hr);
1773  ok_exception(hr, L"Modify,Mode,Record");
1774 
1775  hr = View_Modify(pView, MSIMODIFY_REFRESH, NULL);
1776  ok(hr == DISP_E_EXCEPTION, "View_Modify failed, hresult %#lx\n", hr);
1777  ok_exception(hr, L"Modify,Mode,Record");
1778 
1779  hr = View_Modify(pView, MSIMODIFY_REFRESH, pRecord);
1780  ok(hr == S_OK, "View_Modify failed, hresult %#lx\n", hr);
1781 
1782  /* Record::StringDataGet, confirm that the record is back to its unmodified value */
1783  memset(szString, 0, sizeof(szString));
1784  hr = Record_StringDataGet(pRecord, 1, szString);
1785  ok(hr == S_OK, "Record_StringDataGet failed, hresult %#lx\n", hr);
1786  todo_wine ok_w2("Record_StringDataGet result was %s but expected %s\n", szString, L"Three");
1787 
1788  IDispatch_Release(pRecord);
1789  }
1790 
1791  /* View::Fetch */
1792  hr = View_Fetch(pView, &pRecord);
1793  ok(hr == S_OK, "View_Fetch failed, hresult %#lx\n", hr);
1794  ok(pRecord != NULL, "View_Fetch should not have returned NULL record\n");
1795  if (pRecord)
1796  {
1797  /* Record::StringDataGet */
1798  memset(szString, 0, sizeof(szString));
1799  hr = Record_StringDataGet(pRecord, 1, szString);
1800  ok(hr == S_OK, "Record_StringDataGet failed, hresult %#lx\n", hr);
1801  ok_w2("Record_StringDataGet result was %s but expected %s\n", szString, L"Two");
1802 
1803  IDispatch_Release(pRecord);
1804  }
1805 
1806  /* View::Fetch */
1807  hr = View_Fetch(pView, &pRecord);
1808  ok(hr == S_OK, "View_Fetch failed, hresult %#lx\n", hr);
1809  ok(pRecord == NULL, "View_Fetch should have returned NULL record\n");
1810  if (pRecord)
1811  IDispatch_Release(pRecord);
1812 
1813  /* View::Close */
1814  hr = View_Close(pView);
1815  ok(hr == S_OK, "View_Close failed, hresult %#lx\n", hr);
1816 
1817  IDispatch_Release(pView);
1818  }
1819 
1820  /* Database::SummaryInformation */
1822  ok(hr == S_OK, "Database_SummaryInformation failed, hresult %#lx\n", hr);
1823  ok(pSummaryInfo != NULL, "Database_SummaryInformation should not have returned NULL record\n");
1824  if (pSummaryInfo)
1825  {
1826  test_SummaryInfo(pSummaryInfo, summary_info, ARRAY_SIZE(summary_info), readonly);
1827  IDispatch_Release(pSummaryInfo);
1828  }
1829 }
#define DISP_E_EXCEPTION
Definition: winerror.h:2518
static const msi_summary_info summary_info[]
Definition: automation.c:195
HRESULT hr
Definition: shlfolder.c:183
static HRESULT Record_StringDataPut(IDispatch *pRecord, int iField, LPCWSTR szString)
Definition: automation.c:1452
static HRESULT View_Modify(IDispatch *pView, int iMode, IDispatch *pRecord)
Definition: automation.c:1400
static HRESULT View_Close(IDispatch *pView)
Definition: automation.c:1418
static HRESULT View_Execute(IDispatch *pView, IDispatch *pRecord)
Definition: automation.c:1378
static HRESULT Database_SummaryInformation(IDispatch *pDatabase, int iUpdateCount, IDispatch **pSummaryInfo)
Definition: automation.c:1362
#define todo_wine
Definition: custom.c:79
#define ok_exception(hr, szDescription)
Definition: automation.c:482
#define L(x)
Definition: ntvdm.h:50
static HRESULT Record_StringDataGet(IDispatch *pRecord, int iField, LPWSTR szString)
Definition: automation.c:1435
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:79
static HRESULT Database_OpenView(IDispatch *pDatabase, LPCWSTR szSql, IDispatch **pView)
Definition: automation.c:1346
static HRESULT View_Fetch(IDispatch *pView, IDispatch **ppRecord)
Definition: automation.c:1391
#define MAX_PATH
Definition: compat.h:34
#define ok_w2(format, szString1, szString2)
Definition: automation.c:451
#define S_OK
Definition: intsafe.h:52
#define ARRAY_SIZE(a)
Definition: main.h:24
#define ok(value,...)
Definition: atltest.h:57
#define NULL
Definition: types.h:112
static void test_SummaryInfo(IDispatch *pSummaryInfo, const msi_summary_info *info, int num_info, BOOL readonly)
Definition: automation.c:1582
#define memset(x, y, z)
Definition: compat.h:39
#define TEST_SUMMARYINFO_PROPERTIES_MODIFIED
Definition: automation.c:1580

Referenced by test_Installer(), and test_Session().

◆ test_dispatch()

static void test_dispatch ( void  )
static

Definition at line 617 of file automation.c.

618 {
619  HRESULT hr;
620  DISPID dispid;
621  OLECHAR *name;
622  VARIANT varresult;
623  VARIANTARG vararg[3];
625  DISPPARAMS dispparams = {NULL, NULL, 0, 0};
626 
627  /* Test getting ID of a function name that does not exist */
628  name = (WCHAR *)L"winetest-automation.msi";
629  hr = IDispatch_GetIDsOfNames(pInstaller, &IID_NULL, &name, 1, LOCALE_USER_DEFAULT, &dispid);
630  ok(hr == DISP_E_UNKNOWNNAME, "IDispatch::GetIDsOfNames returned %#lx\n", hr);
631 
632  /* Test invoking this function */
633  hr = IDispatch_Invoke(pInstaller, dispid, &IID_NULL, LOCALE_NEUTRAL, DISPATCH_METHOD, NULL, NULL, NULL, NULL);
634  ok(hr == DISP_E_MEMBERNOTFOUND, "IDispatch::Invoke returned %#lx\n", hr);
635 
636  /* Test getting ID of a function name that does exist */
637  name = (WCHAR *)L"OpenPackage";
638  hr = IDispatch_GetIDsOfNames(pInstaller, &IID_NULL, &name, 1, LOCALE_USER_DEFAULT, &dispid);
639  ok(hr == S_OK, "IDispatch::GetIDsOfNames returned %#lx\n", hr);
640 
641  /* Test invoking this function (without parameters passed) */
642  if (0) /* All of these crash MSI on Windows XP */
643  {
644  IDispatch_Invoke(pInstaller, dispid, &IID_NULL, LOCALE_NEUTRAL, DISPATCH_METHOD, NULL, NULL, NULL, NULL);
645  IDispatch_Invoke(pInstaller, dispid, &IID_NULL, LOCALE_NEUTRAL, DISPATCH_METHOD, NULL, NULL, &excepinfo, NULL);
646  VariantInit(&varresult);
647  IDispatch_Invoke(pInstaller, dispid, &IID_NULL, LOCALE_NEUTRAL, DISPATCH_METHOD, NULL, &varresult, &excepinfo, NULL);
648  }
649 
650  /* Try with NULL params */
651  hr = IDispatch_Invoke(pInstaller, dispid, &IID_NULL, LOCALE_NEUTRAL, DISPATCH_METHOD, &dispparams, &varresult, &excepinfo, NULL);
652  ok(hr == DISP_E_TYPEMISMATCH, "IDispatch::Invoke returned %#lx\n", hr);
653 
654  /* Try one empty parameter */
655  dispparams.rgvarg = vararg;
656  dispparams.cArgs = 1;
657  VariantInit(&vararg[0]);
658  hr = IDispatch_Invoke(pInstaller, dispid, &IID_NULL, LOCALE_NEUTRAL, DISPATCH_METHOD, &dispparams, &varresult, &excepinfo, NULL);
659  ok(hr == DISP_E_TYPEMISMATCH, "IDispatch::Invoke returned %#lx\n", hr);
660 
661  /* Try two empty parameters */
662  dispparams.cArgs = 2;
663  VariantInit(&vararg[0]);
664  VariantInit(&vararg[1]);
665  hr = IDispatch_Invoke(pInstaller, dispid, &IID_NULL, LOCALE_NEUTRAL, DISPATCH_METHOD, &dispparams, &varresult, &excepinfo, NULL);
666  ok(hr == DISP_E_TYPEMISMATCH, "IDispatch::Invoke returned %#lx\n", hr);
667 
668  /* Try one parameter, the required BSTR. Second parameter is optional.
669  * NOTE: The specified package does not exist, which is why the call fails.
670  */
671  dispparams.cArgs = 1;
672  VariantInit(&vararg[0]);
673  V_VT(&vararg[0]) = VT_BSTR;
674  V_BSTR(&vararg[0]) = SysAllocString(L"winetest-automation.msi");
675  hr = IDispatch_Invoke(pInstaller, dispid, &IID_NULL, LOCALE_NEUTRAL, DISPATCH_METHOD, &dispparams, &varresult, &excepinfo, NULL);
676  ok(hr == DISP_E_EXCEPTION, "IDispatch::Invoke returned %#lx\n", hr);
677  ok_exception(hr, L"OpenPackage,PackagePath,Options");
678  VariantClear(&vararg[0]);
679 
680  /* Provide the required BSTR and an empty second parameter.
681  * NOTE: The specified package does not exist, which is why the call fails.
682  */
683  dispparams.cArgs = 2;
684  VariantInit(&vararg[1]);
685  V_VT(&vararg[1]) = VT_BSTR;
686  V_BSTR(&vararg[1]) = SysAllocString(L"winetest-automation.msi");
687  VariantInit(&vararg[0]);
688  hr = IDispatch_Invoke(pInstaller, dispid, &IID_NULL, LOCALE_NEUTRAL, DISPATCH_METHOD, &dispparams, &varresult, &excepinfo, NULL);
689  ok(hr == DISP_E_EXCEPTION, "IDispatch::Invoke returned %#lx\n", hr);
690  ok_exception(hr, L"OpenPackage,PackagePath,Options");
691  VariantClear(&vararg[1]);
692 
693  /* Provide the required BSTR and two empty parameters.
694  * NOTE: The specified package does not exist, which is why the call fails.
695  */
696  dispparams.cArgs = 3;
697  VariantInit(&vararg[2]);
698  V_VT(&vararg[2]) = VT_BSTR;
699  V_BSTR(&vararg[2]) = SysAllocString(L"winetest-automation.msi");
700  VariantInit(&vararg[1]);
701  VariantInit(&vararg[0]);
702  hr = IDispatch_Invoke(pInstaller, dispid, &IID_NULL, LOCALE_NEUTRAL, DISPATCH_METHOD, &dispparams, &varresult, &excepinfo, NULL);
703  ok(hr == DISP_E_EXCEPTION, "IDispatch::Invoke returned %#lx\n", hr);
704  ok_exception(hr, L"OpenPackage,PackagePath,Options");
705  VariantClear(&vararg[2]);
706 
707  /* Provide the required BSTR and a second parameter with the wrong type. */
708  dispparams.cArgs = 2;
709  VariantInit(&vararg[1]);
710  V_VT(&vararg[1]) = VT_BSTR;
711  V_BSTR(&vararg[1]) = SysAllocString(L"winetest-automation.msi");
712  VariantInit(&vararg[0]);
713  V_VT(&vararg[0]) = VT_BSTR;
714  V_BSTR(&vararg[0]) = SysAllocString(L"winetest-automation.msi");
715  hr = IDispatch_Invoke(pInstaller, dispid, &IID_NULL, LOCALE_NEUTRAL, DISPATCH_METHOD, &dispparams, &varresult, &excepinfo, NULL);
716  ok(hr == DISP_E_TYPEMISMATCH, "IDispatch::Invoke returned %#lx\n", hr);
717  VariantClear(&vararg[0]);
718  VariantClear(&vararg[1]);
719 
720  /* Create a proper installer package. */
722 
723  /* Try one parameter, the required BSTR. Second parameter is optional.
724  * Proper installer package exists. Path to the package is relative.
725  */
726  dispparams.cArgs = 1;
727  VariantInit(&vararg[0]);
728  V_VT(&vararg[0]) = VT_BSTR;
729  V_BSTR(&vararg[0]) = SysAllocString(L"winetest-automation.msi");
730  hr = IDispatch_Invoke(pInstaller, dispid, &IID_NULL, LOCALE_NEUTRAL, DISPATCH_METHOD, &dispparams, &varresult, &excepinfo, NULL);
731  todo_wine ok(hr == DISP_E_EXCEPTION, "IDispatch::Invoke returned %#lx\n", hr);
732  ok_exception(hr, L"OpenPackage,PackagePath,Options");
733  VariantClear(&vararg[0]);
734  if (hr != DISP_E_EXCEPTION)
735  VariantClear(&varresult);
736 
737  /* Try one parameter, the required BSTR. Second parameter is optional.
738  * Proper installer package exists. Path to the package is absolute.
739  */
740  dispparams.cArgs = 1;
741  VariantInit(&vararg[0]);
742  V_VT(&vararg[0]) = VT_BSTR;
743  V_BSTR(&vararg[0]) = SysAllocString(path);
744  hr = IDispatch_Invoke(pInstaller, dispid, &IID_NULL, LOCALE_NEUTRAL, DISPATCH_METHOD, &dispparams, &varresult, &excepinfo, NULL);
745  if (hr == DISP_E_EXCEPTION)
746  {
747  skip("OpenPackage failed, insufficient rights?\n");
748  DeleteFileW(path);
749  return;
750  }
751  ok(hr == S_OK, "IDispatch::Invoke returned %#lx\n", hr);
752  VariantClear(&vararg[0]);
753  VariantClear(&varresult);
754 
755  /* Provide the required BSTR and an empty second parameter. Proper
756  * installation package exists.
757  */
758  dispparams.cArgs = 2;
759  VariantInit(&vararg[1]);
760  V_VT(&vararg[1]) = VT_BSTR;
761  V_BSTR(&vararg[1]) = SysAllocString(path);
762  VariantInit(&vararg[0]);
763  hr = IDispatch_Invoke(pInstaller, dispid, &IID_NULL, LOCALE_NEUTRAL, DISPATCH_METHOD, &dispparams, &varresult, &excepinfo, NULL);
764  ok(hr == S_OK, "IDispatch::Invoke returned %#lx\n", hr);
765  VariantClear(&vararg[1]);
766  VariantClear(&varresult);
767 
768  /* Provide the required BSTR and two empty parameters. Proper
769  * installation package exists.
770  */
771  dispparams.cArgs = 3;
772  VariantInit(&vararg[2]);
773  V_VT(&vararg[2]) = VT_BSTR;
774  V_BSTR(&vararg[2]) = SysAllocString(path);
775  VariantInit(&vararg[1]);
776  VariantInit(&vararg[0]);
777  hr = IDispatch_Invoke(pInstaller, dispid, &IID_NULL, LOCALE_NEUTRAL, DISPATCH_METHOD, &dispparams, &varresult, &excepinfo, NULL);
778  ok(hr == S_OK, "IDispatch::Invoke returned %#lx\n", hr);
779  VariantClear(&vararg[2]);
780  VariantClear(&varresult);
781 
782  /* Provide the required BSTR and a second parameter with the wrong type. */
783  dispparams.cArgs = 2;
784  VariantInit(&vararg[1]);
785  V_VT(&vararg[1]) = VT_BSTR;
786  V_BSTR(&vararg[1]) = SysAllocString(path);
787  VariantInit(&vararg[0]);
788  V_VT(&vararg[0]) = VT_BSTR;
789  V_BSTR(&vararg[0]) = SysAllocString(path);
790  hr = IDispatch_Invoke(pInstaller, dispid, &IID_NULL, LOCALE_NEUTRAL, DISPATCH_METHOD, &dispparams, &varresult, &excepinfo, NULL);
791  ok(hr == DISP_E_TYPEMISMATCH, "IDispatch::Invoke returned %#lx\n", hr);
792  VariantClear(&vararg[0]);
793  VariantClear(&vararg[1]);
794 
795  /* Provide the required BSTR and a second parameter that can be coerced to
796  * VT_I4.
797  */
798  dispparams.cArgs = 2;
799  VariantInit(&vararg[1]);
800  V_VT(&vararg[1]) = VT_BSTR;
801  V_BSTR(&vararg[1]) = SysAllocString(path);
802  VariantInit(&vararg[0]);
803  V_VT(&vararg[0]) = VT_I2;
804  V_BSTR(&vararg[0]) = 0;
805  hr = IDispatch_Invoke(pInstaller, dispid, &IID_NULL, LOCALE_NEUTRAL, DISPATCH_METHOD, &dispparams, &varresult, &excepinfo, NULL);
806  ok(hr == S_OK, "IDispatch::Invoke returned %#lx\n", hr);
807  VariantClear(&vararg[1]);
808  VariantClear(&varresult);
809 
810  DeleteFileW(path);
811 
812  /* Test invoking a method as a DISPATCH_PROPERTYGET or DISPATCH_PROPERTYPUT */
813  VariantInit(&vararg[0]);
814  hr = IDispatch_Invoke(pInstaller, dispid, &IID_NULL, LOCALE_NEUTRAL, DISPATCH_PROPERTYGET, &dispparams, &varresult, &excepinfo, NULL);
815  ok(hr == DISP_E_MEMBERNOTFOUND, "IDispatch::Invoke returned %#lx\n", hr);
816 
817  VariantInit(&vararg[0]);
818  hr = IDispatch_Invoke(pInstaller, dispid, &IID_NULL, LOCALE_NEUTRAL, DISPATCH_PROPERTYPUT, &dispparams, &varresult, &excepinfo, NULL);
819  ok(hr == DISP_E_MEMBERNOTFOUND, "IDispatch::Invoke returned %#lx\n", hr);
820 
821  /* Test invoking a read-only property as DISPATCH_PROPERTYPUT or as a DISPATCH_METHOD */
822  name = (WCHAR *)L"ProductState";
823  hr = IDispatch_GetIDsOfNames(pInstaller, &IID_NULL, &name, 1, LOCALE_USER_DEFAULT, &dispid);
824  ok(hr == S_OK, "IDispatch::GetIDsOfNames returned %#lx\n", hr);
825 
826  dispparams.rgvarg = NULL;
827  dispparams.cArgs = 0;
828  hr = IDispatch_Invoke(pInstaller, dispid, &IID_NULL, LOCALE_NEUTRAL, DISPATCH_PROPERTYPUT, &dispparams, &varresult, &excepinfo, NULL);
829  ok(hr == DISP_E_MEMBERNOTFOUND, "IDispatch::Invoke returned %#lx\n", hr);
830 
831  dispparams.rgvarg = NULL;
832  dispparams.cArgs = 0;
833  hr = IDispatch_Invoke(pInstaller, dispid, &IID_NULL, LOCALE_NEUTRAL, DISPATCH_METHOD, &dispparams, &varresult, &excepinfo, NULL);
834  ok(hr == DISP_E_MEMBERNOTFOUND, "IDispatch::Invoke returned %#lx\n", hr);
835 }
#define DISP_E_EXCEPTION
Definition: winerror.h:2518
#define DISP_E_UNKNOWNNAME
Definition: winerror.h:2515
WCHAR OLECHAR
Definition: compat.h:2151
#define DISPATCH_PROPERTYGET
Definition: oleauto.h:1007
HRESULT hr
Definition: shlfolder.c:183
#define LOCALE_USER_DEFAULT
#define DISP_E_MEMBERNOTFOUND
Definition: winerror.h:2512
#define todo_wine
Definition: custom.c:79
static BOOL create_package(LPWSTR path)
Definition: automation.c:341
void WINAPI VariantInit(VARIANTARG *pVarg)
Definition: variant.c:568
#define DISPATCH_METHOD
Definition: oleauto.h:1006
#define ok_exception(hr, szDescription)
Definition: automation.c:482
#define L(x)
Definition: ntvdm.h:50
BOOL WINAPI DeleteFileW(IN LPCWSTR lpFileName)
Definition: delete.c:39
BSTR WINAPI SysAllocString(LPCOLESTR str)
Definition: oleaut.c:238
#define DISPATCH_PROPERTYPUT
Definition: oleauto.h:1008
#define DISP_E_TYPEMISMATCH
Definition: winerror.h:2514
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:79
#define MAX_PATH
Definition: compat.h:34
static IDispatch * pInstaller
Definition: automation.c:55
HRESULT WINAPI DECLSPEC_HOTPATCH VariantClear(VARIANTARG *pVarg)
Definition: variant.c:648
#define IID_NULL
Definition: guiddef.h:98
#define V_VT(A)
Definition: oleauto.h:211
#define V_BSTR(A)
Definition: oleauto.h:226
#define S_OK
Definition: intsafe.h:52
static VARIANTARG static DISPID
Definition: ordinal.c:49
#define ok(value,...)
Definition: atltest.h:57
#define NULL
Definition: types.h:112
#define skip(...)
Definition: atltest.h:64
Definition: name.c:38
static EXCEPINFO excepinfo
Definition: automation.c:50
struct stdole::DISPPARAMS DISPPARAMS
#define LOCALE_NEUTRAL
Definition: compat.h:2156
GLuint const GLchar * name
Definition: glext.h:6031

Referenced by START_TEST().

◆ test_dispid()

static void test_dispid ( void  )
static

Definition at line 579 of file automation.c.

580 {
581  const get_did_t *ptr = get_did_data;
582  DISPID dispid;
583 
584  while (ptr->name)
585  {
586  dispid = get_dispid(pInstaller, ptr->name);
587  todo_wine_if (ptr->todo)
588  ok(dispid == ptr->did, "%s: expected %ld, got %ld\n", ptr->name, ptr->did, dispid);
589  ptr++;
590  }
591 
592  dispid = get_dispid(pInstaller, "RemovePatches");
593  ok(dispid == 49 || dispid == -1, "Expected 49 or -1, got %ld\n", dispid);
594  dispid = get_dispid(pInstaller, "ApplyMultiplePatches");
595  ok(dispid == 51 || dispid == -1, "Expected 51 or -1, got %ld\n", dispid);
596  dispid = get_dispid(pInstaller, "ProductsEx");
597  ok(dispid == 52 || dispid == -1, "Expected 52 or -1, got %ld\n", dispid);
598  dispid = get_dispid(pInstaller, "PatchesEx");
599  ok(dispid == 55 || dispid == -1, "Expected 55 or -1, got %ld\n", dispid);
600  dispid = get_dispid(pInstaller, "ExtractPatchXMLData");
601  ok(dispid == 57 || dispid == -1, "Expected 57 or -1, got %ld\n", dispid);
602  dispid = get_dispid( pInstaller, "ProductElevated" );
603  ok(dispid == 59 || dispid == -1, "Expected 59 or -1, got %ld\n", dispid);
604  dispid = get_dispid( pInstaller, "ProvideAssembly" );
605  ok(dispid == 60 || dispid == -1, "Expected 60 or -1, got %ld\n", dispid);
606  dispid = get_dispid( pInstaller, "ProductInfoFromScript" );
607  ok(dispid == 61 || dispid == -1, "Expected 61 or -1, got %ld\n", dispid);
608  dispid = get_dispid( pInstaller, "AdvertiseProduct" );
609  ok(dispid == 62 || dispid == -1, "Expected 62 or -1, got %ld\n", dispid);
610  dispid = get_dispid( pInstaller, "CreateAdvertiseScript" );
611  ok(dispid == 63 || dispid == -1, "Expected 63 or -1, got %ld\n", dispid);
612  dispid = get_dispid( pInstaller, "PatchFiles" );
613  ok(dispid == 65 || dispid == -1, "Expected 65 or -1, got %ld\n", dispid);
614 }
GLdouble n
Definition: glext.h:7729
static PVOID ptr
Definition: dispmode.c:27
static DISPID get_dispid(IDispatch *disp, const char *name)
Definition: automation.c:501
#define todo_wine_if(is_todo)
Definition: custom.c:76
static IDispatch * pInstaller
Definition: automation.c:55
GLdouble s
Definition: gl.h:2039
static VARIANTARG static DISPID
Definition: ordinal.c:49
#define ok(value,...)
Definition: atltest.h:57
Definition: name.c:38
static const get_did_t get_did_data[]
Definition: automation.c:528
BOOLEAN Expected
BOOL expected
Definition: store.c:2063

Referenced by START_TEST().

◆ test_Installer()

static void test_Installer ( void  )
static

Definition at line 2561 of file automation.c.

2562 {
2564  HRESULT hr;
2565  IDispatch *pSession = NULL, *pDatabase = NULL, *pRecord = NULL, *pStringList = NULL, *pSumInfo = NULL;
2566  int iValue, iCount;
2567 
2568  if (!pInstaller) return;
2569 
2570  /* Installer::CreateRecord */
2571 
2572  /* Test for error */
2573  hr = Installer_CreateRecord(-1, &pRecord);
2574  ok(hr == DISP_E_EXCEPTION, "Installer_CreateRecord failed, hresult %#lx\n", hr);
2575  ok_exception(hr, L"CreateRecord,Count");
2576 
2577  /* Test for success */
2578  hr = Installer_CreateRecord(1, &pRecord);
2579  ok(hr == S_OK, "Installer_CreateRecord failed, hresult %#lx\n", hr);
2580  ok(pRecord != NULL, "Installer_CreateRecord should not have returned NULL record\n");
2581  if (pRecord)
2582  {
2583  /* Record::FieldCountGet */
2584  hr = Record_FieldCountGet(pRecord, &iValue);
2585  ok(hr == S_OK, "Record_FiledCountGet failed, hresult %#lx\n", hr);
2586  ok(iValue == 1, "Record_FieldCountGet result was %d but expected 1\n", iValue);
2587 
2588  /* Record::IntegerDataGet */
2589  hr = Record_IntegerDataGet(pRecord, 1, &iValue);
2590  ok(hr == S_OK, "Record_IntegerDataGet failed, hresult %#lx\n", hr);
2591  ok(iValue == MSI_NULL_INTEGER, "Record_IntegerDataGet result was %d but expected %d\n", iValue, MSI_NULL_INTEGER);
2592 
2593  /* Record::IntegerDataGet, bad index */
2594  hr = Record_IntegerDataGet(pRecord, 10, &iValue);
2595  ok(hr == S_OK, "Record_IntegerDataGet failed, hresult %#lx\n", hr);
2596  ok(iValue == MSI_NULL_INTEGER, "Record_IntegerDataGet result was %d but expected %d\n", iValue, MSI_NULL_INTEGER);
2597 
2598  /* Record::IntegerDataPut */
2599  hr = Record_IntegerDataPut(pRecord, 1, 100);
2600  ok(hr == S_OK, "Record_IntegerDataPut failed, hresult %#lx\n", hr);
2601 
2602  /* Record::IntegerDataPut, bad index */
2603  hr = Record_IntegerDataPut(pRecord, 10, 100);
2604  ok(hr == DISP_E_EXCEPTION, "Record_IntegerDataPut failed, hresult %#lx\n", hr);
2605  ok_exception(hr, L"IntegerData,Field");
2606 
2607  /* Record::IntegerDataGet */
2608  hr = Record_IntegerDataGet(pRecord, 1, &iValue);
2609  ok(hr == S_OK, "Record_IntegerDataGet failed, hresult %#lx\n", hr);
2610  ok(iValue == 100, "Record_IntegerDataGet result was %d but expected 100\n", iValue);
2611 
2612  IDispatch_Release(pRecord);
2613  }
2614 
2616 
2617  /* Installer::OpenPackage */
2618  hr = Installer_OpenPackage(szPath, 0, &pSession);
2619  if (hr == DISP_E_EXCEPTION)
2620  {
2621  skip("OpenPackage failed, insufficient rights?\n");
2623  return;
2624  }
2625  ok(hr == S_OK, "Installer_OpenPackage failed, hresult %#lx\n", hr);
2626  if (hr == S_OK)
2627  {
2628  test_Session(pSession);
2629  IDispatch_Release(pSession);
2630  }
2631 
2632  /* Installer::OpenDatabase */
2634  ok(hr == S_OK, "Installer_OpenDatabase failed, hresult %#lx\n", hr);
2635  if (hr == S_OK)
2636  {
2637  test_Database(pDatabase, FALSE);
2638  IDispatch_Release(pDatabase);
2639  }
2640 
2641  /* Installer::SummaryInformation */
2642  hr = Installer_SummaryInformation(szPath, 0, &pSumInfo);
2643  ok(hr == S_OK, "Installer_SummaryInformation failed, hresult %#lx\n", hr);
2644  if (hr == S_OK)
2645  {
2647  IDispatch_Release(pSumInfo);
2648  }
2649 
2650  hr = Installer_SummaryInformation(NULL, 0, &pSumInfo);
2651  ok(hr == DISP_E_EXCEPTION, "Installer_SummaryInformation failed, hresult %#lx\n", hr);
2652 
2653  /* Installer::RegistryValue */
2655 
2656  /* Installer::ProductState for our product code, which should not be installed */
2657  hr = Installer_ProductState(L"{837450fa-a39b-4bc8-b321-08b393f784b3}", &iValue);
2658  ok(hr == S_OK, "Installer_ProductState failed, hresult %#lx\n", hr);
2659  ok(iValue == INSTALLSTATE_UNKNOWN, "Installer_ProductState returned %d, expected %d\n", iValue, INSTALLSTATE_UNKNOWN);
2660 
2661  /* Installer::ProductInfo for our product code, which should not be installed */
2662 
2663  /* Package name */
2664  memset(szPath, 0, sizeof(szPath));
2665  hr = Installer_ProductInfo(L"{837450fa-a39b-4bc8-b321-08b393f784b3}", L"PackageName", szPath);
2666  ok(hr == DISP_E_EXCEPTION, "Installer_ProductInfo failed, hresult %#lx\n", hr);
2667  ok_exception(hr, L"ProductInfo,Product,Attribute");
2668 
2669  /* NULL attribute and NULL product code */
2670  memset(szPath, 0, sizeof(szPath));
2672  ok(hr == DISP_E_EXCEPTION, "Installer_ProductInfo failed, hresult %#lx\n", hr);
2673  ok_exception(hr, L"ProductInfo,Product,Attribute");
2674 
2675  /* Installer::Products */
2677 
2678  /* Installer::RelatedProducts for our upgrade code, should not find anything */
2679  hr = Installer_RelatedProducts(L"{CE067E8D-2E1A-4367-B734-4EB2BDAD6565}", &pStringList);
2680  ok(hr == S_OK, "Installer_RelatedProducts failed, hresult %#lx\n", hr);
2681  if (hr == S_OK)
2682  {
2683  /* StringList::Count */
2684  hr = StringList_Count(pStringList, &iCount);
2685  ok(hr == S_OK, "StringList_Count failed, hresult %#lx\n", hr);
2686  ok(!iCount, "Expected no related products but found %d\n", iCount);
2687 
2688  IDispatch_Release(pStringList);
2689  }
2690 
2691  /* Installer::Version */
2692  memset(szPath, 0, sizeof(szPath));
2694  ok(hr == S_OK, "Installer_VersionGet failed, hresult %#lx\n", hr);
2695 
2696  /* Installer::InstallProduct and other tests that depend on our product being installed */
2698 }
#define DISP_E_EXCEPTION
Definition: winerror.h:2518
static const msi_summary_info summary_info[]
Definition: