ReactOS  0.4.14-dev-614-gbfd8a84
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 BOOL (WINAPI *pCheckTokenMembership)(HANDLE
 
static LONG (WINAPI *pRegDeleteKeyExA)(HKEY
 
 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 PSID
 
static PBOOL
 
static DWORD
 
static PHANDLE
 
static LPCSTR
 
static REGSAM
 
static const charmsifile = "winetest-automation.msi"
 
static const WCHAR szMsifile [] = {'w','i','n','e','t','e','s','t','-','a','u','t','o','m','a','t','i','o','n','.','m','s','i',0}
 
static const WCHAR szMSITEST [] = { 'M','S','I','T','E','S','T',0 }
 
static const WCHAR szProductCode [] = { '{','8','3','7','4','5','0','f','a','-','a','3','9','b','-','4','b','c','8','-','b','3','2','1','-','0','8','b','3','9','3','f','7','8','4','b','3','}',0 }
 
static const WCHAR szUpgradeCode [] = { '{','C','E','0','6','7','E','8','D','-','2','E','1','A','-','4','3','6','7','-','B','7','3','4','-','4','E','B','2','B','D','A','D','6','5','6','5','}',0 }
 
static const WCHAR szProductInfoException [] = { 'P','r','o','d','u','c','t','I','n','f','o',',','P','r','o','d','u','c','t',',','A','t','t','r','i','b','u','t','e',0 }
 
static const WCHAR WINE_INSTALLPROPERTY_PACKAGENAMEW [] = {'P','a','c','k','a','g','e','N','a','m','e',0}
 
static const WCHAR WINE_INSTALLPROPERTY_PRODUCTNAMEW [] = {'P','r','o','d','u','c','t','N','a','m','e',0}
 
static const WCHAR WINE_INSTALLPROPERTY_LOCALPACKAGEW [] = {'L','o','c','a','l','P','a','c','k','a','g','e',0}
 
static FILETIME systemtime
 
static CHAR CURR_DIR [MAX_PATH]
 
static EXCEPINFO excepinfo
 
static const WCHAR szProgId [] = { 'W','i','n','d','o','w','s','I','n','s','t','a','l','l','e','r','.','I','n','s','t','a','l','l','e','r',0 }
 
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 WCHAR szSource [] = {'M','s','i',' ','A','P','I',' ','E','r','r','o','r',0}
 
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 204 of file automation.c.

◆ ADD_INFO_I2

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

Definition at line 201 of file automation.c.

◆ ADD_INFO_I4

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

Definition at line 202 of file automation.c.

◆ ADD_INFO_LPSTR

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

Definition at line 203 of file automation.c.

◆ ADD_TABLE

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

Definition at line 177 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:418
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:99
static CHAR string1[MAX_PATH]
Definition: automation.c:468
int WINAPI lstrcmpA(LPCSTR lpString1, LPCSTR lpString2)
Definition: lstring.c:18
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: gl.h:1546
smooth NULL
Definition: ftsmooth.c:416
#define MAX_PATH
Definition: compat.h:26

Definition at line 488 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:99
static CHAR string1[MAX_PATH]
Definition: automation.c:468
int WINAPI lstrcmpA(LPCSTR lpString1, LPCSTR lpString2)
Definition: lstring.c:18
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: gl.h:1546
smooth NULL
Definition: ftsmooth.c:416
Definition: id3.c:18
#define MAX_PATH
Definition: compat.h:26

Definition at line 494 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, szSource); \
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
smooth NULL
Definition: ftsmooth.c:416
static const WCHAR szSource[]
Definition: automation.c:501
#define ok(value,...)
Definition: atltest.h:57
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
Definition: oleaut.c:271
static EXCEPINFO excepinfo
Definition: automation.c:60
static const WCHAR szDescription[]
Definition: provider.c:55

Definition at line 503 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:99
static CHAR string2[MAX_PATH]
Definition: automation.c:468
static CHAR string1[MAX_PATH]
Definition: automation.c:468
int WINAPI lstrcmpA(LPCSTR lpString1, LPCSTR lpString2)
Definition: lstring.c:18
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: gl.h:1546
smooth NULL
Definition: ftsmooth.c:416
#define MAX_PATH
Definition: compat.h:26

Definition at line 470 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:99
static CHAR string2[MAX_PATH]
Definition: automation.c:468
static CHAR string1[MAX_PATH]
Definition: automation.c:468
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: gl.h:1546
smooth NULL
Definition: ftsmooth.c:416
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define MAX_PATH
Definition: compat.h:26
GLenum GLsizei len
Definition: glext.h:6722

Definition at line 479 of file automation.c.

◆ TEST_SUMMARYINFO_PROPERTIES_MODIFIED

#define TEST_SUMMARYINFO_PROPERTIES_MODIFIED   4

Definition at line 1604 of file automation.c.

Typedef Documentation

◆ msi_summary_info

◆ msi_table

Function Documentation

◆ BOOL()

static BOOL ( WINAPI pCheckTokenMembership)
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 319 of file automation.c.

321 {
322  MSIHANDLE db;
323  UINT r;
324  WCHAR *nameW;
325  int j, len;
326 
327  len = MultiByteToWideChar( CP_ACP, 0, name, -1, NULL, 0 );
328  if (!(nameW = HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) ))) return;
329  MultiByteToWideChar( CP_ACP, 0, name, -1, nameW, len );
330 
332  ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
333 
334  /* import the tables into the database */
335  for (j = 0; j < num_tables; j++)
336  {
337  const msi_table *table = &tables[j];
338 
339  write_file(table->filename, table->data, (table->size - 1) * sizeof(char));
340 
341  r = MsiDatabaseImportA(db, CURR_DIR, table->filename);
342  ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
343 
344  DeleteFileA(table->filename);
345  }
346 
347  write_msi_summary_info(db, info, num_info);
348 
349  r = MsiDatabaseCommit(db);
350  ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
351 
352  MsiCloseHandle(db);
353  HeapFree( GetProcessHeap(), 0, nameW );
354 }
#define ERROR_SUCCESS
Definition: deptool.c:10
static void write_file(const CHAR *filename, const char *data, int data_size)
Definition: automation.c:283
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
#define CP_ACP
Definition: compat.h:99
static CHAR CURR_DIR[MAX_PATH]
Definition: automation.c:59
unsigned long MSIHANDLE
Definition: msiserver.idl:25
smooth NULL
Definition: ftsmooth.c:416
BOOL WINAPI DeleteFileA(IN LPCSTR lpFileName)
Definition: delete.c:24
static const msi_table tables[]
Definition: automation.c:179
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:293
#define GetProcessHeap()
Definition: compat.h:403
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
__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:270
BYTE * data
UINT WINAPI MsiDatabaseCommit(MSIHANDLE hdb)
Definition: msiquery.c:813
#define ok(value,...)
Definition: atltest.h:57
UINT WINAPI MsiOpenDatabaseW(LPCWSTR szDBPath, LPCWSTR szPersist, MSIHANDLE *phDB)
Definition: database.c:303
unsigned int UINT
Definition: ndis.h:50
#define MultiByteToWideChar
Definition: compat.h:100
Definition: name.c:38
#define HeapFree(x, y, z)
Definition: compat.h:402
UINT WINAPI MsiDatabaseImportA(MSIHANDLE handle, LPCSTR szFolder, LPCSTR szFilename)
Definition: database.c:900

Referenced by create_package().

◆ create_file()

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

Definition at line 400 of file automation.c.

401 {
402  HANDLE file;
403  DWORD written, left;
404 
406  ok(file != INVALID_HANDLE_VALUE, "Failure to open file %s\n", name);
407  WriteFile(file, name, strlen(name), &written, NULL);
408  WriteFile(file, "\n", strlen("\n"), &written, NULL);
409 
410  left = size - lstrlenA(name) - 1;
411 
414 
415  CloseHandle(file);
416 }
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:406
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:1154
#define INVALID_HANDLE_VALUE
Definition: compat.h:399
DWORD WINAPI DECLSPEC_HOTPATCH SetFilePointer(HANDLE hFile, LONG lDistanceToMove, PLONG lpDistanceToMoveHigh, DWORD dwMoveMethod)
Definition: fileinfo.c:204
#define GENERIC_WRITE
Definition: nt_native.h:90
smooth NULL
Definition: ftsmooth.c:416
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
Definition: name.c:38
#define CreateFileA(a, b, c, d, e, f, g)
Definition: compat.h:407
Definition: fci.c:126

Referenced by create_test_files().

◆ create_package()

static BOOL create_package ( LPWSTR  path)
static

Definition at line 356 of file automation.c.

357 {
358  static const WCHAR slashW[] = {'\\',0};
359  DWORD len;
360 
361  /* Prepare package */
363  sizeof(tables) / sizeof(msi_table), summary_info,
364  sizeof(summary_info) / sizeof(msi_summary_info));
365 
367  CURR_DIR, -1, path, MAX_PATH);
368  ok(len, "MultiByteToWideChar returned error %d\n", GetLastError());
369  if (!len)
370  return FALSE;
371 
372  lstrcatW(path, slashW);
374  return TRUE;
375 }
#define TRUE
Definition: types.h:120
static const msi_summary_info summary_info[]
Definition: automation.c:206
#define CP_ACP
Definition: compat.h:99
#define MB_PRECOMPOSED
Definition: winnls.h:278
static CHAR CURR_DIR[MAX_PATH]
Definition: automation.c:59
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
static const msi_table tables[]
Definition: automation.c:179
static const char * msifile
Definition: automation.c:49
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define MAX_PATH
Definition: compat.h:26
unsigned long DWORD
Definition: ntddk_ex.h:95
GLenum GLsizei len
Definition: glext.h:6722
static const WCHAR szMsifile[]
Definition: automation.c:50
#define ok(value,...)
Definition: atltest.h:57
#define MultiByteToWideChar
Definition: compat.h:100
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:319
static const WCHAR slashW[]
Definition: devenum.c:59

Referenced by test_dispatch(), and test_Installer().

◆ create_test_files()

static void create_test_files ( void  )
static

Definition at line 418 of file automation.c.

419 {
420  CreateDirectoryA("msitest", NULL);
421  create_file("msitest\\one.txt", 100);
422  CreateDirectoryA("msitest\\first", NULL);
423  create_file("msitest\\first\\two.txt", 100);
424  CreateDirectoryA("msitest\\second", NULL);
425  create_file("msitest\\second\\three.txt", 100);
426  CreateDirectoryA("msitest\\cabout",NULL);
427  create_file("msitest\\cabout\\four.txt", 100);
428  CreateDirectoryA("msitest\\cabout\\new",NULL);
429  create_file("msitest\\cabout\\new\\five.txt", 100);
430  create_file("msitest\\filename", 100);
431 }
BOOL WINAPI CreateDirectoryA(IN LPCSTR lpPathName, IN LPSECURITY_ATTRIBUTES lpSecurityAttributes)
Definition: dir.c:37
smooth NULL
Definition: ftsmooth.c:416
static void create_file(const CHAR *name, DWORD size)
Definition: automation.c:400

Referenced by test_Installer_InstallProduct().

◆ Database_OpenView()

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

Definition at line 1370 of file automation.c.

1371 {
1372  VARIANT varresult;
1373  VARIANTARG vararg[1];
1374  DISPPARAMS dispparams = {vararg, NULL, sizeof(vararg)/sizeof(VARIANTARG), 0};
1375  HRESULT hr;
1376 
1377  VariantInit(&vararg[0]);
1378  V_VT(&vararg[0]) = VT_BSTR;
1379  V_BSTR(&vararg[0]) = SysAllocString(szSql);
1380 
1381  hr = invoke(pDatabase, "OpenView", DISPATCH_METHOD, &dispparams, &varresult, VT_DISPATCH);
1382  *pView = V_DISPATCH(&varresult);
1383  return hr;
1384 }
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
smooth NULL
Definition: ftsmooth.c:416
BSTR WINAPI SysAllocString(LPCOLESTR str)
Definition: oleaut.c:238
LONG HRESULT
Definition: typedefs.h:77
static HRESULT invoke(IDispatch *pDispatch, LPCSTR szName, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, VARTYPE vtResult)
Definition: automation.c:864
#define V_VT(A)
Definition: oleauto.h:211
#define V_BSTR(A)
Definition: oleauto.h:226
struct stdole::DISPPARAMS DISPPARAMS

Referenced by test_Database().

◆ Database_SummaryInformation()

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

Definition at line 1386 of file automation.c.

1387 {
1388  VARIANT varresult;
1389  VARIANTARG vararg[1];
1390  DISPPARAMS dispparams = {vararg, NULL, sizeof(vararg)/sizeof(VARIANTARG), 0};
1391  HRESULT hr;
1392 
1393  VariantInit(&vararg[0]);
1394  V_VT(&vararg[0]) = VT_I4;
1395  V_I4(&vararg[0]) = iUpdateCount;
1396 
1397  hr = invoke(pDatabase, "SummaryInformation", DISPATCH_PROPERTYGET, &dispparams, &varresult, VT_DISPATCH);
1398  *pSummaryInfo = V_DISPATCH(&varresult);
1399  return hr;
1400 }
Definition: compat.h:1947
#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
smooth NULL
Definition: ftsmooth.c:416
LONG HRESULT
Definition: typedefs.h:77
static HRESULT invoke(IDispatch *pDispatch, LPCSTR szName, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, VARTYPE vtResult)
Definition: automation.c:864
#define V_VT(A)
Definition: oleauto.h:211
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 2040 of file automation.c.

2041 {
2042  char name[MAX_PATH];
2043  DWORD ret;
2044 
2045  while (!(ret = RegEnumKeyA(hkey, 0, name, sizeof(name))))
2046  {
2047  HKEY tmp;
2048  if (!(ret = RegOpenKeyExA( hkey, name, 0, KEY_ENUMERATE_SUB_KEYS, &tmp )))
2049  {
2050  ret = delete_key( tmp );
2051  RegCloseKey( tmp );
2052  }
2053  if (ret) break;
2054  }
2055  if (ret != ERROR_NO_MORE_ITEMS) return ret;
2056  RegDeleteKeyA( hkey, "" );
2057  return 0;
2058 }
#define ERROR_NO_MORE_ITEMS
Definition: compat.h:95
static DWORD delete_key(HKEY hkey)
Definition: automation.c:2040
LONG WINAPI RegOpenKeyExA(_In_ HKEY hKey, _In_ LPCSTR lpSubKey, _In_ DWORD ulOptions, _In_ REGSAM samDesired, _Out_ PHKEY phkResult)
Definition: reg.c:3331
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
#define MAX_PATH
Definition: compat.h:26
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 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 272 of file automation.c.

273 {
274  if (pRegDeleteKeyExA)
275  return pRegDeleteKeyExA( key, subkey, access, 0 );
276  return RegDeleteKeyA( key, subkey );
277 }
LONG WINAPI RegDeleteKeyA(_In_ HKEY hKey, _In_ LPCSTR lpSubKey)
Definition: reg.c:1222
GLuint GLint GLboolean GLint GLenum access
Definition: glext.h:7866
Definition: path.c:41

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 433 of file automation.c.

434 {
435  CHAR path[MAX_PATH];
436 
438  lstrcatA(path, "\\");
439  lstrcatA(path, rel_path);
440 
441  if (is_file)
442  return DeleteFileA(path);
443  else
444  return RemoveDirectoryA(path);
445 }
static char PROG_FILES_DIR[MAX_PATH]
Definition: automation.c:381
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:26
LPSTR WINAPI lstrcpyA(LPSTR lpString1, LPCSTR lpString2)
Definition: lstring.c:100
BOOL WINAPI RemoveDirectoryA(IN LPCSTR lpPathName)
Definition: dir.c:714

Referenced by test_Installer_InstallProduct().

◆ delete_registry_key()

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

Definition at line 2382 of file automation.c.

2383 {
2384  UINT ret;
2385  CHAR *string = NULL;
2386  HKEY hkey;
2387  DWORD dwSize;
2388 
2389  ret = RegOpenKeyExA(hkeyParent, subkey, 0, access, &hkey);
2390  if (ret != ERROR_SUCCESS) return ret;
2392  if (ret != ERROR_SUCCESS) return ret;
2393  if (!(string = HeapAlloc(GetProcessHeap(), 0, ++dwSize))) return ERROR_NOT_ENOUGH_MEMORY;
2394 
2395  while (RegEnumKeyA(hkey, 0, string, dwSize) == ERROR_SUCCESS)
2396  delete_registry_key(hkey, string, access);
2397 
2398  RegCloseKey(hkey);
2399  HeapFree(GetProcessHeap(), 0, string);
2400  delete_key_portable(hkeyParent, subkey, access);
2401  return ERROR_SUCCESS;
2402 }
#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:3607
char CHAR
Definition: xmlstorage.h:175
LONG WINAPI RegOpenKeyExA(_In_ HKEY hKey, _In_ LPCSTR lpSubKey, _In_ DWORD ulOptions, _In_ REGSAM samDesired, _Out_ PHKEY phkResult)
Definition: reg.c:3331
#define ERROR_NOT_ENOUGH_MEMORY
Definition: dderror.h:7
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
smooth NULL
Definition: ftsmooth.c:416
#define GetProcessHeap()
Definition: compat.h:403
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
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:272
GLuint GLint GLboolean GLint GLenum access
Definition: glext.h:7866
unsigned int UINT
Definition: ndis.h:50
static UINT delete_registry_key(HKEY hkeyParent, LPCSTR subkey, REGSAM access)
Definition: automation.c:2382
#define HeapFree(x, y, z)
Definition: compat.h:402
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
Definition: env.c:54

Referenced by test_Installer_InstallProduct().

◆ delete_test_files()

static void delete_test_files ( void  )
static

Definition at line 447 of file automation.c.

448 {
450  DeleteFileA("msitest\\cabout\\new\\five.txt");
451  DeleteFileA("msitest\\cabout\\four.txt");
452  DeleteFileA("msitest\\second\\three.txt");
453  DeleteFileA("msitest\\first\\two.txt");
454  DeleteFileA("msitest\\one.txt");
455  DeleteFileA("msitest\\filename");
456  RemoveDirectoryA("msitest\\cabout\\new");
457  RemoveDirectoryA("msitest\\cabout");
458  RemoveDirectoryA("msitest\\second");
459  RemoveDirectoryA("msitest\\first");
460  RemoveDirectoryA("msitest");
461 }
BOOL WINAPI DeleteFileA(IN LPCSTR lpFileName)
Definition: delete.c:24
static const char * msifile
Definition: automation.c:49
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 2405 of file automation.c.

2406 {
2407  UINT ret;
2408  CHAR *string = NULL;
2409  int idx = 0;
2410  HKEY hkey;
2411  DWORD dwSize;
2412  BOOL found = FALSE;
2413 
2414  *phkey = 0;
2415 
2416  ret = RegOpenKeyExA(hkeyParent, subkey, 0, access, &hkey);
2417  if (ret != ERROR_SUCCESS) return ret;
2419  if (ret != ERROR_SUCCESS) return ret;
2420  if (!(string = HeapAlloc(GetProcessHeap(), 0, ++dwSize))) return ERROR_NOT_ENOUGH_MEMORY;
2421 
2422  while (!found &&
2423  RegEnumKeyA(hkey, idx++, string, dwSize) == ERROR_SUCCESS)
2424  {
2425  if (!strcmp(string, findkey))
2426  {
2427  *phkey = hkey;
2428  found = TRUE;
2429  }
2430  else if (find_registry_key(hkey, string, findkey, access, phkey) == ERROR_SUCCESS) found = TRUE;
2431  }
2432 
2433  if (*phkey != hkey) RegCloseKey(hkey);
2434  HeapFree(GetProcessHeap(), 0, string);
2435  return (found ? ERROR_SUCCESS : ERROR_FILE_NOT_FOUND);
2436 }
#define TRUE
Definition: types.h:120
#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:3607
char CHAR
Definition: xmlstorage.h:175
LONG WINAPI RegOpenKeyExA(_In_ HKEY hKey, _In_ LPCSTR lpSubKey, _In_ DWORD ulOptions, _In_ REGSAM samDesired, _Out_ PHKEY phkResult)
Definition: reg.c:3331
#define ERROR_NOT_ENOUGH_MEMORY
Definition: dderror.h:7
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
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:2405
unsigned int idx
Definition: utils.c:41
smooth NULL
Definition: ftsmooth.c:416
#define ERROR_FILE_NOT_FOUND
Definition: disk.h:79
#define GetProcessHeap()
Definition: compat.h:403
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
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
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
#define HeapFree(x, y, z)
Definition: compat.h:402
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
Definition: env.c:54

Referenced by test_Installer_InstallProduct().

◆ get_dispid()

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

Definition at line 522 of file automation.c.

523 {
524  LPOLESTR str;
525  UINT len;
526  DISPID id = -1;
527  HRESULT r;
528 
529  len = MultiByteToWideChar(CP_ACP, 0, name, -1, NULL, 0 );
530  str = HeapAlloc(GetProcessHeap(), 0, len*sizeof(WCHAR) );
531  if (str)
532  {
533  MultiByteToWideChar(CP_ACP, 0, name, -1, str, len );
534  r = IDispatch_GetIDsOfNames( disp, &IID_NULL, &str, 1, 0, &id );
535  HeapFree(GetProcessHeap(), 0, str);
536  if (r != S_OK)
537  return -1;
538  }
539 
540  return id;
541 }
disp
Definition: i386-dis.c:3181
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
#define CP_ACP
Definition: compat.h:99
static LPOLESTR
Definition: stg_prop.c:27
const WCHAR * str
smooth NULL
Definition: ftsmooth.c:416
#define GetProcessHeap()
Definition: compat.h:403
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
#define IID_NULL
Definition: guiddef.h:98
GLenum GLsizei len
Definition: glext.h:6722
#define S_OK
Definition: intsafe.h:59
static VARIANTARG static DISPID
Definition: ordinal.c:49
unsigned int UINT
Definition: ndis.h:50
#define MultiByteToWideChar
Definition: compat.h:100
Definition: name.c:38
GLenum GLuint id
Definition: glext.h:5579
#define HeapFree(x, y, z)
Definition: compat.h:402

Referenced by test_dispid().

◆ get_program_files_dir()

static BOOL get_program_files_dir ( LPSTR  buf)
static

Definition at line 383 of file automation.c.

384 {
385  HKEY hkey;
387 
388  if (RegOpenKeyA(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Windows\\CurrentVersion", &hkey))
389  return FALSE;
390 
391  size = MAX_PATH;
392  if (RegQueryValueExA(hkey, "ProgramFilesDir (x86)", 0, &type, (LPBYTE)buf, &size) &&
393  RegQueryValueExA(hkey, "ProgramFilesDir", 0, &type, (LPBYTE)buf, &size))
394  return FALSE;
395 
396  RegCloseKey(hkey);
397  return TRUE;
398 }
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:4023
#define TRUE
Definition: types.h:120
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
unsigned char * LPBYTE
Definition: typedefs.h:52
GLsizeiptr size
Definition: glext.h:5919
#define MAX_PATH
Definition: compat.h:26
unsigned long DWORD
Definition: ntddk_ex.h:95
#define REG_EXPAND_SZ
Definition: nt_native.h:1494
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12

Referenced by START_TEST().

◆ init_functionpointers()

static void init_functionpointers ( void  )
static

Definition at line 216 of file automation.c.

217 {
218  HMODULE hadvapi32 = GetModuleHandleA("advapi32.dll");
219  HMODULE hkernel32 = GetModuleHandleA("kernel32.dll");
220 
221 #define GET_PROC(dll, func) \
222  p ## func = (void *)GetProcAddress(dll, #func); \
223  if(!p ## func) \
224  trace("GetProcAddress(%s) failed\n", #func);
225 
226  GET_PROC(hadvapi32, CheckTokenMembership);
227  GET_PROC(hadvapi32, OpenProcessToken);
228  GET_PROC(hadvapi32, RegDeleteKeyExA)
230 
231 #undef GET_PROC
232 }
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
BOOL WINAPI CheckTokenMembership(IN HANDLE ExistingTokenHandle, IN PSID SidToCheck, OUT PBOOL IsMember)
Definition: token.c:21
#define GET_PROC(dll, func)
BOOL WINAPI IsWow64Process(IN HANDLE hProcess, OUT PBOOL Wow64Process)
Definition: proc.c:1974
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
Definition: loader.c:821
BOOL WINAPI OpenProcessToken(HANDLE ProcessHandle, DWORD DesiredAccess, PHANDLE TokenHandle)
Definition: security.c:296

Referenced by START_TEST().

◆ Installer_CreateRecord()

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

Definition at line 906 of file automation.c.

907 {
908  VARIANT varresult;
909  VARIANTARG vararg[1];
910  DISPPARAMS dispparams = {vararg, NULL, sizeof(vararg)/sizeof(VARIANTARG), 0};
911  HRESULT hr;
912 
913  VariantInit(&vararg[0]);
914  V_VT(&vararg[0]) = VT_I4;
915  V_I4(&vararg[0]) = count;
916 
917  hr = invoke(pInstaller, "CreateRecord", DISPATCH_METHOD, &dispparams, &varresult, VT_DISPATCH);
918  *pRecord = V_DISPATCH(&varresult);
919  return hr;
920 }
Definition: compat.h:1947
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
smooth NULL
Definition: ftsmooth.c:416
LONG HRESULT
Definition: typedefs.h:77
static HRESULT invoke(IDispatch *pDispatch, LPCSTR szName, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, VARTYPE vtResult)
Definition: automation.c:864
static IDispatch * pInstaller
Definition: automation.c:66
#define V_VT(A)
Definition: oleauto.h:211
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 1024 of file automation.c.

1025 {
1026  VARIANT varresult;
1027  VARIANTARG vararg[2];
1028  DISPPARAMS dispparams = {vararg, NULL, sizeof(vararg)/sizeof(VARIANTARG), 0};
1029 
1030  VariantInit(&vararg[1]);
1031  V_VT(&vararg[1]) = VT_BSTR;
1032  V_BSTR(&vararg[1]) = SysAllocString(szPackagePath);
1033  VariantInit(&vararg[0]);
1034  V_VT(&vararg[0]) = VT_BSTR;
1035  V_BSTR(&vararg[0]) = SysAllocString(szPropertyValues);
1036 
1037  return invoke(pInstaller, "InstallProduct", DISPATCH_METHOD, &dispparams, &varresult, VT_EMPTY);
1038 }
void WINAPI VariantInit(VARIANTARG *pVarg)
Definition: variant.c:568
#define DISPATCH_METHOD
Definition: oleauto.h:1006
smooth NULL
Definition: ftsmooth.c:416
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:864
static IDispatch * pInstaller
Definition: automation.c:66
#define V_VT(A)
Definition: oleauto.h:211
#define V_BSTR(A)
Definition: oleauto.h:226
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 1005 of file automation.c.

1006 {
1007  VARIANT varresult;
1008  VARIANTARG vararg[2];
1009  DISPPARAMS dispparams = {vararg, NULL, sizeof(vararg)/sizeof(VARIANTARG), 0};
1010  HRESULT hr;
1011 
1012  VariantInit(&vararg[1]);
1013  V_VT(&vararg[1]) = VT_BSTR;
1014  V_BSTR(&vararg[1]) = SysAllocString(szDatabasePath);
1015  VariantInit(&vararg[0]);
1016  V_VT(&vararg[0]) = VT_I4;
1017  V_I4(&vararg[0]) = openmode;
1018 
1019  hr = invoke(pInstaller, "OpenDatabase", DISPATCH_METHOD, &dispparams, &varresult, VT_DISPATCH);
1020  *pDatabase = V_DISPATCH(&varresult);
1021  return hr;
1022 }
Definition: compat.h:1947
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
smooth NULL
Definition: ftsmooth.c:416
BSTR WINAPI SysAllocString(LPCOLESTR str)
Definition: oleaut.c:238
LONG HRESULT
Definition: typedefs.h:77
static HRESULT invoke(IDispatch *pDispatch, LPCSTR szName, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, VARTYPE vtResult)
Definition: automation.c:864
static IDispatch * pInstaller
Definition: automation.c:66
#define V_VT(A)
Definition: oleauto.h:211
#define V_BSTR(A)
Definition: oleauto.h:226
struct stdole::DISPPARAMS DISPPARAMS

Referenced by test_Installer().

◆ Installer_OpenPackage()

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

Definition at line 986 of file automation.c.

987 {
988  VARIANT varresult;
989  VARIANTARG vararg[2];
990  DISPPARAMS dispparams = {vararg, NULL, sizeof(vararg)/sizeof(VARIANTARG), 0};
991  HRESULT hr;
992 
993  VariantInit(&vararg[1]);
994  V_VT(&vararg[1]) = VT_BSTR;
995  V_BSTR(&vararg[1]) = SysAllocString(szPackagePath);
996  VariantInit(&vararg[0]);
997  V_VT(&vararg[0]) = VT_I4;
998  V_I4(&vararg[0]) = options;
999 
1000  hr = invoke(pInstaller, "OpenPackage", DISPATCH_METHOD, &dispparams, &varresult, VT_DISPATCH);
1001  *pSession = V_DISPATCH(&varresult);
1002  return hr;
1003 }
Definition: compat.h:1947
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
smooth NULL
Definition: ftsmooth.c:416
BSTR WINAPI SysAllocString(LPCOLESTR str)
Definition: oleaut.c:238
int options
Definition: main.c:106
LONG HRESULT
Definition: typedefs.h:77
static HRESULT invoke(IDispatch *pDispatch, LPCSTR szName, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, VARTYPE vtResult)
Definition: automation.c:864
static IDispatch * pInstaller
Definition: automation.c:66
#define V_VT(A)
Definition: oleauto.h:211
#define V_BSTR(A)
Definition: oleauto.h:226
struct stdole::DISPPARAMS DISPPARAMS

Referenced by test_Installer().

◆ Installer_ProductInfo()

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

Definition at line 1057 of file automation.c.

1058 {
1059  VARIANT varresult;
1060  VARIANTARG vararg[2];
1061  DISPPARAMS dispparams = {vararg, NULL, sizeof(vararg)/sizeof(VARIANTARG), 0};
1062  HRESULT hr;
1063 
1064  VariantInit(&vararg[1]);
1065  V_VT(&vararg[1]) = VT_BSTR;
1066  V_BSTR(&vararg[1]) = SysAllocString(szProduct);
1067  VariantInit(&vararg[0]);
1068  V_VT(&vararg[0]) = VT_BSTR;
1069  V_BSTR(&vararg[0]) = SysAllocString(szAttribute);
1070 
1071  hr = invoke(pInstaller, "ProductInfo", DISPATCH_PROPERTYGET, &dispparams, &varresult, VT_BSTR);
1072  if (V_BSTR(&varresult)) lstrcpyW(szString, V_BSTR(&varresult));
1073  VariantClear(&varresult);
1074  return hr;
1075 }
#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
smooth NULL
Definition: ftsmooth.c:416
BSTR WINAPI SysAllocString(LPCOLESTR str)
Definition: oleaut.c:238
LONG HRESULT
Definition: typedefs.h:77
static HRESULT invoke(IDispatch *pDispatch, LPCSTR szName, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, VARTYPE vtResult)
Definition: automation.c:864
static IDispatch * pInstaller
Definition: automation.c:66
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:414
struct stdole::DISPPARAMS DISPPARAMS

Referenced by test_Installer(), and test_Installer_InstallProduct().

◆ Installer_Products()

static HRESULT Installer_Products ( IDispatch **  pStringList)
static

Definition at line 1077 of file automation.c.

1078 {
1079  VARIANT varresult;
1080  DISPPARAMS dispparams = {NULL, NULL, 0, 0};
1081  HRESULT hr;
1082 
1083  hr = invoke(pInstaller, "Products", DISPATCH_PROPERTYGET, &dispparams, &varresult, VT_DISPATCH);
1084  *pStringList = V_DISPATCH(&varresult);
1085  return hr;
1086 }
#define DISPATCH_PROPERTYGET
Definition: oleauto.h:1007
HRESULT hr
Definition: shlfolder.c:183
#define V_DISPATCH(A)
Definition: oleauto.h:239
smooth NULL
Definition: ftsmooth.c:416
LONG HRESULT
Definition: typedefs.h:77
static HRESULT invoke(IDispatch *pDispatch, LPCSTR szName, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, VARTYPE vtResult)
Definition: automation.c:864
static IDispatch * pInstaller
Definition: automation.c:66
struct stdole::DISPPARAMS DISPPARAMS

Referenced by test_Installer_Products().

◆ Installer_ProductState()

static HRESULT Installer_ProductState ( LPCWSTR  szProduct,
int pInstallState 
)
static

Definition at line 1040 of file automation.c.

1041 {
1042  VARIANT varresult;
1043  VARIANTARG vararg[1];
1044  DISPPARAMS dispparams = {vararg, NULL, sizeof(vararg)/sizeof(VARIANTARG), 0};
1045  HRESULT hr;
1046 
1047  VariantInit(&vararg[0]);
1048  V_VT(&vararg[0]) = VT_BSTR;
1049  V_BSTR(&vararg[0]) = SysAllocString(szProduct);
1050 
1051  hr = invoke(pInstaller, "ProductState", DISPATCH_PROPERTYGET, &dispparams, &varresult, VT_I4);
1052  *pInstallState = V_I4(&varresult);
1053  VariantClear(&varresult);
1054  return hr;
1055 }
Definition: compat.h:1947
#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
smooth NULL
Definition: ftsmooth.c:416
BSTR WINAPI SysAllocString(LPCOLESTR str)
Definition: oleaut.c:238
LONG HRESULT
Definition: typedefs.h:77
static HRESULT invoke(IDispatch *pDispatch, LPCSTR szName, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, VARTYPE vtResult)
Definition: automation.c:864
static IDispatch * pInstaller
Definition: automation.c:66
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
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 922 of file automation.c.

923 {
924  VARIANTARG vararg[3];
925  DISPPARAMS dispparams = {vararg, NULL, sizeof(vararg)/sizeof(VARIANTARG), 0};
926 
927  VariantInit(&vararg[2]);
928  V_VT(&vararg[2]) = VT_I4;
929  V_I4(&vararg[2]) = (INT_PTR)hkey;
930  VariantInit(&vararg[1]);
931  V_VT(&vararg[1]) = VT_BSTR;
932  V_BSTR(&vararg[1]) = SysAllocString(szKey);
933  VariantInit(&vararg[0]);
934  VariantCopy(&vararg[0], &vValue);
935  VariantClear(&vValue);
936 
937  return invoke(pInstaller, "RegistryValue", DISPATCH_METHOD, &dispparams, pVarResult, vtExpect);
938 }
Definition: compat.h:1947
void WINAPI VariantInit(VARIANTARG *pVarg)
Definition: variant.c:568
int32_t INT_PTR
Definition: typedefs.h:62
#define V_I4(A)
Definition: oleauto.h:247
#define DISPATCH_METHOD
Definition: oleauto.h:1006
smooth NULL
Definition: ftsmooth.c:416
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:864
static IDispatch * pInstaller
Definition: automation.c:66
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
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 940 of file automation.c.

941 {
942  VARIANT varresult;
943  VARIANTARG vararg;
944  HRESULT hr;
945 
946  VariantInit(&vararg);
947  V_VT(&vararg) = VT_EMPTY;
948  hr = Installer_RegistryValue(hkey, szKey, vararg, &varresult, VT_BOOL);
949  *pBool = V_BOOL(&varresult);
950  VariantClear(&varresult);
951  return hr;
952 }
HRESULT hr
Definition: shlfolder.c:183
void WINAPI VariantInit(VARIANTARG *pVarg)
Definition: variant.c:568
LONG HRESULT
Definition: typedefs.h:77
#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:922
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 970 of file automation.c.

971 {
972  VARIANT varresult;
973  VARIANTARG vararg;
974  HRESULT hr;
975 
976  VariantInit(&vararg);
977  V_VT(&vararg) = VT_I4;
978  V_I4(&vararg) = iValue;
979 
980  hr = Installer_RegistryValue(hkey, szKey, vararg, &varresult, vtResult);
981  if (SUCCEEDED(hr) && vtResult == VT_BSTR) lstrcpyW(szString, V_BSTR(&varresult));
982  VariantClear(&varresult);
983  return hr;
984 }
Definition: compat.h:1947
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:77
static HRESULT Installer_RegistryValue(HKEY hkey, LPCWSTR szKey, VARIANT vValue, VARIANT *pVarResult, VARTYPE vtExpect)
Definition: automation.c:922
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:414
#define SUCCEEDED(hr)
Definition: intsafe.h:57

Referenced by test_Installer_RegistryValue().

◆ Installer_RegistryValueW()

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

Definition at line 954 of file automation.c.

955 {
956  VARIANT varresult;
957  VARIANTARG vararg;
958  HRESULT hr;
959 
960  VariantInit(&vararg);
961  V_VT(&vararg) = VT_BSTR;
962  V_BSTR(&vararg) = SysAllocString(szValue);
963 
964  hr = Installer_RegistryValue(hkey, szKey, vararg, &varresult, VT_BSTR);
965  if (V_BSTR(&varresult)) lstrcpyW(szString, V_BSTR(&varresult));
966  VariantClear(&varresult);
967  return hr;
968 }
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:77
static HRESULT Installer_RegistryValue(HKEY hkey, LPCWSTR szKey, VARIANT vValue, VARIANT *pVarResult, VARTYPE vtExpect)
Definition: automation.c:922
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:414

Referenced by test_Installer_RegistryValue().

◆ Installer_RelatedProducts()

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

Definition at line 1088 of file automation.c.

1089 {
1090  VARIANT varresult;
1091  VARIANTARG vararg[1];
1092  DISPPARAMS dispparams = {vararg, NULL, sizeof(vararg)/sizeof(VARIANTARG), 0};
1093  HRESULT hr;
1094 
1095  VariantInit(&vararg[0]);
1096  V_VT(&vararg[0]) = VT_BSTR;
1097  V_BSTR(&vararg[0]) = SysAllocString(szProduct);
1098 
1099  hr = invoke(pInstaller, "RelatedProducts", DISPATCH_PROPERTYGET, &dispparams, &varresult, VT_DISPATCH);
1100  *pStringList = V_DISPATCH(&varresult);
1101  return hr;
1102 }
#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
smooth NULL
Definition: ftsmooth.c:416
BSTR WINAPI SysAllocString(LPCOLESTR str)
Definition: oleaut.c:238
LONG HRESULT
Definition: typedefs.h:77
static HRESULT invoke(IDispatch *pDispatch, LPCSTR szName, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, VARTYPE vtResult)
Definition: automation.c:864
static IDispatch * pInstaller
Definition: automation.c:66
#define V_VT(A)
Definition: oleauto.h:211
#define V_BSTR(A)
Definition: oleauto.h:226
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 1130 of file automation.c.

1131 {
1132  VARIANT varresult;
1133  VARIANTARG vararg[2];
1134  DISPPARAMS dispparams = {vararg, NULL, sizeof(vararg)/sizeof(VARIANTARG), 0};
1135  HRESULT hr;
1136 
1137  VariantInit(&vararg[1]);
1138  V_VT(&vararg[1]) = VT_BSTR;
1139  V_BSTR(&vararg[1]) = SysAllocString(PackagePath);
1140  VariantInit(&vararg[0]);
1141  V_VT(&vararg[0]) = VT_I4;
1142  V_I4(&vararg[0]) = UpdateCount;
1143 
1144  hr = invoke(pInstaller, "SummaryInformation", DISPATCH_PROPERTYGET, &dispparams, &varresult, VT_DISPATCH);
1145  *pSumInfo = V_DISPATCH(&varresult);
1146  return hr;
1147 }
Definition: compat.h:1947
#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
smooth NULL
Definition: ftsmooth.c:416
BSTR WINAPI SysAllocString(LPCOLESTR str)
Definition: oleaut.c:238
LONG HRESULT
Definition: typedefs.h:77
static HRESULT invoke(IDispatch *pDispatch, LPCSTR szName, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, VARTYPE vtResult)
Definition: automation.c:864
static IDispatch * pInstaller
Definition: automation.c:66
#define V_VT(A)
Definition: oleauto.h:211
#define V_BSTR(A)
Definition: oleauto.h:226
struct stdole::DISPPARAMS DISPPARAMS

Referenced by test_Installer().

◆ Installer_UILevelPut()

static HRESULT Installer_UILevelPut ( int  level)
static

Definition at line 1116 of file automation.c.

1117 {
1118  VARIANT varresult;
1119  VARIANTARG vararg;
1120  DISPID dispid = DISPID_PROPERTYPUT;
1121  DISPPARAMS dispparams = {&vararg, &dispid, sizeof(vararg)/sizeof(VARIANTARG), 1};
1122 
1123  VariantInit(&vararg);
1124  V_VT(&vararg) = VT_I4;
1125  V_I4(&vararg) = level;
1126 
1127  return invoke(pInstaller, "UILevel", DISPATCH_PROPERTYPUT, &dispparams, &varresult, VT_EMPTY);
1128 }
GLint level
Definition: gl.h:1546
Definition: compat.h:1947
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:864
static IDispatch * pInstaller
Definition: automation.c:66
#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 1104 of file automation.c.

1105 {
1106  VARIANT varresult;
1107  DISPPARAMS dispparams = {NULL, NULL, 0, 0};
1108  HRESULT hr;
1109 
1110  hr = invoke(pInstaller, "Version", DISPATCH_PROPERTYGET, &dispparams, &varresult, VT_BSTR);
1111  if (V_BSTR(&varresult)) lstrcpyW(szVersion, V_BSTR(&varresult));
1112  VariantClear(&varresult);
1113  return hr;
1114 }
#define DISPATCH_PROPERTYGET
Definition: oleauto.h:1007
HRESULT hr
Definition: shlfolder.c:183
smooth NULL
Definition: ftsmooth.c:416
LONG HRESULT
Definition: typedefs.h:77
static HRESULT invoke(IDispatch *pDispatch, LPCSTR szName, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, VARTYPE vtResult)
Definition: automation.c:864
static IDispatch * pInstaller
Definition: automation.c:66
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:414
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 864 of file automation.c.

865 {
866  OLECHAR *name = NULL;
867  DISPID dispid;
868  HRESULT hr;
869  UINT i;
870  UINT len;
871 
872  memset(pVarResult, 0, sizeof(VARIANT));
873  VariantInit(pVarResult);
874 
875  len = MultiByteToWideChar(CP_ACP, 0, szName, -1, NULL, 0 );
876  name = HeapAlloc(GetProcessHeap(), 0, len*sizeof(WCHAR) );
877  if (!name) return E_FAIL;
879  hr = IDispatch_GetIDsOfNames(pDispatch, &IID_NULL, &name, 1, LOCALE_USER_DEFAULT, &dispid);
881  ok(hr == S_OK, "IDispatch::GetIDsOfNames returned 0x%08x\n", hr);
882  if (hr != S_OK) return hr;
883 
884  memset(&excepinfo, 0, sizeof(excepinfo));
885  hr = IDispatch_Invoke(pDispatch, dispid, &IID_NULL, LOCALE_NEUTRAL, wFlags, pDispParams, pVarResult, &excepinfo, NULL);
886 
887  if (hr == S_OK)
888  {
890  ok(V_VT(pVarResult) == vtResult, "Variant result type is %d, expected %d\n", V_VT(pVarResult), vtResult);
891  if (vtResult != VT_EMPTY)
892  {
893  hr = VariantChangeTypeEx(pVarResult, pVarResult, LOCALE_NEUTRAL, 0, vtResult);
894  ok(hr == S_OK, "VariantChangeTypeEx returned 0x%08x\n", hr);
895  }
896  }
897 
898  for (i=0; i<pDispParams->cArgs; i++)
899  VariantClear(&pDispParams->rgvarg[i]);
900 
901  return hr;
902 }
WCHAR OLECHAR
Definition: compat.h:1941
HRESULT hr
Definition: shlfolder.c:183
#define CP_ACP
Definition: compat.h:99
#define LOCALE_USER_DEFAULT
void WINAPI VariantInit(VARIANTARG *pVarg)
Definition: variant.c:568
#define E_FAIL
Definition: ddrawi.h:102
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
smooth NULL
Definition: ftsmooth.c:416
#define todo_wine_if(is_todo)
Definition: test.h:164
#define GetProcessHeap()
Definition: compat.h:403
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
static int _invoke_todo_vtResult
Definition: automation.c:862
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:519
#define S_OK
Definition: intsafe.h:59
static VARIANTARG static DISPID
Definition: ordinal.c:49
#define ok(value,...)
Definition: atltest.h:57
unsigned int UINT
Definition: ndis.h:50
#define MultiByteToWideChar
Definition: compat.h:100
Definition: name.c:38
static const WCHAR szName[]
Definition: msipriv.h:1194
static EXCEPINFO excepinfo
Definition: automation.c:60
#define LOCALE_NEUTRAL
#define memset(x, y, z)
Definition: compat.h:39
#define HeapFree(x, y, z)
Definition: compat.h:402
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 234 of file automation.c.

235 {
237  PSID Group = NULL;
238  BOOL IsInGroup;
239  HANDLE token;
240 
241  if (!pCheckTokenMembership || !pOpenProcessToken) return FALSE;
242 
244  DOMAIN_ALIAS_RID_ADMINS, 0, 0, 0, 0, 0, 0, &Group) ||
245  !pCheckTokenMembership(NULL, Group, &IsInGroup))
246  {
247  trace("Could not check if the current user is an administrator\n");
248  FreeSid(Group);
249  return FALSE;
250  }
251  FreeSid(Group);
252 
253  if (!IsInGroup)
254  {
255  /* Only administrators have enough privileges for these tests */
256  return TRUE;
257  }
258 
259  if (pOpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &token))
260  {
261  BOOL ret;
263  DWORD size;
264 
267  return (ret && type == TokenElevationTypeLimited);
268  }
269  return FALSE;
270 }
enum _TOKEN_ELEVATION_TYPE TOKEN_ELEVATION_TYPE
#define TRUE
Definition: types.h:120
#define CloseHandle
Definition: compat.h:406
_In_opt_ PSID Group
Definition: rtlfuncs.h:1606
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
unsigned int BOOL
Definition: ntddk_ex.h:94
PVOID WINAPI FreeSid(PSID pSid)
Definition: security.c:577
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
smooth NULL
Definition: ftsmooth.c:416
#define SECURITY_NT_AUTHORITY
Definition: setypes.h:526
GLsizeiptr size
Definition: glext.h:5919
#define trace
Definition: atltest.h:70
#define SECURITY_BUILTIN_DOMAIN_RID
Definition: setypes.h:553
#define TOKEN_QUERY
Definition: setypes.h:874
HANDLE WINAPI GetCurrentProcess(VOID)
Definition: proc.c:1138
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
BOOL WINAPI GetTokenInformation(HANDLE TokenHandle, TOKEN_INFORMATION_CLASS TokenInformationClass, LPVOID TokenInformation, DWORD TokenInformationLength, PDWORD ReturnLength)
Definition: security.c:413
#define DOMAIN_ALIAS_RID_ADMINS
Definition: setypes.h:624
SID_IDENTIFIER_AUTHORITY NtAuthority
Definition: database.c:19
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:553

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 1449 of file automation.c.

1450 {
1451  VARIANT varresult;
1452  DISPPARAMS dispparams = {NULL, NULL, 0, 0};
1453  HRESULT hr = invoke(pRecord, "FieldCount", DISPATCH_PROPERTYGET, &dispparams, &varresult, VT_I4);
1454  *pFieldCount = V_I4(&varresult);
1455  VariantClear(&varresult);
1456  return hr;
1457 }
Definition: compat.h:1947
#define DISPATCH_PROPERTYGET
Definition: oleauto.h:1007
HRESULT hr
Definition: shlfolder.c:183
#define V_I4(A)
Definition: oleauto.h:247
smooth NULL
Definition: ftsmooth.c:416
LONG HRESULT
Definition: typedefs.h:77
static HRESULT invoke(IDispatch *pDispatch, LPCSTR szName, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, VARTYPE vtResult)
Definition: automation.c:864
HRESULT WINAPI DECLSPEC_HOTPATCH VariantClear(VARIANTARG *pVarg)
Definition: variant.c:648
struct stdole::DISPPARAMS DISPPARAMS

Referenced by test_Installer().

◆ Record_IntegerDataGet()

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

Definition at line 1493 of file automation.c.

1494 {
1495  VARIANT varresult;
1496  VARIANTARG vararg[1];
1497  DISPPARAMS dispparams = {vararg, NULL, sizeof(vararg)/sizeof(VARIANTARG), 0};
1498  HRESULT hr;
1499 
1500  VariantInit(&vararg[0]);
1501  V_VT(&vararg[0]) = VT_I4;
1502  V_I4(&vararg[0]) = iField;
1503 
1504  hr = invoke(pRecord, "IntegerData", DISPATCH_PROPERTYGET, &dispparams, &varresult, VT_I4);
1505  *pValue = V_I4(&varresult);
1506  VariantClear(&varresult);
1507  return hr;
1508 }
Definition: compat.h:1947
#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
smooth NULL
Definition: ftsmooth.c:416
LONG HRESULT
Definition: typedefs.h:77
static HRESULT invoke(IDispatch *pDispatch, LPCSTR szName, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, VARTYPE vtResult)
Definition: automation.c:864
HRESULT WINAPI DECLSPEC_HOTPATCH VariantClear(VARIANTARG *pVarg)
Definition: variant.c:648
#define V_VT(A)
Definition: oleauto.h:211
struct stdole::DISPPARAMS DISPPARAMS

Referenced by test_Installer().

◆ Record_IntegerDataPut()

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

Definition at line 1510 of file automation.c.

1511 {
1512  VARIANT varresult;
1513  VARIANTARG vararg[2];
1514  DISPID dispid = DISPID_PROPERTYPUT;
1515  DISPPARAMS dispparams = {vararg, &dispid, sizeof(vararg)/sizeof(VARIANTARG), 1};
1516 
1517  VariantInit(&vararg[1]);
1518  V_VT(&vararg[1]) = VT_I4;
1519  V_I4(&vararg[1]) = iField;
1520  VariantInit(&vararg[0]);
1521  V_VT(&vararg[0]) = VT_I4;
1522  V_I4(&vararg[0]) = iValue;
1523 
1524  return invoke(pRecord, "IntegerData", DISPATCH_PROPERTYPUT, &dispparams, &varresult, VT_EMPTY);
1525 }
Definition: compat.h:1947
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:864
#define V_VT(A)
Definition: oleauto.h:211
static VARIANTARG static DISPID
Definition: ordinal.c:49
struct stdole::DISPPARAMS DISPPARAMS

Referenced by test_Installer().

◆ Record_StringDataGet()

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

Definition at line 1459 of file automation.c.

1460 {
1461  VARIANT varresult;
1462  VARIANTARG vararg[1];
1463  DISPPARAMS dispparams = {vararg, NULL, sizeof(vararg)/sizeof(VARIANTARG), 0};
1464  HRESULT hr;
1465 
1466  VariantInit(&vararg[0]);
1467  V_VT(&vararg[0]) = VT_I4;
1468  V_I4(&vararg[0]) = iField;
1469 
1470  hr = invoke(pRecord, "StringData", DISPATCH_PROPERTYGET, &dispparams, &varresult, VT_BSTR);
1471  if (V_BSTR(&varresult)) lstrcpyW(szString, V_BSTR(&varresult));
1472  VariantClear(&varresult);
1473  return hr;
1474 }
Definition: compat.h:1947
#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
smooth NULL
Definition: ftsmooth.c:416
LONG HRESULT
Definition: typedefs.h:77
static HRESULT invoke(IDispatch *pDispatch, LPCSTR szName, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, VARTYPE vtResult)
Definition: automation.c:864
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:414
struct stdole::DISPPARAMS DISPPARAMS

Referenced by test_Database().

◆ Record_StringDataPut()

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

Definition at line 1476 of file automation.c.

1477 {
1478  VARIANT varresult;
1479  VARIANTARG vararg[2];
1480  DISPID dispid = DISPID_PROPERTYPUT;
1481  DISPPARAMS dispparams = {vararg, &dispid, sizeof(vararg)/sizeof(VARIANTARG), 1};
1482 
1483  VariantInit(&vararg[1]);
1484  V_VT(&vararg[1]) = VT_I4;
1485  V_I4(&vararg[1]) = iField;
1486  VariantInit(&vararg[0]);
1487  V_VT(&vararg[0]) = VT_BSTR;
1488  V_BSTR(&vararg[0]) = SysAllocString(szString);
1489 
1490  return invoke(pRecord, "StringData", DISPATCH_PROPERTYPUT, &dispparams, &varresult, VT_EMPTY);
1491 }
Definition: compat.h:1947
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:864
#define V_VT(A)
Definition: oleauto.h:211
#define V_BSTR(A)
Definition: oleauto.h:226
static VARIANTARG static DISPID
Definition: ordinal.c:49
struct stdole::DISPPARAMS DISPPARAMS

Referenced by test_Database().

◆ Session_Database()

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

Definition at line 1240 of file automation.c.

1241 {
1242  VARIANT varresult;
1243  DISPPARAMS dispparams = {NULL, NULL, 0, 0};
1244  HRESULT hr;
1245 
1246  hr = invoke(pSession, "Database", DISPATCH_PROPERTYGET, &dispparams, &varresult, VT_DISPATCH);
1247  *pDatabase = V_DISPATCH(&varresult);
1248  return hr;
1249 }
#define DISPATCH_PROPERTYGET
Definition: oleauto.h:1007
HRESULT hr
Definition: shlfolder.c:183
#define V_DISPATCH(A)
Definition: oleauto.h:239
smooth NULL
Definition: ftsmooth.c:416
LONG HRESULT
Definition: typedefs.h:77
static HRESULT invoke(IDispatch *pDispatch, LPCSTR szName, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, VARTYPE vtResult)
Definition: automation.c:864
struct stdole::DISPPARAMS DISPPARAMS

Referenced by test_Session().

◆ Session_DoAction()

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

Definition at line 1251 of file automation.c.

1252 {
1253  VARIANT varresult;
1254  VARIANTARG vararg[1];
1255  DISPPARAMS dispparams = {vararg, NULL, sizeof(vararg)/sizeof(VARIANTARG), 0};
1256  HRESULT hr;
1257 
1258  VariantInit(&vararg[0]);
1259  V_VT(&vararg[0]) = VT_BSTR;
1260  V_BSTR(&vararg[0]) = SysAllocString(szAction);
1261 
1262  hr = invoke(pSession, "DoAction", DISPATCH_METHOD, &dispparams, &varresult, VT_I4);
1263  *iReturn = V_I4(&varresult);
1264  VariantClear(&varresult);
1265  return hr;
1266 }
Definition: compat.h:1947
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
smooth NULL
Definition: ftsmooth.c:416
BSTR WINAPI SysAllocString(LPCOLESTR str)
Definition: oleaut.c:238
LONG HRESULT
Definition: typedefs.h:77
static HRESULT invoke(IDispatch *pDispatch, LPCSTR szName, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, VARTYPE vtResult)
Definition: automation.c:864
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
struct stdole::DISPPARAMS DISPPARAMS

Referenced by test_Session().

◆ Session_EvaluateCondition()

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

Definition at line 1268 of file automation.c.

1269 {
1270  VARIANT varresult;
1271  VARIANTARG vararg[1];
1272  DISPPARAMS dispparams = {vararg, NULL, sizeof(vararg)/sizeof(VARIANTARG), 0};
1273  HRESULT hr;
1274 
1275  VariantInit(&vararg[0]);
1276  V_VT(&vararg[0]) = VT_BSTR;
1277  V_BSTR(&vararg[0]) = SysAllocString(szCondition);
1278 
1279  hr = invoke(pSession, "EvaluateCondition", DISPATCH_METHOD, &dispparams, &varresult, VT_I4);
1280  *iReturn = V_I4(&varresult);
1281  VariantClear(&varresult);
1282  return hr;
1283 }
Definition: compat.h:1947
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
smooth NULL
Definition: ftsmooth.c:416
BSTR WINAPI SysAllocString(LPCOLESTR str)
Definition: oleaut.c:238
LONG HRESULT
Definition: typedefs.h:77
static HRESULT invoke(IDispatch *pDispatch, LPCSTR szName, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, VARTYPE vtResult)
Definition: automation.c:864
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
struct stdole::DISPPARAMS DISPPARAMS

Referenced by test_Session().

◆ Session_FeatureCurrentState()

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

Definition at line 1319 of file automation.c.

1320 {
1321  VARIANT varresult;
1322  VARIANTARG vararg[1];
1323  DISPPARAMS dispparams = {vararg, NULL, sizeof(vararg)/sizeof(VARIANTARG), 0};
1324  HRESULT hr;
1325 
1326  VariantInit(&vararg[0]);
1327  V_VT(&vararg[0]) = VT_BSTR;
1328  V_BSTR(&vararg[0]) = SysAllocString(szName);
1329 
1330  hr = invoke(pSession, "FeatureCurrentState", DISPATCH_PROPERTYGET, &dispparams, &varresult, VT_I4);
1331  *pState = V_I4(&varresult);
1332  VariantClear(&varresult);
1333  return hr;
1334 }
Definition: compat.h:1947
#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
smooth NULL
Definition: ftsmooth.c:416
BSTR WINAPI SysAllocString(LPCOLESTR str)
Definition: oleaut.c:238
LONG HRESULT
Definition: typedefs.h:77
static HRESULT invoke(IDispatch *pDispatch, LPCSTR szName, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, VARTYPE vtResult)
Definition: automation.c:864
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
static const WCHAR szName[]
Definition: msipriv.h:1194
struct stdole::DISPPARAMS DISPPARAMS

Referenced by test_Session().

◆ Session_FeatureRequestStateGet()

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

Definition at line 1336 of file automation.c.

1337 {
1338  VARIANT varresult;
1339  VARIANTARG vararg[1];
1340  DISPPARAMS dispparams = {vararg, NULL, sizeof(vararg)/sizeof(VARIANTARG), 0};
1341  HRESULT hr;
1342 
1343  VariantInit(&vararg[0]);
1344  V_VT(&vararg[0]) = VT_BSTR;
1345  V_BSTR(&vararg[0]) = SysAllocString(szName);
1346 
1347  hr = invoke(pSession, "FeatureRequestState", DISPATCH_PROPERTYGET, &dispparams, &varresult, VT_I4);
1348  *pState = V_I4(&varresult);
1349  VariantClear(&varresult);
1350  return hr;
1351 }
Definition: compat.h:1947
#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
smooth NULL
Definition: ftsmooth.c:416
BSTR WINAPI SysAllocString(LPCOLESTR str)
Definition: oleaut.c:238
LONG HRESULT
Definition: typedefs.h:77
static HRESULT invoke(IDispatch *pDispatch, LPCSTR szName, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, VARTYPE vtResult)
Definition: automation.c:864
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
static const WCHAR szName[]
Definition: msipriv.h:1194
struct stdole::DISPPARAMS DISPPARAMS

Referenced by test_Session().

◆ Session_FeatureRequestStatePut()

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

Definition at line 1353 of file automation.c.

1354 {
1355  VARIANT varresult;
1356  VARIANTARG vararg[2];
1357  DISPID dispid = DISPID_PROPERTYPUT;
1358  DISPPARAMS dispparams = {vararg, &dispid, sizeof(vararg)/sizeof(VARIANTARG), 1};
1359 
1360  VariantInit(&vararg[1]);
1361  V_VT(&vararg[1]) = VT_BSTR;
1362  V_BSTR(&vararg[1]) = SysAllocString(szName);
1363  VariantInit(&vararg[0]);
1364  V_VT(&vararg[0]) = VT_I4;
1365  V_I4(&vararg[0]) = iState;
1366 
1367  return invoke(pSession, "FeatureRequestState", DISPATCH_PROPERTYPUT, &dispparams, &varresult, VT_EMPTY);
1368 }
Definition: compat.h:1947
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:864
#define V_VT(A)
Definition: oleauto.h:211
#define V_BSTR(A)
Definition: oleauto.h:226
static VARIANTARG static DISPID
Definition: ordinal.c:49
static const WCHAR szName[]
Definition: msipriv.h:1194
struct stdole::DISPPARAMS DISPPARAMS

Referenced by test_Session().

◆ Session_Installer()

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

Definition at line 1149 of file automation.c.

1150 {
1151  VARIANT varresult;
1152  DISPPARAMS dispparams = {NULL, NULL, 0, 0};
1153  HRESULT hr;
1154 
1155  hr = invoke(pSession, "Installer", DISPATCH_PROPERTYGET, &dispparams, &varresult, VT_DISPATCH);
1156  *pInst = V_DISPATCH(&varresult);
1157  return hr;
1158 }
#define DISPATCH_PROPERTYGET
Definition: oleauto.h:1007
HRESULT hr
Definition: shlfolder.c:183
#define V_DISPATCH(A)
Definition: oleauto.h:239
smooth NULL
Definition: ftsmooth.c:416
LONG HRESULT
Definition: typedefs.h:77
static HRESULT invoke(IDispatch *pDispatch, LPCSTR szName, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, VARTYPE vtResult)
Definition: automation.c:864
struct stdole::DISPPARAMS DISPPARAMS

Referenced by test_Session().

◆ Session_LanguageGet()

static HRESULT Session_LanguageGet ( IDispatch pSession,
UINT pLangId 
)
static

Definition at line 1194 of file automation.c.

1195 {
1196  VARIANT varresult;
1197  DISPPARAMS dispparams = {NULL, NULL, 0, 0};
1198  HRESULT hr;
1199 
1200  hr = invoke(pSession, "Language", DISPATCH_PROPERTYGET, &dispparams, &varresult, VT_I4);
1201  *pLangId = V_I4(&varresult);
1202  VariantClear(&varresult);
1203  return hr;
1204 }
Definition: compat.h:1947
#define DISPATCH_PROPERTYGET
Definition: oleauto.h:1007
HRESULT hr
Definition: shlfolder.c:183
#define V_I4(A)
Definition: oleauto.h:247
smooth NULL
Definition: ftsmooth.c:416
LONG HRESULT
Definition: typedefs.h:77
static HRESULT invoke(IDispatch *pDispatch, LPCSTR szName, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, VARTYPE vtResult)
Definition: automation.c:864
HRESULT WINAPI DECLSPEC_HOTPATCH VariantClear(VARIANTARG *pVarg)
Definition: variant.c:648
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 1285 of file automation.c.

1286 {
1287  VARIANT varresult;
1288  VARIANTARG vararg[2];
1289  DISPPARAMS dispparams = {vararg, NULL, sizeof(vararg)/sizeof(VARIANTARG), 0};
1290  HRESULT hr;
1291 
1292  VariantInit(&varresult);
1293  V_VT(vararg) = VT_DISPATCH;
1294  V_DISPATCH(vararg) = record;
1295  V_VT(vararg+1) = VT_I4;
1296  V_I4(vararg+1) = kind;
1297 
1298  hr = invoke(pSession, "Message", DISPATCH_METHOD, &dispparams, &varresult, VT_I4);
1299 
1300  ok(V_VT(&varresult) == VT_I4, "V_VT(varresult) = %d\n", V_VT(&varresult));
1301  *ret = V_I4(&varresult);
1302 
1303  return hr;
1304 }
Definition: compat.h:1947
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
smooth NULL
Definition: ftsmooth.c:416
LONG HRESULT
Definition: typedefs.h:77
static HRESULT invoke(IDispatch *pDispatch, LPCSTR szName, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, VARTYPE vtResult)
Definition: automation.c:864
int ret
#define V_VT(A)
Definition: oleauto.h:211
#define ok(value,...)
Definition: atltest.h:57
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 1206 of file automation.c.

1207 {
1208  VARIANT varresult;
1209  VARIANTARG vararg[1];
1210  DISPPARAMS dispparams = {vararg, NULL, sizeof(vararg)/sizeof(VARIANTARG), 0};
1211  HRESULT hr;
1212 
1213  VariantInit(&vararg[0]);
1214  V_VT(&vararg[0]) = VT_I4;
1215  V_I4(&vararg[0]) = iFlag;
1216 
1217  hr = invoke(pSession, "Mode", DISPATCH_PROPERTYGET, &dispparams, &varresult, VT_BOOL);
1218  *mode = V_BOOL(&varresult);
1219  VariantClear(&varresult);
1220  return hr;
1221 }
Definition: compat.h:1947
#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
smooth NULL
Definition: ftsmooth.c:416
LONG HRESULT
Definition: typedefs.h:77
static HRESULT invoke(IDispatch *pDispatch, LPCSTR szName, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, VARTYPE vtResult)
Definition: automation.c:864
#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
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 1223 of file automation.c.

1224 {
1225  VARIANT varresult;
1226  VARIANTARG vararg[2];
1227  DISPID dispid = DISPID_PROPERTYPUT;
1228  DISPPARAMS dispparams = {vararg, &dispid, sizeof(vararg)/sizeof(VARIANTARG), 1};
1229 
1230  VariantInit(&vararg[1]);
1231  V_VT(&vararg[1]) = VT_I4;
1232  V_I4(&vararg[1]) = iFlag;
1233  VariantInit(&vararg[0]);
1234  V_VT(&vararg[0]) = VT_BOOL;
1235  V_BOOL(&vararg[0]) = mode;
1236 
1237  return invoke(pSession, "Mode", DISPATCH_PROPERTYPUT, &dispparams, &varresult, VT_EMPTY);
1238 }
Definition: compat.h:1947
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:864
#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
struct stdole::DISPPARAMS DISPPARAMS

Referenced by test_Session().

◆ Session_PropertyGet()

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

Definition at line 1160 of file automation.c.

1161 {
1162  VARIANT varresult;
1163  VARIANTARG vararg[1];
1164  DISPPARAMS dispparams = {vararg, NULL, sizeof(vararg)/sizeof(VARIANTARG), 0};
1165  HRESULT hr;
1166 
1167  VariantInit(&vararg[0]);
1168  V_VT(&vararg[0]) = VT_BSTR;
1169  V_BSTR(&vararg[0]) = SysAllocString(szName);
1170 
1171  hr = invoke(pSession, "Property", DISPATCH_PROPERTYGET, &dispparams, &varresult, VT_BSTR);
1172  if (V_BSTR(&varresult)) lstrcpyW(szReturn, V_BSTR(&varresult));
1173  VariantClear(&varresult);
1174  return hr;
1175 }
#define DISPATCH_PROPERTYGET
Definition: oleauto.h:1007
HRESULT hr
Definition: shlfolder.c:183
void WINAPI VariantInit(VARIANTARG *pVarg)
Definition: variant.c:568
smooth NULL
Definition: ftsmooth.c:416
BSTR WINAPI SysAllocString(LPCOLESTR str)
Definition: oleaut.c:238
LONG HRESULT
Definition: typedefs.h:77
static HRESULT invoke(IDispatch *pDispatch, LPCSTR szName, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, VARTYPE vtResult)
Definition: automation.c:864
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:414
static const WCHAR szName[]
Definition: msipriv.h:1194
struct stdole::DISPPARAMS DISPPARAMS

Referenced by test_Session().

◆ Session_PropertyPut()

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

Definition at line 1177 of file automation.c.

1178 {
1179  VARIANT varresult;
1180  VARIANTARG vararg[2];
1181  DISPID dispid = DISPID_PROPERTYPUT;
1182  DISPPARAMS dispparams = {vararg, &dispid, sizeof(vararg)/sizeof(VARIANTARG), 1};
1183 
1184  VariantInit(&vararg[1]);
1185  V_VT(&vararg[1]) = VT_BSTR;
1186  V_BSTR(&vararg[1]) = SysAllocString(szName);
1187  VariantInit(&vararg[0]);
1188  V_VT(&vararg[0]) = VT_BSTR;
1189  V_BSTR(&vararg[0]) = SysAllocString(szValue);
1190 
1191  return invoke(pSession, "Property", DISPATCH_PROPERTYPUT, &dispparams, &varresult, VT_EMPTY);
1192 }
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:864
#define V_VT(A)
Definition: oleauto.h:211
#define V_BSTR(A)
Definition: oleauto.h:226
static VARIANTARG static DISPID
Definition: ordinal.c:49
static const WCHAR szName[]
Definition: msipriv.h:1194
struct stdole::DISPPARAMS DISPPARAMS

Referenced by test_Session().

◆ Session_SetInstallLevel()

static HRESULT Session_SetInstallLevel ( IDispatch pSession,
LONG  iInstallLevel 
)
static

Definition at line 1306 of file automation.c.

1307 {
1308  VARIANT varresult;
1309  VARIANTARG vararg[1];
1310  DISPPARAMS dispparams = {vararg, NULL, sizeof(vararg)/sizeof(VARIANTARG), 0};
1311 
1312  VariantInit(&vararg[0]);
1313  V_VT(&vararg[0]) = VT_I4;
1314  V_I4(&vararg[0]) = iInstallLevel;
1315 
1316  return invoke(pSession, "SetInstallLevel", DISPATCH_METHOD, &dispparams, &varresult, VT_EMPTY);
1317 }
Definition: compat.h:1947
void WINAPI VariantInit(VARIANTARG *pVarg)
Definition: variant.c:568
#define V_I4(A)
Definition: oleauto.h:247
#define DISPATCH_METHOD
Definition: oleauto.h:1006
smooth NULL
Definition: ftsmooth.c:416
static HRESULT invoke(IDispatch *pDispatch, LPCSTR szName, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, VARTYPE vtResult)
Definition: automation.c:864
#define V_VT(A)
Definition: oleauto.h:211
struct stdole::DISPPARAMS DISPPARAMS

Referenced by test_Session().

◆ START_TEST()

START_TEST ( automation  )

Definition at line 2758 of file automation.c.

2759 {
2760  DWORD len;
2761  char temp_path[MAX_PATH], prev_path[MAX_PATH];
2762  HRESULT hr;
2763  CLSID clsid;
2764  IUnknown *pUnk;
2765 
2767 
2768  if (pIsWow64Process)
2769  pIsWow64Process(GetCurrentProcess(), &is_wow64);
2770 
2772 
2773  GetCurrentDirectoryA(MAX_PATH, prev_path);
2776 
2778  len = lstrlenA(CURR_DIR);
2779 
2780  if(len && (CURR_DIR[len - 1] == '\\'))
2781  CURR_DIR[len - 1] = 0;
2782 
2784 
2785  hr = OleInitialize(NULL);
2786  ok (hr == S_OK, "OleInitialize returned 0x%08x\n", hr);
2788  ok (hr == S_OK, "CLSIDFromProgID returned 0x%08x\n", hr);
2789  hr = CoCreateInstance(&clsid, NULL, CLSCTX_INPROC_SERVER, &IID_IUnknown, (void **)&pUnk);
2790  ok(hr == S_OK, "CoCreateInstance returned 0x%08x\n", hr);
2791 
2792  if (pUnk)
2793  {
2794  hr = IUnknown_QueryInterface(pUnk, &IID_IDispatch, (void **)&pInstaller);
2795  ok (hr == S_OK, "IUnknown::QueryInterface returned 0x%08x\n", hr);
2796 
2797  test_dispid();
2798  test_dispatch();
2799  test_Installer();
2800 
2801  IDispatch_Release(pInstaller);
2802  IUnknown_Release(pUnk);
2803  }
2804 
2805  OleUninitialize();
2806 
2807  SetCurrentDirectoryA(prev_path);
2808 }
VOID WINAPI GetSystemTimeAsFileTime(OUT PFILETIME lpFileTime)
Definition: time.c:128
static BOOL get_program_files_dir(LPSTR buf)
Definition: automation.c:383
HRESULT hr
Definition: shlfolder.c:183
static char PROG_FILES_DIR[MAX_PATH]
Definition: automation.c:381
static CHAR CURR_DIR[MAX_PATH]
Definition: automation.c:59
static void init_functionpointers(void)
Definition: automation.c:216
HRESULT WINAPI DECLSPEC_HOTPATCH CLSIDFromProgID(LPCOLESTR progid, LPCLSID clsid)
Definition: compobj.c:2602
static void test_Installer(void)
Definition: automation.c:2617
smooth NULL
Definition: ftsmooth.c:416
static FILETIME systemtime
Definition: automation.c:58
LONG HRESULT
Definition: typedefs.h:77
const GUID IID_IUnknown
HANDLE WINAPI GetCurrentProcess(VOID)
Definition: proc.c:1138
#define MAX_PATH
Definition: compat.h:26
static IDispatch * pInstaller
Definition: automation.c:66
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:2205
GLenum GLsizei len
Definition: glext.h:6722
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:600
#define S_OK
Definition: intsafe.h:59
int WINAPI lstrlenA(LPCSTR lpString)
Definition: lstring.c:145
DWORD WINAPI GetTempPathA(IN DWORD nBufferLength, OUT LPSTR lpBuffer)
Definition: path.c:2053
static const WCHAR szProgId[]
Definition: automation.c:65
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:2145
static void test_dispatch(void)
Definition: automation.c:638
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 1527 of file automation.c.

1528 {
1529  VARIANT varresult;
1530  DISPPARAMS dispparams = {NULL, NULL, 0, 0};
1531  HRESULT hr = invoke(pList, "_NewEnum", DISPATCH_METHOD, &dispparams, &varresult, VT_UNKNOWN);
1532  *ppEnumVARIANT = V_UNKNOWN(&varresult);
1533  return hr;
1534 }
HRESULT hr
Definition: shlfolder.c:183
#define DISPATCH_METHOD
Definition: oleauto.h:1006
smooth NULL
Definition: ftsmooth.c:416
LONG HRESULT
Definition: typedefs.h:77
static HRESULT invoke(IDispatch *pDispatch, LPCSTR szName, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, VARTYPE vtResult)
Definition: automation.c:864
#define V_UNKNOWN(A)
Definition: oleauto.h:281
struct stdole::DISPPARAMS DISPPARAMS

Referenced by test_Installer_Products().

◆ StringList_Count()

static HRESULT StringList_Count ( IDispatch pStringList,
int pCount 
)
static

Definition at line 1553 of file automation.c.

1554 {
1555  VARIANT varresult;
1556  DISPPARAMS dispparams = {NULL, NULL, 0, 0};
1557  HRESULT hr = invoke(pStringList, "Count", DISPATCH_PROPERTYGET, &dispparams, &varresult, VT_I4);
1558  *pCount = V_I4(&varresult);
1559  VariantClear(&varresult);
1560  return hr;
1561 }
Definition: compat.h:1947
#define DISPATCH_PROPERTYGET
Definition: oleauto.h:1007
HRESULT hr
Definition: shlfolder.c:183
#define V_I4(A)
Definition: oleauto.h:247
smooth NULL
Definition: ftsmooth.c:416
LONG HRESULT
Definition: typedefs.h:77
static HRESULT invoke(IDispatch *pDispatch, LPCSTR szName, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, VARTYPE vtResult)
Definition: automation.c:864
HRESULT WINAPI DECLSPEC_HOTPATCH VariantClear(VARIANTARG *pVarg)
Definition: variant.c:648
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 1536 of file automation.c.

1537 {
1538  VARIANT varresult;
1539  VARIANTARG vararg[1];
1540  DISPPARAMS dispparams = {vararg, NULL, sizeof(vararg)/sizeof(VARIANTARG), 0};
1541  HRESULT hr;
1542 
1543  VariantInit(&vararg[0]);
1544  V_VT(&vararg[0]) = VT_I4;
1545  V_I4(&vararg[0]) = iIndex;
1546 
1547  hr = invoke(pStringList, "Item", DISPATCH_PROPERTYGET, &dispparams, &varresult, VT_BSTR);
1548  if (V_BSTR(&varresult)) lstrcpyW(szString, V_BSTR(&varresult));
1549  VariantClear(&varresult);
1550  return hr;
1551 }
Definition: compat.h:1947
#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
smooth NULL
Definition: ftsmooth.c:416
LONG HRESULT
Definition: typedefs.h:77
static HRESULT invoke(IDispatch *pDispatch, LPCSTR szName, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, VARTYPE vtResult)
Definition: automation.c:864
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:414
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 1590 of file automation.c.

1591 {
1592  VARIANT varresult;
1593  DISPPARAMS dispparams = {NULL, NULL, 0, 0};
1594  HRESULT hr;
1595 
1596  hr = invoke(pSummaryInfo, "PropertyCount", DISPATCH_PROPERTYGET, &dispparams, &varresult, VT_I4);
1597  *pCount = V_I4(&varresult);
1598  VariantClear(&varresult);
1599  return hr;
1600 }
Definition: compat.h:1947
#define DISPATCH_PROPERTYGET
Definition: oleauto.h:1007
HRESULT hr
Definition: shlfolder.c:183
#define V_I4(A)
Definition: oleauto.h:247
smooth NULL
Definition: ftsmooth.c:416
LONG HRESULT
Definition: typedefs.h:77
static HRESULT invoke(IDispatch *pDispatch, LPCSTR szName, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, VARTYPE vtResult)
Definition: automation.c:864
HRESULT WINAPI DECLSPEC_HOTPATCH VariantClear(VARIANTARG *pVarg)
Definition: variant.c:648
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 1563 of file automation.c.

1564 {
1565  VARIANTARG vararg[1];
1566  DISPPARAMS dispparams = {vararg, NULL, sizeof(vararg)/sizeof(VARIANTARG), 0};
1567 
1568  VariantInit(&vararg[0]);
1569  V_VT(&vararg[0]) = VT_I4;
1570  V_I4(&vararg[0]) = pid;
1571  return invoke(pSummaryInfo, "Property", DISPATCH_PROPERTYGET, &dispparams, pVarResult, vtExpect);
1572 }
_In_ ULONG_PTR _In_ ULONG _Out_ ULONG_PTR * pid
Definition: winddi.h:3835
Definition: compat.h:1947
#define DISPATCH_PROPERTYGET
Definition: oleauto.h:1007
void WINAPI VariantInit(VARIANTARG *pVarg)
Definition: variant.c:568
#define V_I4(A)
Definition: oleauto.h:247
smooth NULL
Definition: ftsmooth.c:416
static HRESULT invoke(IDispatch *pDispatch, LPCSTR szName, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, VARTYPE vtResult)
Definition: automation.c:864
#define V_VT(A)
Definition: oleauto.h:211
struct stdole::DISPPARAMS DISPPARAMS

Referenced by test_SummaryInfo().

◆ SummaryInfo_PropertyPut()

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

Definition at line 1574 of file automation.c.

1575 {
1576  VARIANT varresult;
1577  VARIANTARG vararg[2];
1578  DISPID dispid = DISPID_PROPERTYPUT;
1579  DISPPARAMS dispparams = {vararg, &dispid, sizeof(vararg)/sizeof(VARIANTARG), 1};
1580 
1581  VariantInit(&vararg[1]);
1582  V_VT(&vararg[1]) = VT_I4;
1583  V_I4(&vararg[1]) = pid;
1584  VariantInit(&vararg[0]);
1585  VariantCopyInd(vararg, pVariant);
1586 
1587  return invoke(pSummaryInfo, "Property", DISPATCH_PROPERTYPUT, &dispparams, &varresult, VT_EMPTY);
1588 }
_In_ ULONG_PTR _In_ ULONG _Out_ ULONG_PTR * pid
Definition: winddi.h:3835
Definition: compat.h:1947
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:864
#define V_VT(A)
Definition: oleauto.h:211
static VARIANTARG static DISPID
Definition: ordinal.c:49
struct stdole::DISPPARAMS DISPPARAMS

Referenced by test_SummaryInfo().

◆ test_Database()

static void test_Database ( IDispatch pDatabase,
BOOL  readonly 
)
static

Definition at line 1749 of file automation.c.

1750 {
1751  static const WCHAR szSql[] = { 'S','E','L','E','C','T',' ','`','F','e','a','t','u','r','e','`',' ','F','R','O','M',' ','`','F','e','a','t','u','r','e','`',' ','W','H','E','R','E',' ','`','F','e','a','t','u','r','e','_','P','a','r','e','n','t','`','=','\'','O','n','e','\'',0 };
1752  static const WCHAR szThree[] = { 'T','h','r','e','e',0 };
1753  static const WCHAR szTwo[] = { 'T','w','o',0 };
1754  static const WCHAR szStringDataField[] = { 'S','t','r','i','n','g','D','a','t','a',',','F','i','e','l','d',0 };
1755  static const WCHAR szModifyModeRecord[] = { 'M','o','d','i','f','y',',','M','o','d','e',',','R','e','c','o','r','d',0 };
1756  IDispatch *pView = NULL, *pSummaryInfo = NULL;
1757  HRESULT hr;
1758 
1759  hr = Database_OpenView(pDatabase, szSql, &pView);
1760  ok(hr == S_OK, "Database_OpenView failed, hresult 0x%08x\n", hr);
1761  if (hr == S_OK)
1762  {
1763  IDispatch *pRecord = NULL;
1764  WCHAR szString[MAX_PATH];
1765 
1766  /* View::Execute */
1767  hr = View_Execute(pView, NULL);
1768  ok(hr == S_OK, "View_Execute failed, hresult 0x%08x\n", hr);
1769 
1770  /* View::Fetch */
1771  hr = View_Fetch(pView, &pRecord);
1772  ok(hr == S_OK, "View_Fetch failed, hresult 0x%08x\n", hr);
1773  ok(pRecord != NULL, "View_Fetch should not have returned NULL record\n");
1774  if (pRecord)
1775  {
1776  /* Record::StringDataGet */
1777  memset(szString, 0, sizeof(szString));
1778  hr = Record_StringDataGet(pRecord, 1, szString);
1779  ok(hr == S_OK, "Record_StringDataGet failed, hresult 0x%08x\n", hr);
1780  ok_w2("Record_StringDataGet result was %s but expected %s\n", szString, szThree);
1781 
1782  /* Record::StringDataPut with correct index */
1783  hr = Record_StringDataPut(pRecord, 1, szTwo);
1784  ok(hr == S_OK, "Record_StringDataPut failed, hresult 0x%08x\n", hr);
1785 
1786  /* Record::StringDataGet */
1787  memset(szString, 0, sizeof(szString));
1788  hr = Record_StringDataGet(pRecord, 1, szString);
1789  ok(hr == S_OK, "Record_StringDataGet failed, hresult 0x%08x\n", hr);
1790  ok_w2("Record_StringDataGet result was %s but expected %s\n", szString, szTwo);
1791 
1792  /* Record::StringDataPut with incorrect index */
1793  hr = Record_StringDataPut(pRecord, -1, szString);
1794  ok(hr == DISP_E_EXCEPTION, "Record_StringDataPut failed, hresult 0x%08x\n", hr);
1795  ok_exception(hr, szStringDataField);
1796 
1797  /* View::Modify with incorrect parameters */
1798  hr = View_Modify(pView, -5, NULL);
1799  ok(hr == DISP_E_EXCEPTION, "View_Modify failed, hresult 0x%08x\n", hr);
1800  ok_exception(hr, szModifyModeRecord);
1801 
1802  hr = View_Modify(pView, -5, pRecord);
1803  ok(hr == DISP_E_EXCEPTION, "View_Modify failed, hresult 0x%08x\n", hr);
1804  ok_exception(hr, szModifyModeRecord);
1805 
1806  hr = View_Modify(pView, MSIMODIFY_REFRESH, NULL);
1807  ok(hr == DISP_E_EXCEPTION, "View_Modify failed, hresult 0x%08x\n", hr);
1808  ok_exception(hr, szModifyModeRecord);
1809 
1810  hr = View_Modify(pView, MSIMODIFY_REFRESH, pRecord);
1811  ok(hr == S_OK, "View_Modify failed, hresult 0x%08x\n", hr);
1812 
1813  /* Record::StringDataGet, confirm that the record is back to its unmodified value */
1814  memset(szString, 0, sizeof(szString));
1815  hr = Record_StringDataGet(pRecord, 1, szString);
1816  ok(hr == S_OK, "Record_StringDataGet failed, hresult 0x%08x\n", hr);
1817  todo_wine ok_w2("Record_StringDataGet result was %s but expected %s\n", szString, szThree);
1818 
1819  IDispatch_Release(pRecord);
1820  }
1821 
1822  /* View::Fetch */
1823  hr = View_Fetch(pView, &pRecord);
1824  ok(hr == S_OK, "View_Fetch failed, hresult 0x%08x\n", hr);
1825  ok(pRecord != NULL, "View_Fetch should not have returned NULL record\n");
1826  if (pRecord)
1827  {
1828  /* Record::StringDataGet */
1829  memset(szString, 0, sizeof(szString));
1830  hr = Record_StringDataGet(pRecord, 1, szString);
1831  ok(hr == S_OK, "Record_StringDataGet failed, hresult 0x%08x\n", hr);
1832  ok_w2("Record_StringDataGet result was %s but expected %s\n", szString, szTwo);
1833 
1834  IDispatch_Release(pRecord);
1835  }
1836 
1837  /* View::Fetch */
1838  hr = View_Fetch(pView, &pRecord);
1839  ok(hr == S_OK, "View_Fetch failed, hresult 0x%08x\n", hr);
1840  ok(pRecord == NULL, "View_Fetch should have returned NULL record\n");
1841  if (pRecord)
1842  IDispatch_Release(pRecord);
1843 
1844  /* View::Close */
1845  hr = View_Close(pView);
1846  ok(hr == S_OK, "View_Close failed, hresult 0x%08x\n", hr);
1847 
1848  IDispatch_Release(pView);
1849  }
1850 
1851  /* Database::SummaryInformation */
1853  ok(hr == S_OK, "Database_SummaryInformation failed, hresult 0x%08x\n", hr);
1854  ok(pSummaryInfo != NULL, "Database_SummaryInformation should not have returned NULL record\n");
1855  if (pSummaryInfo)
1856  {
1857  test_SummaryInfo(pSummaryInfo, summary_info, sizeof(summary_info)/sizeof(msi_summary_info), readonly);
1858  IDispatch_Release(pSummaryInfo);
1859  }
1860 }
#define DISP_E_EXCEPTION
Definition: winerror.h:2518
static const msi_summary_info summary_info[]
Definition: automation.c:206
HRESULT hr
Definition: shlfolder.c:183
static HRESULT Record_StringDataPut(IDispatch *pRecord, int iField, LPCWSTR szString)
Definition: automation.c:1476
static HRESULT View_Modify(IDispatch *pView, int iMode, IDispatch *pRecord)
Definition: automation.c:1424
static HRESULT View_Close(IDispatch *pView)
Definition: automation.c:1442
static HRESULT View_Execute(IDispatch *pView, IDispatch *pRecord)
Definition: automation.c:1402
static HRESULT Database_SummaryInformation(IDispatch *pDatabase, int iUpdateCount, IDispatch **pSummaryInfo)
Definition: automation.c:1386
#define ok_exception(hr, szDescription)
Definition: automation.c:503
smooth NULL
Definition: ftsmooth.c:416
static HRESULT Record_StringDataGet(IDispatch *pRecord, int iField, LPWSTR szString)
Definition: automation.c:1459
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
static HRESULT Database_OpenView(IDispatch *pDatabase, LPCWSTR szSql, IDispatch **pView)
Definition: automation.c:1370
static HRESULT View_Fetch(IDispatch *pView, IDispatch **ppRecord)
Definition: automation.c:1415
#define MAX_PATH
Definition: compat.h:26
#define todo_wine
Definition: test.h:163
#define ok_w2(format, szString1, szString2)
Definition: automation.c:470
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57
static void test_SummaryInfo(IDispatch *pSummaryInfo, const msi_summary_info *info, int num_info, BOOL readonly)
Definition: automation.c:1606
#define memset(x, y, z)
Definition: compat.h:39
#define TEST_SUMMARYINFO_PROPERTIES_MODIFIED
Definition: automation.c:1604

Referenced by test_Installer(), and test_Session().

◆ test_dispatch()

static void test_dispatch ( void  )
static

Definition at line 638 of file automation.c.

639 {
640  static WCHAR szOpenPackage[] = { 'O','p','e','n','P','a','c','k','a','g','e',0 };
641  static const WCHAR szOpenPackageException[] = {'O','p','e','n','P','a','c','k','a','g','e',',','P','a','c','k','a','g','e','P','a','t','h',',','O','p','t','i','o','n','s',0};
642  static WCHAR szProductState[] = { 'P','r','o','d','u','c','t','S','t','a','t','e',0 };
643  HRESULT hr;
644  DISPID dispid;
645  OLECHAR *name;
646  VARIANT varresult;
647  VARIANTARG vararg[3];
649  DISPPARAMS dispparams = {NULL, NULL, 0, 0};
650 
651  /* Test getting ID of a function name that does not exist */
652  name = (WCHAR *)szMsifile;
653  hr = IDispatch_GetIDsOfNames(pInstaller, &IID_NULL, &name, 1, LOCALE_USER_DEFAULT, &dispid);
654  ok(hr == DISP_E_UNKNOWNNAME, "IDispatch::GetIDsOfNames returned 0x%08x\n", hr);
655 
656  /* Test invoking this function */
657  hr = IDispatch_Invoke(pInstaller, dispid, &IID_NULL, LOCALE_NEUTRAL, DISPATCH_METHOD, NULL, NULL, NULL, NULL);
658  ok(hr == DISP_E_MEMBERNOTFOUND, "IDispatch::Invoke returned 0x%08x\n", hr);
659 
660  /* Test getting ID of a function name that does exist */
661  name = szOpenPackage;
662  hr = IDispatch_GetIDsOfNames(pInstaller, &IID_NULL, &name, 1, LOCALE_USER_DEFAULT, &dispid);
663  ok(hr == S_OK, "IDispatch::GetIDsOfNames returned 0x%08x\n", hr);
664 
665  /* Test invoking this function (without parameters passed) */
666  if (0) /* All of these crash MSI on Windows XP */
667  {
668  IDispatch_Invoke(pInstaller, dispid, &IID_NULL, LOCALE_NEUTRAL, DISPATCH_METHOD, NULL, NULL, NULL, NULL);
669  IDispatch_Invoke(pInstaller, dispid, &IID_NULL, LOCALE_NEUTRAL, DISPATCH_METHOD, NULL, NULL, &excepinfo, NULL);
670  VariantInit(&varresult);
671  IDispatch_Invoke(pInstaller, dispid, &IID_NULL, LOCALE_NEUTRAL, DISPATCH_METHOD, NULL, &varresult, &excepinfo, NULL);
672  }
673 
674  /* Try with NULL params */
675  hr = IDispatch_Invoke(pInstaller, dispid, &IID_NULL, LOCALE_NEUTRAL, DISPATCH_METHOD, &dispparams, &varresult, &excepinfo, NULL);
676  ok(hr == DISP_E_TYPEMISMATCH, "IDispatch::Invoke returned 0x%08x\n", hr);
677 
678  /* Try one empty parameter */
679  dispparams.rgvarg = vararg;
680  dispparams.cArgs = 1;
681  VariantInit(&vararg[0]);
682  hr = IDispatch_Invoke(pInstaller, dispid, &IID_NULL, LOCALE_NEUTRAL, DISPATCH_METHOD, &dispparams, &varresult, &excepinfo, NULL);
683  ok(hr == DISP_E_TYPEMISMATCH, "IDispatch::Invoke returned 0x%08x\n", hr);
684 
685  /* Try two empty parameters */
686  dispparams.cArgs = 2;
687  VariantInit(&vararg[0]);
688  VariantInit(&vararg[1]);
689  hr = IDispatch_Invoke(pInstaller, dispid, &IID_NULL, LOCALE_NEUTRAL, DISPATCH_METHOD, &dispparams, &varresult, &excepinfo, NULL);
690  ok(hr == DISP_E_TYPEMISMATCH, "IDispatch::Invoke returned 0x%08x\n", hr);
691 
692  /* Try one parameter, the required BSTR. Second parameter is optional.
693  * NOTE: The specified package does not exist, which is why the call fails.
694  */
695  dispparams.cArgs = 1;
696  VariantInit(&vararg[0]);
697  V_VT(&vararg[0]) = VT_BSTR;
698  V_BSTR(&vararg[0]) = SysAllocString(szMsifile);
699  hr = IDispatch_Invoke(pInstaller, dispid, &IID_NULL, LOCALE_NEUTRAL, DISPATCH_METHOD, &dispparams, &varresult, &excepinfo, NULL);
700  ok(hr == DISP_E_EXCEPTION, "IDispatch::Invoke returned 0x%08x\n", hr);
701  ok_exception(hr, szOpenPackageException);
702  VariantClear(&vararg[0]);
703 
704  /* Provide the required BSTR and an empty second parameter.
705  * NOTE: The specified package does not exist, which is why the call fails.
706  */
707  dispparams.cArgs = 2;
708  VariantInit(&vararg[1]);
709  V_VT(&vararg[1]) = VT_BSTR;
710  V_BSTR(&vararg[1]) = SysAllocString(szMsifile);
711  VariantInit(&vararg[0]);
712  hr = IDispatch_Invoke(pInstaller, dispid, &IID_NULL, LOCALE_NEUTRAL, DISPATCH_METHOD, &dispparams, &varresult, &excepinfo, NULL);
713  ok(hr == DISP_E_EXCEPTION, "IDispatch::Invoke returned 0x%08x\n", hr);
714  ok_exception(hr, szOpenPackageException);
715  VariantClear(&vararg[1]);
716 
717  /* Provide the required BSTR and two empty parameters.
718  * NOTE: The specified package does not exist, which is why the call fails.
719  */
720  dispparams.cArgs = 3;
721  VariantInit(&vararg[2]);
722  V_VT(&vararg[2]) = VT_BSTR;
723  V_BSTR(&vararg[2]) = SysAllocString(szMsifile);
724  VariantInit(&vararg[1]);
725  VariantInit(&vararg[0]);
726  hr = IDispatch_Invoke(pInstaller, dispid, &IID_NULL, LOCALE_NEUTRAL, DISPATCH_METHOD, &dispparams, &varresult, &excepinfo, NULL);
727  ok(hr == DISP_E_EXCEPTION, "IDispatch::Invoke returned 0x%08x\n", hr);
728  ok_exception(hr, szOpenPackageException);
729  VariantClear(&vararg[2]);
730 
731  /* Provide the required BSTR and a second parameter with the wrong type. */
732  dispparams.cArgs = 2;
733  VariantInit(&vararg[1]);
734  V_VT(&vararg[1]) = VT_BSTR;
735  V_BSTR(&vararg[1]) = SysAllocString(szMsifile);
736  VariantInit(&vararg[0]);
737  V_VT(&vararg[0]) = VT_BSTR;
738  V_BSTR(&vararg[0]) = SysAllocString(szMsifile);
739  hr = IDispatch_Invoke(pInstaller, dispid, &IID_NULL, LOCALE_NEUTRAL, DISPATCH_METHOD, &dispparams, &varresult, &excepinfo, NULL);
740  ok(hr == DISP_E_TYPEMISMATCH, "IDispatch::Invoke returned 0x%08x\n", hr);
741  VariantClear(&vararg[0]);
742  VariantClear(&vararg[1]);
743 
744  /* Create a proper installer package. */
746 
747  /* Try one parameter, the required BSTR. Second parameter is optional.
748  * Proper installer package exists. Path to the package is relative.
749  */
750  dispparams.cArgs = 1;
751  VariantInit(&vararg[0]);
752  V_VT(&vararg[0]) = VT_BSTR;
753  V_BSTR(&vararg[0]) = SysAllocString(szMsifile);
754  hr = IDispatch_Invoke(pInstaller, dispid, &IID_NULL, LOCALE_NEUTRAL, DISPATCH_METHOD, &dispparams, &varresult, &excepinfo, NULL);
755  todo_wine ok(hr == DISP_E_EXCEPTION, "IDispatch::Invoke returned 0x%08x\n", hr);
756  ok_exception(hr, szOpenPackageException);
757  VariantClear(&vararg[0]);
758  if (hr != DISP_E_EXCEPTION)
759  VariantClear(&varresult);
760 
761  /* Try one parameter, the required BSTR. Second parameter is optional.
762  * Proper installer package exists. Path to the package is absolute.
763  */
764  dispparams.cArgs = 1;
765  VariantInit(&vararg[0]);
766  V_VT(&vararg[0]) = VT_BSTR;
767  V_BSTR(&vararg[0]) = SysAllocString(path);
768  hr = IDispatch_Invoke(pInstaller, dispid, &IID_NULL, LOCALE_NEUTRAL, DISPATCH_METHOD, &dispparams, &varresult, &excepinfo, NULL);
769  if (hr == DISP_E_EXCEPTION)
770  {
771  skip("OpenPackage failed, insufficient rights?\n");
772  DeleteFileW(path);
773  return;
774  }
775  ok(hr == S_OK, "IDispatch::Invoke returned 0x%08x\n", hr);
776  VariantClear(&vararg[0]);
777  VariantClear(&varresult);
778 
779  /* Provide the required BSTR and an empty second parameter. Proper
780  * installation package exists.
781  */
782  dispparams.cArgs = 2;
783  VariantInit(&vararg[1]);
784  V_VT(&vararg[1]) = VT_BSTR;
785  V_BSTR(&vararg[1]) = SysAllocString(path);
786  VariantInit(&vararg[0]);
787  hr = IDispatch_Invoke(pInstaller, dispid, &IID_NULL, LOCALE_NEUTRAL, DISPATCH_METHOD, &dispparams, &varresult, &excepinfo, NULL);
788  ok(hr == S_OK, "IDispatch::Invoke returned 0x%08x\n", hr);
789  VariantClear(&vararg[1]);
790  VariantClear(&varresult);
791 
792  /* Provide the required BSTR and two empty parameters. Proper
793  * installation package exists.
794  */
795  dispparams.cArgs = 3;
796  VariantInit(&vararg[2]);
797  V_VT(&vararg[2]) = VT_BSTR;
798  V_BSTR(&vararg[2]) = SysAllocString(path);
799  VariantInit(&vararg[1]);
800  VariantInit(&vararg[0]);
801  hr = IDispatch_Invoke(pInstaller, dispid, &IID_NULL, LOCALE_NEUTRAL, DISPATCH_METHOD, &dispparams, &varresult, &excepinfo, NULL);
802  ok(hr == S_OK, "IDispatch::Invoke returned 0x%08x\n", hr);
803  VariantClear(&vararg[2]);
804  VariantClear(&varresult);
805 
806  /* Provide the required BSTR and a second parameter with the wrong type. */
807  dispparams.cArgs = 2;
808  VariantInit(&vararg[1]);
809  V_VT(&vararg[1]) = VT_BSTR;
810  V_BSTR(&vararg[1]) = SysAllocString(path);
811  VariantInit(&vararg[0]);
812  V_VT(&vararg[0]) = VT_BSTR;
813  V_BSTR(&vararg[0]) = SysAllocString(path);
814  hr = IDispatch_Invoke(pInstaller, dispid, &IID_NULL, LOCALE_NEUTRAL, DISPATCH_METHOD, &dispparams, &varresult, &excepinfo, NULL);
815  ok(hr == DISP_E_TYPEMISMATCH, "IDispatch::Invoke returned 0x%08x\n", hr);
816  VariantClear(&vararg[0]);
817  VariantClear(&vararg[1]);
818 
819  /* Provide the required BSTR and a second parameter that can be coerced to
820  * VT_I4.
821  */
822  dispparams.cArgs = 2;
823  VariantInit(&vararg[1]);
824  V_VT(&vararg[1]) = VT_BSTR;
825  V_BSTR(&vararg[1]) = SysAllocString(path);
826  VariantInit(&vararg[0]);
827  V_VT(&vararg[0]) = VT_I2;
828  V_BSTR(&vararg[0]) = 0;
829  hr = IDispatch_Invoke(pInstaller, dispid, &IID_NULL, LOCALE_NEUTRAL, DISPATCH_METHOD, &dispparams, &varresult, &excepinfo, NULL);
830  ok(hr == S_OK, "IDispatch::Invoke returned 0x%08x\n", hr);
831  VariantClear(&vararg[1]);
832  VariantClear(&varresult);
833 
834  DeleteFileW(path);
835 
836  /* Test invoking a method as a DISPATCH_PROPERTYGET or DISPATCH_PROPERTYPUT */
837  VariantInit(&vararg[0]);
838  hr = IDispatch_Invoke(pInstaller, dispid, &IID_NULL, LOCALE_NEUTRAL, DISPATCH_PROPERTYGET, &dispparams, &varresult, &excepinfo, NULL);
839  ok(hr == DISP_E_MEMBERNOTFOUND, "IDispatch::Invoke returned 0x%08x\n", hr);
840 
841  VariantInit(&vararg[0]);
842  hr = IDispatch_Invoke(pInstaller, dispid, &IID_NULL, LOCALE_NEUTRAL, DISPATCH_PROPERTYPUT, &dispparams, &varresult, &excepinfo, NULL);
843  ok(hr == DISP_E_MEMBERNOTFOUND, "IDispatch::Invoke returned 0x%08x\n", hr);
844 
845  /* Test invoking a read-only property as DISPATCH_PROPERTYPUT or as a DISPATCH_METHOD */
846  name = szProductState;
847  hr = IDispatch_GetIDsOfNames(pInstaller, &IID_NULL, &name, 1, LOCALE_USER_DEFAULT, &dispid);
848  ok(hr == S_OK, "IDispatch::GetIDsOfNames returned 0x%08x\n", hr);
849 
850  dispparams.rgvarg = NULL;
851  dispparams.cArgs = 0;
852  hr = IDispatch_Invoke(pInstaller, dispid, &IID_NULL, LOCALE_NEUTRAL, DISPATCH_PROPERTYPUT, &dispparams, &varresult, &excepinfo, NULL);
853  ok(hr == DISP_E_MEMBERNOTFOUND, "IDispatch::Invoke returned 0x%08x\n", hr);
854 
855  dispparams.rgvarg = NULL;
856  dispparams.cArgs = 0;
857  hr = IDispatch_Invoke(pInstaller, dispid, &IID_NULL, LOCALE_NEUTRAL, DISPATCH_METHOD, &dispparams, &varresult, &excepinfo, NULL);
858  ok(hr == DISP_E_MEMBERNOTFOUND, "IDispatch::Invoke returned 0x%08x\n", hr);
859 }
#define DISP_E_EXCEPTION
Definition: winerror.h:2518
#define DISP_E_UNKNOWNNAME
Definition: winerror.h:2515
WCHAR OLECHAR
Definition: compat.h:1941
#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
static BOOL create_package(LPWSTR path)
Definition: automation.c:356
void WINAPI VariantInit(VARIANTARG *pVarg)
Definition: variant.c:568
#define DISPATCH_METHOD
Definition: oleauto.h:1006
#define ok_exception(hr, szDescription)
Definition: automation.c:503
BOOL WINAPI DeleteFileW(IN LPCWSTR lpFileName)
Definition: delete.c:39
smooth NULL
Definition: ftsmooth.c:416
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:77
#define MAX_PATH
Definition: compat.h:26
static IDispatch * pInstaller
Definition: automation.c:66
HRESULT WINAPI DECLSPEC_HOTPATCH VariantClear(VARIANTARG *pVarg)
Definition: variant.c:648
#define IID_NULL
Definition: guiddef.h:98
#define todo_wine
Definition: test.h:163
#define V_VT(A)
Definition: oleauto.h:211
static const WCHAR szMsifile[]
Definition: automation.c:50
#define V_BSTR(A)
Definition: oleauto.h:226
#define S_OK
Definition: intsafe.h:59
static VARIANTARG static DISPID
Definition: ordinal.c:49
#define ok(value,...)
Definition: atltest.h:57
#define skip(...)
Definition: atltest.h:64
Definition: name.c:38
static EXCEPINFO excepinfo
Definition: automation.c:60
struct stdole::DISPPARAMS DISPPARAMS
#define LOCALE_NEUTRAL
Definition: compat.h:1946
GLuint const GLchar * name
Definition: glext.h:6031

Referenced by START_TEST().

◆ test_dispid()

static void test_dispid ( void  )
static

Definition at line 600 of file automation.c.

601 {
602  const get_did_t *ptr = get_did_data;
603  DISPID dispid;
604 
605  while (ptr->name)
606  {
607  dispid = get_dispid(pInstaller, ptr->name);
608  todo_wine_if (ptr->todo)
609  ok(dispid == ptr->did, "%s: expected %d, got %d\n", ptr->name, ptr->did, dispid);
610  ptr++;
611  }
612 
613  dispid = get_dispid(pInstaller, "RemovePatches");
614  ok(dispid == 49 || dispid == -1, "Expected 49 or -1, got %d\n", dispid);
615  dispid = get_dispid(pInstaller, "ApplyMultiplePatches");
616  ok(dispid == 51 || dispid == -1, "Expected 51 or -1, got %d\n", dispid);
617  dispid = get_dispid(pInstaller, "ProductsEx");
618  ok(dispid == 52 || dispid == -1, "Expected 52 or -1, got %d\n", dispid);
619  dispid = get_dispid(pInstaller, "PatchesEx");
620  ok(dispid == 55 || dispid == -1, "Expected 55 or -1, got %d\n", dispid);
621  dispid = get_dispid(pInstaller, "ExtractPatchXMLData");
622  ok(dispid == 57 || dispid == -1, "Expected 57 or -1, got %d\n", dispid);
623  dispid = get_dispid( pInstaller, "ProductElevated" );
624  ok(dispid == 59 || dispid == -1, "Expected 59 or -1, got %d\n", dispid);
625  dispid = get_dispid( pInstaller, "ProvideAssembly" );
626  ok(dispid == 60 || dispid == -1, "Expected 60 or -1, got %d\n", dispid);
627  dispid = get_dispid( pInstaller, "ProductInfoFromScript" );
628  ok(dispid == 61 || dispid == -1, "Expected 61 or -1, got %d\n", dispid);
629  dispid = get_dispid( pInstaller, "AdvertiseProduct" );
630  ok(dispid == 62 || dispid == -1, "Expected 62 or -1, got %d\n", dispid);
631  dispid = get_dispid( pInstaller, "CreateAdvertiseScript" );
632  ok(dispid == 63 || dispid == -1, "Expected 63 or -1, got %d\n", dispid);
633  dispid = get_dispid( pInstaller, "PatchFiles" );
634  ok(dispid == 65 || dispid == -1, "Expected 65 or -1, got %d\n", dispid);
635 }
GLdouble n
Definition: glext.h:7729
static PVOID ptr
Definition: dispmode.c:27
#define todo_wine_if(is_todo)
Definition: test.h:164
static DISPID get_dispid(IDispatch *disp, const char *name)
Definition: automation.c:522
#define d
Definition: ke_i.h:81
static IDispatch * pInstaller
Definition: automation.c:66
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:549
BOOLEAN Expected
BOOL expected
Definition: store.c:2063

Referenced by START_TEST().

◆ test_Installer()

static void test_Installer ( void  )
static

Definition at line 2617 of file automation.c.

2618 {
2619  static const WCHAR szCreateRecordException[] = { 'C','r','e','a','t','e','R','e','c','o','r','d',',','C','o','u','n','t',0 };
2620  static const WCHAR szIntegerDataException[] = { 'I','n','t','e','g','e','r','D','a','t','a',',','F','i','e','l','d',0 };
2622  HRESULT hr;
2623  IDispatch *pSession = NULL, *pDatabase = NULL, *pRecord = NULL, *pStringList = NULL, *pSumInfo = NULL;
2624  int iValue, iCount;
2625 
2626  if (!pInstaller) return;
2627 
2628  /* Installer::CreateRecord */
2629 
2630  /* Test for error */
2631  hr = Installer_CreateRecord(-1, &pRecord);
2632  ok(hr == DISP_E_EXCEPTION, "Installer_CreateRecord failed, hresult 0x%08x\n", hr);
2633  ok_exception(hr, szCreateRecordException);
2634 
2635  /* Test for success */
2636  hr = Installer_CreateRecord(1, &pRecord);
2637  ok(hr == S_OK, "Installer_CreateRecord failed, hresult 0x%08x\n", hr);
2638  ok(pRecord != NULL, "Installer_CreateRecord should not have returned NULL record\n");
2639  if (pRecord)
2640  {
2641  /* Record::FieldCountGet */
2642  hr = Record_FieldCountGet(pRecord, &iValue);
2643  ok(hr == S_OK, "Record_FiledCountGet failed, hresult 0x%08x\n", hr);
2644  ok(iValue == 1, "Record_FieldCountGet result was %d but expected 1\n", iValue);
2645 
2646  /* Record::IntegerDataGet */
2647  hr = Record_IntegerDataGet(pRecord, 1, &iValue);
2648  ok(hr == S_OK, "Record_IntegerDataGet failed, hresult 0x%08x\n", hr);
2649  ok(iValue == MSI_NULL_INTEGER, "Record_IntegerDataGet result was %d but expected %d\n", iValue, MSI_NULL_INTEGER);
2650 
2651  /* Record::IntegerDataGet, bad index */
2652  hr = Record_IntegerDataGet(pRecord, 10, &iValue);
2653  ok(hr == S_OK, "Record_IntegerDataGet failed, hresult 0x%08x\n", hr);
2654  ok(iValue == MSI_NULL_INTEGER, "Record_IntegerDataGet result was %d but expected %d\n", iValue, MSI_NULL_INTEGER);
2655 
2656  /* Record::IntegerDataPut */
2657  hr = Record_IntegerDataPut(pRecord, 1, 100);
2658  ok(hr == S_OK, "Record_IntegerDataPut failed, hresult 0x%08x\n", hr);
2659 
2660  /* Record::IntegerDataPut, bad index */
2661  hr = Record_IntegerDataPut(pRecord, 10, 100);
2662  ok(hr == DISP_E_EXCEPTION, "Record_IntegerDataPut failed, hresult 0x%08x\n", hr);
2663  ok_exception(hr, szIntegerDataException);
2664 
2665  /* Record::IntegerDataGet */
2666  hr = Record_IntegerDataGet(pRecord, 1, &iValue);
2667  ok(hr == S_OK, "Record_IntegerDataGet failed, hresult 0x%08x\n", hr);
2668  ok(iValue == 100, "Record_IntegerDataGet result was %d but expected 100\n", iValue);
2669 
2670  IDispatch_Release(pRecord);
2671  }
2672 
2674 
2675  /* Installer::OpenPackage */
2676  hr = Installer_OpenPackage(szPath, 0, &pSession);
2677  if (hr == DISP_E_EXCEPTION)
2678  {
2679  skip("OpenPackage failed, insufficient rights?\n");
2681  return;
2682  }
2683  ok(hr == S_OK, "Installer_OpenPackage failed, hresult 0x%08x\n", hr);
2684  if (hr == S_OK)
2685  {
2686  test_Session(pSession);
2687  IDispatch_Release(pSession);
2688  }
2689 
2690  /* Installer::OpenDatabase */
2692  ok(hr == S_OK, "Installer_OpenDatabase failed, hresult 0x%08x\n", hr);
2693  if (hr == S_OK)
2694  {
2695  test_Database(pDatabase, FALSE);
2696  IDispatch_Release(pDatabase);
2697  }
2698 
2699  /* Installer::SummaryInformation */
2700  hr = Installer_SummaryInformation(szPath, 0, &pSumInfo);
2701  ok(hr == S_OK, "Installer_SummaryInformation failed, hresult 0x%08x\n", hr);
2702  if (hr == S_OK)
2703  {
2704  test_SummaryInfo(pSumInfo, summary_info, sizeof(summary_info)/sizeof(msi_summary_info), TRUE);
2705  IDispatch_Release(pSumInfo);
2706  }
2707 
2708  hr = Installer_SummaryInformation(NULL, 0, &pSumInfo);
2709  ok(hr == DISP_E_EXCEPTION, "Installer_SummaryInformation failed, hresult 0x%08x\n", hr);
2710 
2711  /* Installer::RegistryValue */
2713 
2714  /* Installer::ProductState for our product code, which should not be installed */
2716  ok(hr == S_OK, "Installer_ProductState failed, hresult 0x%08x\n", hr);
2717  ok(iValue == INSTALLSTATE_UNKNOWN, "Installer_ProductState returned %d, expected %d\n", iValue, INSTALLSTATE_UNKNOWN);
2718 
2719  /* Installer::ProductInfo for our product code, which should not be installed */
2720 
2721  /* Package name */
2722  memset(szPath, 0, sizeof(szPath));
2724  ok(hr == DISP_E_EXCEPTION, "Installer_ProductInfo failed, hresult 0x%08x\n", hr);
2726 
2727  /* NULL attribute and NULL product code */
2728  memset(szPath, 0, sizeof(szPath));
2730  ok(hr == DISP_E_EXCEPTION, "Installer_ProductInfo failed, hresult 0x%08x\n", hr);