ReactOS 0.4.16-dev-297-gc569aee
patch.c File Reference
#include <stdio.h>
#include <windows.h>
#include <msiquery.h>
#include <msidefs.h>
#include <msi.h>
#include <wtypes.h>
#include "wine/test.h"
#include "utils.h"
Include dependency graph for patch.c:

Go to the source code of this file.

Classes

struct  msi_table
 
struct  table_data
 

Macros

#define _WIN32_MSI   300
 
#define COBJMACROS
 

Functions

static BOOL get_program_files_dir (char *buf, char *buf2)
 
static DWORD get_pf_file_size (const char *filename)
 
static void write_file (const char *filename, const char *data, DWORD data_size)
 
static void set_suminfo (const WCHAR *filename)
 
static void create_database_suminfo (const char *filename, const struct msi_table *tables, UINT num_tables)
 
static void write_tables (IStorage *stg, const struct table_data *tables, UINT num_tables)
 
static void create_patch (const char *filename)
 
static void test_simple_patch (void)
 
static void test_MsiOpenDatabase (void)
 
static UINT find_entry (MSIHANDLE hdb, const char *table, const char *entry)
 
static UINT find_entryW (MSIHANDLE hdb, const WCHAR *table, const WCHAR *entry)
 
static INT get_integer (MSIHANDLE hdb, UINT field, const char *query)
 
static charget_string (MSIHANDLE hdb, UINT field, const char *query)
 
static void test_system_tables (void)
 
static void test_patch_registration (void)
 
 START_TEST (patch)
 

Variables

static const charmsifile = "winetest-patch.msi"
 
static const charmspfile = "winetest-patch.msp"
 
static const WCHAR msifileW [] = L"winetest-patch.msi"
 
static const WCHAR mspfileW [] = L"winetest-patch.msp"
 
static const char property_dat []
 
static const char media_dat []
 
static const char file_dat []
 
static const char directory_dat []
 
static const char component_dat []
 
static const char feature_dat []
 
static const char feature_comp_dat []
 
static const char install_exec_seq_dat []
 
static const char condition_dat []
 
static const struct msi_table tables []
 
static const WCHAR p_name0 [] = { 0x4840, 0x3b3f, 0x43f2, 0x4438, 0x45b1, 0 }
 
static const WCHAR p_name1 [] = { 0x4840, 0x3f7f, 0x4164, 0x422f, 0x4836, 0 }
 
static const WCHAR p_name2 [] = { 0x4840, 0x3f3f, 0x4577, 0x446c, 0x3b6a, 0x45e4, 0x4824, 0 }
 
static const WCHAR p_name3 [] = { 0x4840, 0x3f3f, 0x4577, 0x446c, 0x3e6a, 0x44b2, 0x482f, 0 }
 
static const WCHAR p_name4 [] = { 0x3a8c, 0x47cb, 0x45b0, 0x45ec, 0x45a8, 0x4837, 0}
 
static const WCHAR p_name5 [] = { 0x4840, 0x4596, 0x3e6c, 0x45e4, 0x42e6, 0x421c, 0x4634, 0x4468, 0x4226, 0 }
 
static const WCHAR p_name6 []
 
static const WCHAR p_name7 []
 
static const WCHAR p_name8 []
 
static const WCHAR p_data0 []
 
static const WCHAR p_data1 []
 
static const char p_data2 []
 
static const WCHAR p_data3 []
 
static const char p_data4 []
 
static const WCHAR p_data5 []
 
static const char p_data6 []
 
static const struct table_data table_patch_data []
 
static const WCHAR t1_name0 [] = { 0x4840, 0x430f, 0x422f, 0 }
 
static const WCHAR t1_name1 [] = { 0x4840, 0x3f3f, 0x4577, 0x446c, 0x3b6a, 0x45e4, 0x4824, 0 }
 
static const WCHAR t1_name2 [] = { 0x4840, 0x3f3f, 0x4577, 0x446c, 0x3e6a, 0x44b2, 0x482f, 0 }
 
static const WCHAR t1_name3 []
 
static const WCHAR t1_data0 []
 
static const char t1_data1 []
 
static const WCHAR t1_data2 []
 
static const char t1_data3 []
 
static const struct table_data table_transform1_data []
 
static const WCHAR t2_name0 [] = { 0x4840, 0x430f, 0x422f, 0 }
 
static const WCHAR t2_name1 [] = { 0x4840, 0x4216, 0x4327, 0x4824, 0 }
 
static const WCHAR t2_name2 [] = { 0x4840, 0x3b3f, 0x43f2, 0x4438, 0x45b1, 0 }
 
static const WCHAR t2_name3 [] = { 0x4840, 0x3f7f, 0x4164, 0x422f, 0x4836, 0 }
 
static const WCHAR t2_name4 [] = { 0x4840, 0x4559, 0x44f2, 0x4568, 0x4737, 0 }
 
static const WCHAR t2_name5 [] = { 0x4840, 0x4119, 0x41b7, 0x3e6b, 0x41a4, 0x412e, 0x422a, 0 }
 
static const WCHAR t2_name6 []
 
static const WCHAR t2_name7 [] = { 0x4840, 0x3f3f, 0x4577, 0x446c, 0x3b6a, 0x45e4, 0x4824, 0 }
 
static const WCHAR t2_name8 [] = { 0x4840, 0x3f3f, 0x4577, 0x446c, 0x3e6a, 0x44b2, 0x482f, 0 }
 
static const WCHAR t2_name9 []
 
static const WCHAR t2_name10 []
 
static const WCHAR t2_name11 [] = { 0x4840, 0x448c, 0x44f0, 0x4472, 0x4468, 0x4837, 0 }
 
static const WCHAR t2_name12 [] = { 0x4840, 0x420f, 0x45e4, 0x4578, 0x4828, 0 }
 
static const WCHAR t2_data0 []
 
static const WCHAR t2_data1 []
 
static const WCHAR t2_data2 []
 
static const WCHAR t2_data3 []
 
static const WCHAR t2_data4 []
 
static const WCHAR t2_data5 []
 
static const WCHAR t2_data6 []
 
static const char t2_data7 []
 
static const WCHAR t2_data8 []
 
static const char t2_data9 []
 
static const WCHAR t2_data10 []
 
static const WCHAR t2_data11 []
 
static const WCHAR t2_data12 []
 
static const struct table_data table_transform2_data []
 

Macro Definition Documentation

◆ _WIN32_MSI

#define _WIN32_MSI   300

Definition at line 21 of file patch.c.

◆ COBJMACROS

#define COBJMACROS

Definition at line 22 of file patch.c.

Function Documentation

◆ create_database_suminfo()

static void create_database_suminfo ( const char filename,
const struct msi_table tables,
UINT  num_tables 
)
static

Definition at line 238 of file patch.c.

239{
240 MSIHANDLE hdb;
241 UINT r, i;
243 int len;
244
245 len = MultiByteToWideChar( CP_ACP, 0, filename, -1, NULL, 0 );
246 if (!(filenameW = malloc( len * sizeof(WCHAR) ))) return;
248
250 ok(r == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %u\n", r);
251
252 /* import the tables into the database */
253 for (i = 0; i < num_tables; i++)
254 {
255 const struct msi_table *table = &tables[i];
256
257 write_file( table->filename, table->data, (table->size - 1) * sizeof(char) );
258
259 r = MsiDatabaseImportA( hdb, CURR_DIR, table->filename );
260 ok(r == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %u\n", r);
261
262 DeleteFileA( table->filename );
263 }
264
265 r = MsiDatabaseCommit( hdb );
266 ok(r == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %u\n", r);
267
268 MsiCloseHandle( hdb );
270 free( filenameW );
271}
static char CURR_DIR[MAX_PATH]
#define ok(value,...)
Definition: atltest.h:57
#define free
Definition: debug_ros.c:5
#define malloc
Definition: debug_ros.c:4
#define ERROR_SUCCESS
Definition: deptool.c:10
#define NULL
Definition: types.h:112
#define CP_ACP
Definition: compat.h:109
#define MultiByteToWideChar
Definition: compat.h:110
BOOL WINAPI DeleteFileA(IN LPCSTR lpFileName)
Definition: delete.c:24
UINT WINAPI MsiDatabaseImportA(MSIHANDLE handle, const char *szFolder, const char *szFilename)
Definition: database.c:863
UINT WINAPI MsiOpenDatabaseW(LPCWSTR szDBPath, LPCWSTR szPersist, MSIHANDLE *phDB)
Definition: database.c:298
UINT WINAPI MsiCloseHandle(MSIHANDLE handle)
Definition: handle.c:269
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
GLenum GLsizei len
Definition: glext.h:6722
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
const char * filename
Definition: ioapi.h:137
static const WCHAR filenameW[]
Definition: amstream.c:41
static void set_suminfo(const WCHAR *filename)
Definition: patch.c:196
static void write_file(const char *filename, const char *data, DWORD data_size)
Definition: patch.c:187
static const struct msi_table tables[]
Definition: patch.c:130
UINT WINAPI MsiDatabaseCommit(MSIHANDLE hdb)
Definition: msiquery.c:962
#define MSIDBOPEN_CREATE
Definition: msiquery.h:69
unsigned int UINT
Definition: ndis.h:50
BYTE * data
unsigned long MSIHANDLE
Definition: winemsi.idl:27
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by test_MsiOpenDatabase(), test_patch_registration(), test_simple_patch(), and test_system_tables().

◆ create_patch()

static void create_patch ( const char filename)
static

Definition at line 617 of file patch.c.

618{
619 IStorage *stg = NULL, *stg1 = NULL, *stg2 = NULL;
621 HRESULT r;
622 int len;
624
625 const CLSID CLSID_MsiPatch = {0xc1086, 0, 0, {0xc0, 0, 0, 0, 0, 0, 0, 0x46}};
626 const CLSID CLSID_MsiTransform = {0xc1082, 0, 0, {0xc0, 0, 0, 0, 0, 0, 0, 0x46}};
627
628 len = MultiByteToWideChar( CP_ACP, 0, filename, -1, NULL, 0 );
629 filenameW = malloc( len * sizeof(WCHAR) );
631
632 r = StgCreateDocfile( filenameW, mode, 0, &stg );
633 free( filenameW );
634 ok( r == S_OK, "failed to create storage %#lx\n", r );
635 if (!stg)
636 return;
637
638 r = IStorage_SetClass( stg, &CLSID_MsiPatch );
639 ok( r == S_OK, "failed to set storage type %#lx\n", r );
640
642
643 r = IStorage_CreateStorage( stg, p_name7, mode, 0, 0, &stg1 );
644 ok( r == S_OK, "failed to create substorage %#lx\n", r );
645
646 r = IStorage_SetClass( stg1, &CLSID_MsiTransform );
647 ok( r == S_OK, "failed to set storage type %#lx\n", r );
648
650 IStorage_Release( stg1 );
651
652 r = IStorage_CreateStorage( stg, p_name8, mode, 0, 0, &stg2 );
653 ok( r == S_OK, "failed to create substorage %#lx\n", r );
654
655 r = IStorage_SetClass( stg2, &CLSID_MsiTransform );
656 ok( r == S_OK, "failed to set storage type %#lx\n", r );
657
659 IStorage_Release( stg2 );
660 IStorage_Release( stg );
661}
#define ARRAY_SIZE(A)
Definition: main.h:20
HRESULT WINAPI StgCreateDocfile(LPCOLESTR pwcsName, DWORD grfMode, DWORD reserved, IStorage **ppstgOpen)
Definition: storage32.c:8636
unsigned long DWORD
Definition: ntddk_ex.h:95
GLenum mode
Definition: glext.h:6217
#define S_OK
Definition: intsafe.h:52
static void write_tables(void)
Definition: mkdosfs.c:1629
static const struct table_data table_transform1_data[]
Definition: patch.c:440
static const struct table_data table_transform2_data[]
Definition: patch.c:579
static const struct table_data table_patch_data[]
Definition: patch.c:366
static const WCHAR p_name8[]
Definition: patch.c:288
static const WCHAR p_name7[]
Definition: patch.c:286
#define STGM_CREATE
Definition: objbase.h:926
#define STGM_DIRECT
Definition: objbase.h:914
#define STGM_READWRITE
Definition: objbase.h:919
#define STGM_SHARE_EXCLUSIVE
Definition: objbase.h:923

Referenced by test_MsiOpenDatabase(), test_patch_registration(), test_simple_patch(), and test_system_tables().

◆ find_entry()

static UINT find_entry ( MSIHANDLE  hdb,
const char table,
const char entry 
)
static

Definition at line 888 of file patch.c.

889{
890 static const char fmt[] = "SELECT * FROM `%s` WHERE `Name` = '%s'";
891 char query[0x100];
892 UINT r;
893 MSIHANDLE hview, hrec;
894
896 r = MsiDatabaseOpenViewA( hdb, query, &hview );
897 ok( r == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %u\n", r );
898
899 r = MsiViewExecute( hview, 0 );
900 ok( r == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %u\n", r );
901
902 r = MsiViewFetch( hview, &hrec );
903 MsiViewClose( hview );
904 MsiCloseHandle( hview );
905 MsiCloseHandle( hrec );
906 return r;
907}
uint32_t entry
Definition: isohybrid.c:63
#define sprintf(buf, format,...)
Definition: sprintf.c:55
UINT WINAPI MsiViewClose(MSIHANDLE hView)
Definition: msiquery.c:469
UINT WINAPI MsiViewExecute(MSIHANDLE hView, MSIHANDLE hRec)
Definition: msiquery.c:518
UINT WINAPI MsiDatabaseOpenViewA(MSIHANDLE hdb, const char *szQuery, MSIHANDLE *phView)
Definition: msiquery.c:88
UINT WINAPI MsiViewFetch(MSIHANDLE hView, MSIHANDLE *record)
Definition: msiquery.c:404
Definition: dsound.c:943

Referenced by test_system_tables().

◆ find_entryW()

static UINT find_entryW ( MSIHANDLE  hdb,
const WCHAR table,
const WCHAR entry 
)
static

Definition at line 909 of file patch.c.

910{
911 WCHAR query[0x100];
912 MSIHANDLE hview, hrec;
913 UINT r;
914
915 wsprintfW( query, L"SELECT * FROM `%s` WHERE `Name` = '%s'", table, entry );
916 r = MsiDatabaseOpenViewW( hdb, query, &hview );
917 ok( r == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %u\n", r );
918
919 r = MsiViewExecute( hview, 0 );
920 ok( r == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %u\n", r );
921
922 r = MsiViewFetch( hview, &hrec );
923 MsiViewClose( hview );
924 MsiCloseHandle( hview );
925 MsiCloseHandle( hrec );
926 return r;
927}
UINT WINAPI MsiDatabaseOpenViewW(MSIHANDLE hdb, LPCWSTR szQuery, MSIHANDLE *phView)
Definition: msiquery.c:236
#define L(x)
Definition: ntvdm.h:50
int WINAPIV wsprintfW(_Out_ LPWSTR, _In_ _Printf_format_string_ LPCWSTR,...)

Referenced by test_system_tables().

◆ get_integer()

static INT get_integer ( MSIHANDLE  hdb,
UINT  field,
const char query 
)
static

Definition at line 929 of file patch.c.

930{
931 UINT r;
932 INT ret = -1;
933 MSIHANDLE hview, hrec;
934
935 r = MsiDatabaseOpenViewA( hdb, query, &hview );
936 ok( r == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %u\n", r );
937
938 r = MsiViewExecute( hview, 0 );
939 ok( r == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %u\n", r );
940
941 r = MsiViewFetch( hview, &hrec );
942 ok( r == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %u\n", r );
943 if (r == ERROR_SUCCESS)
944 {
945 UINT r_tmp;
946 ret = MsiRecordGetInteger( hrec, field );
947 MsiCloseHandle( hrec );
948
949 r_tmp = MsiViewFetch( hview, &hrec );
950 ok( r_tmp == ERROR_NO_MORE_ITEMS, "expected ERROR_NO_MORE_ITEMS, got %u\n", r);
951 }
952
953 MsiViewClose( hview );
954 MsiCloseHandle( hview );
955 return ret;
956}
#define ERROR_NO_MORE_ITEMS
Definition: compat.h:105
int WINAPI MsiRecordGetInteger(MSIHANDLE handle, UINT iField)
Definition: record.c:237
Definition: parser.c:44
int32_t INT
Definition: typedefs.h:58
int ret

Referenced by test_system_tables().

◆ get_pf_file_size()

static DWORD get_pf_file_size ( const char filename)
static

Definition at line 168 of file patch.c.

169{
170 char path[MAX_PATH];
171 HANDLE file;
172 DWORD size;
173
175 strcat( path, "\\");
176 strcat( path, filename );
177
180 return INVALID_FILE_SIZE;
181
183 CloseHandle( file );
184 return size;
185}
char * strcat(char *DstString, const char *SrcString)
Definition: utclib.c:568
char * strcpy(char *DstString, const char *SrcString)
Definition: utclib.c:388
#define CloseHandle
Definition: compat.h:739
#define OPEN_EXISTING
Definition: compat.h:775
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
#define CreateFileA(a, b, c, d, e, f, g)
Definition: compat.h:740
#define GENERIC_READ
Definition: compat.h:135
#define MAX_PATH
Definition: compat.h:34
#define FILE_SHARE_READ
Definition: compat.h:136
DWORD WINAPI GetFileSize(HANDLE hFile, LPDWORD lpFileSizeHigh)
Definition: fileinfo.c:331
GLsizeiptr size
Definition: glext.h:5919
char PROG_FILES_DIR[MAX_PATH]
Definition: install.c:50
Definition: fci.c:127
#define INVALID_FILE_SIZE
Definition: winbase.h:574

Referenced by test_simple_patch().

◆ get_program_files_dir()

static BOOL get_program_files_dir ( char buf,
char buf2 
)
static

Definition at line 143 of file patch.c.

144{
145 HKEY hkey;
146 DWORD type, size;
147
148 if (RegOpenKeyA( HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Windows\\CurrentVersion", &hkey ))
149 return FALSE;
150
151 size = MAX_PATH;
152 if (RegQueryValueExA( hkey, "ProgramFilesDir (x86)", 0, &type, (LPBYTE)buf, &size ) &&
153 RegQueryValueExA( hkey, "ProgramFilesDir", 0, &type, (LPBYTE)buf, &size ))
154 {
155 RegCloseKey( hkey );
156 return FALSE;
157 }
158 size = MAX_PATH;
159 if (RegQueryValueExA( hkey, "CommonFilesDir", 0, &type, (LPBYTE)buf2, &size ))
160 {
161 RegCloseKey( hkey );
162 return FALSE;
163 }
164 RegCloseKey( hkey );
165 return TRUE;
166}
#define RegCloseKey(hKey)
Definition: registry.h:49
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
LONG WINAPI RegOpenKeyA(HKEY hKey, LPCSTR lpSubKey, PHKEY phkResult)
Definition: reg.c:3234
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:4009
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
unsigned char * LPBYTE
Definition: typedefs.h:53
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12

Referenced by START_TEST().

◆ get_string()

static char * get_string ( MSIHANDLE  hdb,
UINT  field,
const char query 
)
static

Definition at line 958 of file patch.c.

959{
960 UINT r;
961 static char ret[MAX_PATH];
962 MSIHANDLE hview, hrec;
963
964 ret[0] = '\0';
965
966 r = MsiDatabaseOpenViewA( hdb, query, &hview );
967 ok( r == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %u\n", r );
968
969 r = MsiViewExecute( hview, 0 );
970 ok( r == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %u\n", r );
971
972 r = MsiViewFetch( hview, &hrec );
973 ok( r == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %u\n", r );
974 if (r == ERROR_SUCCESS)
975 {
977 r = MsiRecordGetStringA( hrec, field, ret, &size );
978 ok( r == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %u\n", r);
979 MsiCloseHandle( hrec );
980
981 r = MsiViewFetch( hview, &hrec );
982 ok( r == ERROR_NO_MORE_ITEMS, "expected ERROR_NO_MORE_ITEMS, got %u\n", r);
983 }
984
985 MsiViewClose( hview );
986 MsiCloseHandle( hview );
987 return ret;
988}
UINT WINAPI MsiRecordGetStringA(MSIHANDLE handle, UINT iField, char *szValue, DWORD *pcchValue)
Definition: record.c:403

Referenced by test_system_tables().

◆ set_suminfo()

static void set_suminfo ( const WCHAR filename)
static

Definition at line 196 of file patch.c.

197{
198 UINT r;
199 MSIHANDLE hsi, hdb;
200
202 ok( r == ERROR_SUCCESS, "failed to open database %u\n", r );
203
204 r = MsiGetSummaryInformationA( hdb, NULL, 7, &hsi );
205 ok( r == ERROR_SUCCESS, "failed to open summaryinfo %u\n", r );
206
207 r = MsiSummaryInfoSetPropertyA( hsi, 2, VT_LPSTR, 0, NULL, "Installation Database" );
208 ok( r == ERROR_SUCCESS, "failed to set summary info %u\n", r );
209
210 r = MsiSummaryInfoSetPropertyA( hsi, 3, VT_LPSTR, 0, NULL, "Installation Database" );
211 ok( r == ERROR_SUCCESS, "failed to set summary info %u\n", r );
212
213 r = MsiSummaryInfoSetPropertyA( hsi, 4, VT_LPSTR, 0, NULL, "WineHQ" );
214 ok( r == ERROR_SUCCESS, "failed to set summary info %u\n", r );
215
216 r = MsiSummaryInfoSetPropertyA( hsi, 7, VT_LPSTR, 0, NULL, ";1033" );
217 ok( r == ERROR_SUCCESS, "failed to set summary info %u\n", r );
218
219 r = MsiSummaryInfoSetPropertyA( hsi, 9, VT_LPSTR, 0, NULL, "{E528DDD6-4801-4BEC-BBB6-C5EE0FD097E9}" );
220 ok( r == ERROR_SUCCESS, "failed to set summary info %u\n", r );
221
222 r = MsiSummaryInfoSetPropertyA( hsi, 14, VT_I4, 100, NULL, NULL );
223 ok( r == ERROR_SUCCESS, "failed to set summary info %u\n", r );
224
225 r = MsiSummaryInfoSetPropertyA( hsi, 15, VT_I4, 0, NULL, NULL );
226 ok( r == ERROR_SUCCESS, "failed to set summary info %u\n", r );
227
228 r = MsiSummaryInfoPersist( hsi );
229 ok( r == ERROR_SUCCESS, "failed to persist suminfo %u\n", r );
230
231 r = MsiCloseHandle( hsi );
232 ok( r == ERROR_SUCCESS, "failed to close suminfo %u\n", r );
233
234 r = MsiCloseHandle( hdb );
235 ok( r == ERROR_SUCCESS, "failed to close database %u\n", r );
236}
@ VT_LPSTR
Definition: compat.h:2324
@ VT_I4
Definition: compat.h:2298
UINT WINAPI MsiSummaryInfoSetPropertyA(MSIHANDLE handle, UINT uiProperty, UINT uiDataType, INT iValue, FILETIME *pftValue, const char *szValue)
Definition: suminfo.c:942
UINT WINAPI MsiGetSummaryInformationA(MSIHANDLE hDatabase, const char *szDatabase, UINT uiUpdateCount, MSIHANDLE *pHandle)
Definition: suminfo.c:589
UINT WINAPI MsiSummaryInfoPersist(MSIHANDLE handle)
Definition: suminfo.c:1227
#define MSIDBOPEN_DIRECT
Definition: msiquery.h:68

Referenced by create_database_suminfo().

◆ START_TEST()

START_TEST ( patch  )

Definition at line 1259 of file patch.c.

1260{
1261 DWORD len;
1262 char temp_path[MAX_PATH], prev_path[MAX_PATH];
1263
1265
1266 GetCurrentDirectoryA( MAX_PATH, prev_path );
1269
1271 len = strlen( CURR_DIR );
1272
1273 if (len && (CURR_DIR[len - 1] == '\\'))
1274 CURR_DIR[len - 1] = 0;
1275
1277
1282
1283 SetCurrentDirectoryA( prev_path );
1284}
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
DWORD WINAPI GetCurrentDirectoryA(IN DWORD nBufferLength, OUT LPSTR lpBuffer)
Definition: path.c:2146
BOOL WINAPI SetCurrentDirectoryA(IN LPCSTR lpPathName)
Definition: path.c:2206
DWORD WINAPI GetTempPathA(IN DWORD nBufferLength, OUT LPSTR lpBuffer)
Definition: path.c:2054
static BOOL is_process_elevated(void)
Definition: dplayx.c:6742
void restart_as_admin_elevated(void)
Definition: action.c:6478
char COMMON_FILES_DIR[MAX_PATH]
Definition: install.c:52
static void test_system_tables(void)
Definition: patch.c:990
static BOOL get_program_files_dir(char *buf, char *buf2)
Definition: patch.c:143
static void test_simple_patch(void)
Definition: patch.c:663
static void test_MsiOpenDatabase(void)
Definition: patch.c:846
static void test_patch_registration(void)
Definition: patch.c:1169
char temp_path[MAX_PATH]
Definition: mspatcha.c:123

◆ test_MsiOpenDatabase()

static void test_MsiOpenDatabase ( void  )
static

Definition at line 846 of file patch.c.

847{
848 UINT r;
849 MSIHANDLE hdb;
850
852 ok(r == ERROR_SUCCESS, "failed to open database %u\n", r);
853
854 r = MsiDatabaseCommit( hdb );
855 ok(r == ERROR_SUCCESS, "failed to commit database %u\n", r);
856 MsiCloseHandle( hdb );
857
859 ok(r == ERROR_OPEN_FAILED, "expected ERROR_OPEN_FAILED, got %u\n", r);
861
863 ok(r == ERROR_SUCCESS , "failed to open database %u\n", r);
864
865 r = MsiDatabaseCommit( hdb );
866 ok(r == ERROR_SUCCESS, "failed to commit database %u\n", r);
867 MsiCloseHandle( hdb );
868
870 ok(r == ERROR_SUCCESS, "failed to open database %u\n", r);
871 MsiCloseHandle( hdb );
873
876
878 ok(r == ERROR_OPEN_FAILED, "failed to open database %u\n", r );
879
881 ok(r == ERROR_SUCCESS, "failed to open database %u\n", r );
882 MsiCloseHandle( hdb );
883
886}
static const WCHAR msifileW[]
Definition: patch.c:37
static void create_patch(const char *filename)
Definition: patch.c:617
static const char * mspfile
Definition: patch.c:36
static const WCHAR mspfileW[]
Definition: patch.c:38
static void create_database_suminfo(const char *filename, const struct msi_table *tables, UINT num_tables)
Definition: patch.c:238
static const char * msifile
Definition: patch.c:35
#define MSIDBOPEN_PATCHFILE
Definition: msiquery.h:79
#define MSIDBOPEN_READONLY
Definition: msiquery.h:66
#define ERROR_OPEN_FAILED
Definition: winerror.h:184

Referenced by START_TEST().

◆ test_patch_registration()

static void test_patch_registration ( void  )
static

Definition at line 1169 of file patch.c.

1170{
1171 UINT r;
1172 DWORD size;
1173 char buffer[MAX_PATH], patch_code[39];
1174
1175 if (!is_process_elevated())
1176 {
1177 skip("process is limited\n");
1178 return;
1179 }
1180
1181 CreateDirectoryA( "msitest", NULL );
1182 create_file( "msitest\\patch.txt", 1000 );
1183
1186
1188
1189 r = MsiInstallProductA( msifile, "DISABLE_FEATURE=1" );
1190 if (r != ERROR_SUCCESS)
1191 {
1192 skip("Product installation failed with error code %d\n", r);
1193 goto cleanup;
1194 }
1195
1197 ok( r == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %u\n", r );
1198
1199 buffer[0] = 0;
1200 size = sizeof(buffer);
1201 r = MsiGetPatchInfoExA( "{0F96CDC0-4CDF-4304-B283-7B9264889EF7}",
1202 "{913B8D18-FBB6-4CAC-A239-C74C11E3FA74}",
1205 ok( r == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %u\n", r );
1206 ok( buffer[0], "buffer empty\n" );
1207
1208 buffer[0] = 0;
1209 size = sizeof(buffer);
1210 r = MsiGetPatchInfoExA( "{0F96CDC0-4CDF-4304-B283-7B9264889EF7}",
1211 "{913B8D18-FBB6-4CAC-A239-C74C11E3FA74}",
1214 ok( r == ERROR_UNKNOWN_PRODUCT, "expected ERROR_UNKNOWN_PRODUCT, got %u\n", r );
1215
1216 buffer[0] = 0;
1217 size = sizeof(buffer);
1218 r = MsiGetPatchInfoExA( "{0F96CDC0-4CDF-4304-B283-7B9264889EF7}",
1219 "{913B8D18-FBB6-4CAC-A239-C74C11E3FA74}",
1222 ok( r == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %u\n", r );
1223 ok( !buffer[0], "got %s\n", buffer );
1224
1225 r = MsiEnumPatchesExA( "{913B8D18-FBB6-4CAC-A239-C74C11E3FA74}",
1227 0, patch_code, NULL, NULL, NULL, NULL );
1228 ok( r == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %u\n", r );
1229 ok( !strcmp( patch_code, "{0F96CDC0-4CDF-4304-B283-7B9264889EF7}" ), "wrong patch code\n" );
1230
1231 r = MsiEnumPatchesExA( "{913B8D18-FBB6-4CAC-A239-C74C11E3FA74}",
1233 0, patch_code, NULL, NULL, NULL, NULL );
1234 ok( r == ERROR_NO_MORE_ITEMS, "expected ERROR_NO_MORE_ITEMS, got %u\n", r );
1235
1236 r = MsiEnumPatchesExA( "{913B8D18-FBB6-4CAC-A239-C74C11E3FA74}",
1238 0, patch_code, NULL, NULL, NULL, NULL );
1239 ok( r == ERROR_NO_MORE_ITEMS, "expected ERROR_NO_MORE_ITEMS, got %u\n", r );
1240
1241 r = MsiInstallProductA( msifile, "REMOVE=ALL" );
1242 ok( r == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %u\n", r );
1243
1244 buffer[0] = 0;
1245 size = sizeof(buffer);
1246 r = MsiGetPatchInfoExA( "{0F96CDC0-4CDF-4304-B283-7B9264889EF7}",
1247 "{913B8D18-FBB6-4CAC-A239-C74C11E3FA74}",
1250 ok( r == ERROR_UNKNOWN_PRODUCT, "expected ERROR_UNKNOWN_PRODUCT, got %u\n", r );
1251
1252cleanup:
1255 DeleteFileA( "msitest\\patch.txt" );
1256 RemoveDirectoryA( "msitest" );
1257}
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
#define skip(...)
Definition: atltest.h:64
static void cleanup(void)
Definition: main.c:1335
BOOL WINAPI RemoveDirectoryA(IN LPCSTR lpPathName)
Definition: dir.c:714
BOOL WINAPI CreateDirectoryA(IN LPCSTR lpPathName, IN LPSECURITY_ATTRIBUTES lpSecurityAttributes)
Definition: dir.c:37
UINT WINAPI MsiGetPatchInfoExA(LPCSTR szPatchCode, LPCSTR szProductCode, LPCSTR szUserSid, MSIINSTALLCONTEXT dwContext, LPCSTR szProperty, LPSTR lpValue, DWORD *pcchValue)
Definition: msi.c:1590
UINT WINAPI MsiInstallProductA(LPCSTR szPackagePath, LPCSTR szCommandLine)
Definition: msi.c:198
INSTALLUILEVEL WINAPI MsiSetInternalUI(INSTALLUILEVEL dwUILevel, HWND *phWnd)
Definition: msi.c:2281
UINT WINAPI MsiApplyPatchA(LPCSTR szPatchPackage, LPCSTR szInstallPackage, INSTALLTYPE eInstallType, LPCSTR szCommandLine)
Definition: msi.c:286
UINT WINAPI MsiEnumPatchesExA(const char *szProductCode, const char *szUserSid, DWORD dwContext, DWORD dwFilter, DWORD dwIndex, char *szPatchCode, char *szTargetProductCode, MSIINSTALLCONTEXT *pdwTargetProductContext, char *szTargetUserSid, DWORD *pcchTargetUserSid)
Definition: registry.c:1618
GLuint buffer
Definition: glext.h:5915
#define create_file(name, size)
Definition: asmcache.c:813
@ MSIPATCHSTATE_APPLIED
Definition: msi.h:54
#define INSTALLPROPERTY_LOCALPACKAGEA
Definition: msi.h:342
@ INSTALLTYPE_DEFAULT
Definition: msi.h:189
@ MSIINSTALLCONTEXT_MACHINE
Definition: msi.h:200
@ MSIINSTALLCONTEXT_USERUNMANAGED
Definition: msi.h:199
@ MSIINSTALLCONTEXT_USERMANAGED
Definition: msi.h:198
@ INSTALLUILEVEL_NONE
Definition: msi.h:66
#define ERROR_UNKNOWN_PRODUCT
Definition: winerror.h:963

Referenced by START_TEST().

◆ test_simple_patch()

static void test_simple_patch ( void  )
static

Definition at line 663 of file patch.c.

664{
665 UINT r;
666 DWORD size;
667 char path[MAX_PATH], install_source[MAX_PATH], buffer[32];
668 const char *query;
669 WCHAR pathW[MAX_PATH];
670 MSIHANDLE hpackage, hdb, hview, hrec;
671
672 if (!is_process_elevated())
673 {
674 skip("process is limited\n");
675 return;
676 }
677
678 CreateDirectoryA( "msitest", NULL );
679 create_file( "msitest\\patch.txt", 1000 );
680
683
685
686 r = MsiInstallProductA( msifile, "DISABLE_FEATURE=1" );
687 if (r != ERROR_SUCCESS)
688 {
689 skip("Product installation failed with error code %u\n", r);
690 goto cleanup;
691 }
692
693 size = get_pf_file_size( "msitest\\patch.txt" );
694 ok( size == 1000, "expected 1000, got %lu\n", size );
695
696 size = sizeof(install_source);
697 r = MsiGetProductInfoA( "{913B8D18-FBB6-4CAC-A239-C74C11E3FA74}",
698 "InstallSource", install_source, &size );
699 ok( r == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %u\n", r );
700
701 strcpy( path, CURR_DIR );
702 strcat( path, "\\" );
703 strcat( path, msifile );
704
705 r = MsiOpenPackageA( path, &hpackage );
706 ok( r == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %u\n", r );
707
708 hdb = MsiGetActiveDatabase( hpackage );
709 ok( hdb, "failed to get database handle\n" );
710
711 query = "SELECT * FROM `Property` where `Property` = 'PATCHNEWPACKAGECODE'";
712 r = MsiDatabaseOpenViewA( hdb, query, &hview );
713 ok( r == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %u\n", r );
714
715 r = MsiViewExecute( hview, 0 );
716 ok( r == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %u\n", r );
717
718 r = MsiViewFetch( hview, &hrec );
719 ok( r == ERROR_NO_MORE_ITEMS, "expected ERROR_NO_MORE_ITEMS, got %u\n", r );
720
721 MsiCloseHandle( hrec );
722 MsiViewClose( hview );
723 MsiCloseHandle( hview );
724
725 query = "SELECT * FROM `Property` WHERE `Property` = 'PATCHNEWSUMMARYSUBJECT' "
726 "AND `Value` = 'Installer Database'";
727 r = MsiDatabaseOpenViewA( hdb, query, &hview );
728 ok( r == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %u\n", r );
729
730 r = MsiViewExecute( hview, 0 );
731 ok( r == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %u\n", r );
732
733 r = MsiViewFetch( hview, &hrec );
734 ok( r == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %u\n", r );
735
736 MsiCloseHandle( hrec );
737 MsiViewClose( hview );
738 MsiCloseHandle( hview );
739
740 buffer[0] = 0;
741 size = sizeof(buffer);
742 r = MsiGetPropertyA( hpackage, "PATCHNEWSUMMARYSUBJECT", buffer, &size );
743 ok( r == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %u\n", r );
744 ok( !strcmp( buffer, "Installer Database" ), "expected \'Installer Database\', got \'%s\'\n", buffer );
745
746 MsiCloseHandle( hdb );
747 MsiCloseHandle( hpackage );
748
750 ok( r == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %u\n", r );
751
752 size = get_pf_file_size( "msitest\\patch.txt" );
753 ok( size == 1002, "expected 1002, got %lu\n", size );
754 size = get_pf_file_size( "msitest\\file.txt" );
755 ok( size == 1000, "expected 1000, got %lu\n", size );
756
757 /* show that MsiOpenPackage applies registered patches */
758 r = MsiOpenPackageA( path, &hpackage );
759 ok( r == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %u\n", r );
760
761 hdb = MsiGetActiveDatabase( hpackage );
762 ok( hdb, "failed to get database handle\n" );
763
764 query = "SELECT * FROM `Property` where `Property` = 'PATCHNEWPACKAGECODE'";
765 r = MsiDatabaseOpenViewA( hdb, query, &hview );
766 ok( r == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %u\n", r );
767
768 r = MsiViewExecute( hview, 0 );
769 ok( r == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %u\n", r );
770
771 r = MsiViewFetch( hview, &hrec );
772 ok( r == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %u\n", r );
773
774 MsiCloseHandle( hrec );
775 MsiViewClose( hview );
776 MsiCloseHandle( hview );
777
778 query = "SELECT * FROM `Property` WHERE `Property` = 'PATCHNEWSUMMARYSUBJECT' "
779 "AND `Value` = 'Installation Database'";
780 r = MsiDatabaseOpenViewA( hdb, query, &hview );
781 ok( r == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %u\n", r );
782
783 r = MsiViewExecute( hview, 0 );
784 ok( r == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %u\n", r );
785
786 r = MsiViewFetch( hview, &hrec );
787 ok( r == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %u\n", r );
788
789 MsiCloseHandle( hrec );
790 MsiViewClose( hview );
791 MsiCloseHandle( hview );
792
793 buffer[0] = 0;
794 size = sizeof(buffer);
795 r = MsiGetPropertyA( hpackage, "PATCHNEWSUMMARYSUBJECT", buffer, &size );
796 ok( r == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %u\n", r );
797 ok( !strcmp( buffer, "Installation Database" ), "expected \'Installation Database\', got \'%s\'\n", buffer );
798
799 MsiCloseHandle( hdb );
800 MsiCloseHandle( hpackage );
801
802 /* show that patches are not committed to the local package database */
803 size = sizeof(path);
804 r = MsiGetProductInfoA( "{913B8D18-FBB6-4CAC-A239-C74C11E3FA74}",
805 "LocalPackage", path, &size );
806 ok( r == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %u\n", r );
807
808 MultiByteToWideChar( CP_ACP, 0, path, -1, pathW, MAX_PATH );
809 r = MsiOpenDatabaseW( pathW, MSIDBOPEN_READONLY, &hdb );
810 ok( r == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %u\n", r );
811
812 r = MsiDatabaseOpenViewA( hdb, query, &hview );
813 ok( r == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %u\n", r );
814
815 r = MsiViewExecute( hview, 0 );
816 ok( r == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %u\n", r );
817
818 r = MsiViewFetch( hview, &hrec );
819 ok( r == ERROR_NO_MORE_ITEMS, "expected ERROR_NO_MORE_ITEMS, got %u\n", r );
820
821 MsiCloseHandle( hrec );
822 MsiViewClose( hview );
823 MsiCloseHandle( hview );
824 MsiCloseHandle( hdb );
825
826 size = sizeof(path);
827 r = MsiGetProductInfoA( "{913B8D18-FBB6-4CAC-A239-C74C11E3FA74}",
828 "InstallSource", path, &size );
829 ok( r == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %u\n", r );
830 ok( !strcasecmp( path, install_source ), "wrong path %s\n", path );
831
832 r = MsiInstallProductA( msifile, "REMOVE=ALL" );
833 ok( r == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %u\n", r );
834
835 ok( !delete_pf( "msitest\\patch.txt", TRUE ), "file not removed\n" );
836 ok( !delete_pf( "msitest\\file.txt", TRUE ), "file not removed\n" );
837 ok( !delete_pf( "msitest", FALSE ), "directory not removed\n" );
838
839cleanup:
842 DeleteFileA( "msitest\\patch.txt" );
843 RemoveDirectoryA( "msitest" );
844}
UINT WINAPI MsiGetProductInfoA(LPCSTR szProduct, LPCSTR szAttribute, LPSTR szBuffer, LPDWORD pcchValueBuf)
Definition: msi.c:1254
UINT WINAPI MsiOpenPackageA(LPCSTR szPackage, MSIHANDLE *phPackage)
Definition: package.c:1664
MSIHANDLE WINAPI MsiGetActiveDatabase(MSIHANDLE hInstall)
Definition: package.c:1669
UINT WINAPI MsiGetPropertyA(MSIHANDLE hinst, const char *name, char *buf, DWORD *sz)
Definition: package.c:2313
#define strcasecmp
Definition: fake.h:9
BOOL delete_pf(const CHAR *rel_path, BOOL is_file)
Definition: install.c:2433
static DWORD get_pf_file_size(const char *filename)
Definition: patch.c:168

Referenced by START_TEST().

◆ test_system_tables()

static void test_system_tables ( void  )
static

Definition at line 990 of file patch.c.

991{
992 static const char patchsource[] = "MSPSRC0F96CDC04CDF4304B2837B9264889EF7";
993 UINT r;
994 char *cr;
995 const char *query;
996 MSIHANDLE hproduct, hdb, hview, hrec;
997
998 if (!is_process_elevated())
999 {
1000 skip("process is limited\n");
1001 return;
1002 }
1003
1004 CreateDirectoryA( "msitest", NULL );
1005 create_file( "msitest\\patch.txt", 1000 );
1006
1009
1011
1012 r = MsiInstallProductA( msifile, "DISABLE_FEATURE=1" );
1013 if (r != ERROR_SUCCESS)
1014 {
1015 skip("Product installation failed with error code %d\n", r);
1016 goto cleanup;
1017 }
1018
1019 r = MsiOpenProductA( "{913B8D18-FBB6-4CAC-A239-C74C11E3FA74}", &hproduct );
1020 ok( r == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %u\n", r );
1021
1022 hdb = MsiGetActiveDatabase( hproduct );
1023 ok( hdb, "failed to get database handle\n" );
1024
1025 r = find_entry( hdb, "_Streams", "\5SummaryInformation" );
1026 ok( r == ERROR_SUCCESS, "failed to find entry %u\n", r );
1027
1028 query = "SELECT * FROM `_Storages`";
1029 r = MsiDatabaseOpenViewA( hdb, query, &hview );
1030 ok( r == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %u\n", r );
1031
1032 r = MsiViewExecute( hview, 0 );
1033 ok( r == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %u\n", r );
1034
1035 r = MsiViewFetch( hview, &hrec );
1036 ok( r == ERROR_NO_MORE_ITEMS, "expected ERROR_NO_MORE_ITEMS, got %u\n", r );
1037
1038 r = find_entry( hdb, "_Tables", "Directory" );
1039 ok( r == ERROR_SUCCESS, "failed to find entry %u\n", r );
1040
1041 r = find_entry( hdb, "_Tables", "File" );
1042 ok( r == ERROR_SUCCESS, "failed to find entry %u\n", r );
1043
1044 r = find_entry( hdb, "_Tables", "Component" );
1045 ok( r == ERROR_SUCCESS, "failed to find entry %u\n", r );
1046
1047 r = find_entry( hdb, "_Tables", "Feature" );
1048 ok( r == ERROR_SUCCESS, "failed to find entry %u\n", r );
1049
1050 r = find_entry( hdb, "_Tables", "FeatureComponents" );
1051 ok( r == ERROR_SUCCESS, "failed to find entry %u\n", r );
1052
1053 r = find_entry( hdb, "_Tables", "Property" );
1054 ok( r == ERROR_SUCCESS, "failed to find entry %u\n", r );
1055
1056 r = find_entry( hdb, "_Tables", "InstallExecuteSequence" );
1057 ok( r == ERROR_SUCCESS, "failed to find entry %u\n", r );
1058
1059 r = find_entry( hdb, "_Tables", "Media" );
1060 ok( r == ERROR_SUCCESS, "failed to find entry %u\n", r );
1061
1062 r = get_integer( hdb, 1, "SELECT * FROM `Media` WHERE `VolumeLabel`=\'DISK1\'");
1063 ok( r == 1, "Got %u\n", r );
1064
1065 r = find_entry( hdb, "_Tables", "_Property" );
1066 ok( r == ERROR_SUCCESS, "failed to find entry %u\n", r );
1067
1068 MsiCloseHandle( hrec );
1069 MsiViewClose( hview );
1070 MsiCloseHandle( hview );
1071 MsiCloseHandle( hdb );
1072 MsiCloseHandle( hproduct );
1073
1075 ok( r == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %u\n", r );
1076
1077 r = MsiOpenProductA( "{913B8D18-FBB6-4CAC-A239-C74C11E3FA74}", &hproduct );
1078 ok( r == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %u\n", r );
1079
1080 hdb = MsiGetActiveDatabase( hproduct );
1081 ok( hdb, "failed to get database handle\n" );
1082
1083 r = find_entry( hdb, "_Streams", "\5SummaryInformation" );
1084 ok( r == ERROR_SUCCESS, "failed to find entry %u\n", r );
1085
1086 r = find_entryW( hdb, L"_Streams", L"\x3a8c\x47cb\x45b0\x45ec\x45a8\x4837" );
1087 ok( r == ERROR_NO_MORE_ITEMS, "failed to find entry %u\n", r );
1088
1089 query = "SELECT * FROM `_Storages`";
1090 r = MsiDatabaseOpenViewA( hdb, query, &hview );
1091 ok( r == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %u\n", r );
1092
1093 r = MsiViewExecute( hview, 0 );
1094 ok( r == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %u\n", r );
1095
1096 r = MsiViewFetch( hview, &hrec );
1097 ok( r == ERROR_NO_MORE_ITEMS, "expected ERROR_NO_MORE_ITEMS, got %u\n", r );
1098
1099 r = find_entry( hdb, "_Tables", "Directory" );
1100 ok( r == ERROR_SUCCESS, "failed to find entry %u\n", r );
1101
1102 r = find_entry( hdb, "_Tables", "File" );
1103 ok( r == ERROR_SUCCESS, "failed to find entry %u\n", r );
1104
1105 r = find_entry( hdb, "_Tables", "Component" );
1106 ok( r == ERROR_SUCCESS, "failed to find entry %u\n", r );
1107
1108 r = find_entry( hdb, "_Tables", "Feature" );
1109 ok( r == ERROR_SUCCESS, "failed to find entry %u\n", r );
1110
1111 r = find_entry( hdb, "_Tables", "FeatureComponents" );
1112 ok( r == ERROR_SUCCESS, "failed to find entry %u\n", r );
1113
1114 r = find_entry( hdb, "_Tables", "Property" );
1115 ok( r == ERROR_SUCCESS, "failed to find entry %u\n", r );
1116
1117 r = find_entry( hdb, "_Tables", "InstallExecuteSequence" );
1118 ok( r == ERROR_SUCCESS, "failed to find entry %u\n", r );
1119
1120 r = find_entry( hdb, "_Tables", "Media" );
1121 ok( r == ERROR_SUCCESS, "failed to find entry %u\n", r );
1122
1123 r = find_entry( hdb, "_Tables", "_Property" );
1124 ok( r == ERROR_SUCCESS, "failed to find entry %u\n", r );
1125
1126 r = find_entry( hdb, "_Tables", "MsiPatchHeaders" );
1127 ok( r == ERROR_SUCCESS, "failed to find entry %u\n", r );
1128
1129 r = find_entry( hdb, "_Tables", "Patch" );
1130 ok( r == ERROR_SUCCESS, "failed to find entry %u\n", r );
1131
1132 r = find_entry( hdb, "_Tables", "PatchPackage" );
1133 ok( r == ERROR_SUCCESS, "failed to find entry %u\n", r );
1134
1135 cr = get_string( hdb, 6, "SELECT * FROM `Media` WHERE `Source` IS NOT NULL");
1136 todo_wine ok( !strcmp(cr, patchsource), "Expected \"%s\", got \"%s\"\n", patchsource, cr );
1137
1138 r = get_integer( hdb, 1, "SELECT * FROM `Media` WHERE `Source` IS NOT NULL");
1139 todo_wine ok( r == 100, "Got %u\n", r );
1140
1141 r = get_integer( hdb, 2, "SELECT * FROM `Media` WHERE `Source` IS NOT NULL");
1142 todo_wine ok( r == 10001, "Got %u\n", r );
1143
1144 r = get_integer( hdb, 1, "SELECT * FROM `Media` WHERE `VolumeLabel`=\'DISK1\'");
1145 ok( r == 1, "Got %u\n", r );
1146
1147 cr = get_string( hdb, 4, "SELECT * FROM `Media` WHERE `Source` IS NOT NULL");
1148 ok( !strcmp(cr, "#CAB_msitest"), "Expected \"#CAB_msitest\", got \"%s\"\n", cr );
1149
1150 r = get_integer( hdb, 8, "SELECT * FROM `File` WHERE `File` = 'patch.txt'");
1151 ok( r == 10000, "Got %u\n", r );
1152
1153 MsiCloseHandle( hrec );
1154 MsiViewClose( hview );
1155 MsiCloseHandle( hview );
1156 MsiCloseHandle( hdb );
1157 MsiCloseHandle( hproduct );
1158
1159 r = MsiInstallProductA( msifile, "REMOVE=ALL" );
1160 ok( r == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %u\n", r );
1161
1162cleanup:
1165 DeleteFileA( "msitest\\patch.txt" );
1166 RemoveDirectoryA( "msitest" );
1167}
UINT WINAPI MsiOpenProductA(LPCSTR szProduct, MSIHANDLE *phProduct)
Definition: msi.c:80
#define todo_wine
Definition: custom.c:89
static INT get_integer(MSIHANDLE hdb, UINT field, const char *query)
Definition: patch.c:929
static char * get_string(MSIHANDLE hdb, UINT field, const char *query)
Definition: patch.c:958
static UINT find_entry(MSIHANDLE hdb, const char *table, const char *entry)
Definition: patch.c:888
static UINT find_entryW(MSIHANDLE hdb, const WCHAR *table, const WCHAR *entry)
Definition: patch.c:909

Referenced by START_TEST().

◆ write_file()

static void write_file ( const char filename,
const char data,
DWORD  data_size 
)
static

Definition at line 187 of file patch.c.

188{
189 DWORD size;
192 WriteFile( file, data, data_size, &size, NULL );
193 CloseHandle( file );
194}
#define FILE_ATTRIBUTE_NORMAL
Definition: compat.h:137
BOOL WINAPI WriteFile(IN HANDLE hFile, IN LPCVOID lpBuffer, IN DWORD nNumberOfBytesToWrite OPTIONAL, OUT LPDWORD lpNumberOfBytesWritten, IN LPOVERLAPPED lpOverlapped OPTIONAL)
Definition: rw.c:24
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
#define CREATE_ALWAYS
Definition: disk.h:72
#define GENERIC_WRITE
Definition: nt_native.h:90

Referenced by create_database_suminfo().

◆ write_tables()

static void write_tables ( IStorage stg,
const struct table_data tables,
UINT  num_tables 
)
static

Definition at line 595 of file patch.c.

596{
597 IStream *stm;
598 DWORD i, count;
599 HRESULT r;
600
601 for (i = 0; i < num_tables; i++)
602 {
603 r = IStorage_CreateStream( stg, tables[i].name, STGM_WRITE|STGM_SHARE_EXCLUSIVE, 0, 0, &stm );
604 if (FAILED( r ))
605 {
606 ok( 0, "failed to create stream %#lx\n", r );
607 continue;
608 }
609
610 r = IStream_Write( stm, tables[i].data, tables[i].size, &count );
611 if (FAILED( r ) || count != tables[i].size)
612 ok( 0, "failed to write stream\n" );
613 IStream_Release( stm );
614 }
615}
GLuint GLuint GLsizei count
Definition: gl.h:1545
#define FAILED(hr)
Definition: intsafe.h:51
#define STGM_WRITE
Definition: objbase.h:918
Definition: name.c:39

Variable Documentation

◆ component_dat

const char component_dat[]
static
Initial value:
=
"Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
"s72\tS38\ts72\ti2\tS255\tS72\n"
"Component\tComponent\n"
"patch\t{4B79D87E-6D28-4FD3-92D6-CD9B26AF64F1}\tMSITESTDIR\t0\t\tpatch.txt\n"
"disable\t{BDDBA0EE-0031-4591-ADC0-33308175AC19}\tMSITESTDIR\t0\t\tdisable.txt\n"

Definition at line 76 of file patch.c.

◆ condition_dat

const char condition_dat[]
static
Initial value:
=
"Feature_\tLevel\tCondition\n"
"s38\ti2\tS255\n"
"Condition\tFeature_\tLevel\n"
"disable\t0\tDISABLE_FEATURE\n"

Definition at line 117 of file patch.c.

◆ directory_dat

const char directory_dat[]
static
Initial value:
=
"Directory\tDirectory_Parent\tDefaultDir\n"
"s72\tS72\tl255\n"
"Directory\tDirectory\n"
"MSITESTDIR\tProgramFilesFolder\tmsitest\n"
"ProgramFilesFolder\tTARGETDIR\t.\n"
"TARGETDIR\t\tSourceDir"

Definition at line 68 of file patch.c.

◆ feature_comp_dat

const char feature_comp_dat[]
static
Initial value:
=
"Feature_\tComponent_\n"
"s38\ts72\n"
"FeatureComponents\tFeature_\tComponent_\n"
"patch\tpatch\n"
"disable\tdisable\n"

Definition at line 90 of file patch.c.

◆ feature_dat

const char feature_dat[]
static
Initial value:
=
"Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
"s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
"Feature\tFeature\n"
"patch\t\t\tpatch feature\t1\t1\tMSITESTDIR\t0\n"
"disable\t\t\tdisabled feature\t1\t1\tMSITESTDIR\t0\n"

Definition at line 83 of file patch.c.

◆ file_dat

const char file_dat[]
static
Initial value:
=
"File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
"s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
"File\tFile\n"
"patch.txt\tpatch\tpatch.txt\t1000\t\t\t0\t1\n"
"disable.txt\tdisable\tdisable.txt\t1000\t\t\t0\t1\n"

Definition at line 61 of file patch.c.

◆ install_exec_seq_dat

const char install_exec_seq_dat[]
static
Initial value:
=
"Action\tCondition\tSequence\n"
"s72\tS255\tI2\n"
"InstallExecuteSequence\tAction\n"
"LaunchConditions\t\t100\n"
"CostInitialize\t\t800\n"
"FileCost\t\t900\n"
"CostFinalize\t\t1000\n"
"InstallValidate\t\t1400\n"
"InstallInitialize\t\t1500\n"
"ProcessComponents\t\t1600\n"
"RemoveFiles\t\t1700\n"
"InstallFiles\t\t2000\n"
"RegisterUser\t\t3000\n"
"RegisterProduct\t\t3100\n"
"PublishFeatures\t\t5100\n"
"PublishProduct\t\t5200\n"
"UnpublishFeatures\t\t5300\n"
"InstallFinalize\t\t6000\n"

Definition at line 97 of file patch.c.

◆ media_dat

const char media_dat[]
static
Initial value:
=
"DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
"i2\ti4\tL64\tS255\tS32\tS72\n"
"Media\tDiskId\n"
"1\t1\t\t\tDISK1\t\n"

Definition at line 55 of file patch.c.

◆ msifile

const char* msifile = "winetest-patch.msi"
static

◆ msifileW

const WCHAR msifileW[] = L"winetest-patch.msi"
static

Definition at line 37 of file patch.c.

Referenced by test_MsiOpenDatabase().

◆ mspfile

const char* mspfile = "winetest-patch.msp"
static

◆ mspfileW

const WCHAR mspfileW[] = L"winetest-patch.msp"
static

Definition at line 38 of file patch.c.

Referenced by test_MsiOpenDatabase().

◆ p_data0

const WCHAR p_data0[]
static
Initial value:
= {
0x0001, 0x0001, 0x0001, 0x0001, 0x8001, 0x8002, 0x8003, 0x8004,
0x0002, 0x0003, 0x0004, 0x0005, 0xad00, 0xbd26, 0x8d00, 0x9502
}

Definition at line 292 of file patch.c.

◆ p_data1

const WCHAR p_data1[]
static
Initial value:
= {
0x0001
}

Definition at line 296 of file patch.c.

◆ p_data2

const char p_data2[]
static
Initial value:
= {
"MsiPatchSequencePatchFamilyProductCodeSequenceAttributes1.1.19388.37230913B8D18FBB64CACA239C74C11E3FA74"
}

Definition at line 299 of file patch.c.

◆ p_data3

const WCHAR p_data3[]
static
Initial value:
= {
0, 0,
16, 5,
11, 1,
11, 1,
8, 1,
10, 1,
15, 1,
32, 1,
}

Definition at line 302 of file patch.c.

◆ p_data4

const char p_data4[]
static
Initial value:
= {
0x4d, 0x53, 0x43, 0x46, 0x00, 0x00, 0x00, 0x00, 0x94, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x03, 0x01, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00,
0xea, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x87,
0x3c, 0xd4, 0xb8, 0x20, 0x00, 0x70, 0x61, 0x74, 0x63, 0x68, 0x2e,
0x74, 0x78, 0x74, 0x00, 0xe8, 0x03, 0x00, 0x00, 0xea, 0x03, 0x00,
0x00, 0x00, 0x00, 0xcb, 0x50, 0x17, 0x7e, 0x20, 0x00, 0x66, 0x69,
0x6c, 0x65, 0x2e, 0x74, 0x78, 0x74, 0x00, 0xb0, 0xb2, 0xb2, 0x25,
0x2d, 0x00, 0xd2, 0x07, 0x43, 0x4b, 0xcb, 0x2d, 0xce, 0x2c, 0x49,
0x2d, 0x2e, 0x89, 0x29, 0x48, 0x2c, 0x49, 0xce, 0x48, 0x4d, 0xd1,
0x2b, 0xa9, 0x28, 0x51, 0x18, 0x05, 0xa3, 0x60, 0x14, 0x0c, 0x37,
0x90, 0x8b, 0x9c, 0xd3, 0x41, 0xf9, 0x9c, 0x61, 0x14, 0x8c, 0x82,
0x51, 0x30, 0xdc, 0x00, 0x00
}

Definition at line 313 of file patch.c.

◆ p_data5

const WCHAR p_data5[]
static
Initial value:
= {
0x0007, 0x0000, 0x0006, 0x8000
}

Definition at line 329 of file patch.c.

◆ p_data6

const char p_data6[]
static
Initial value:
= {
0xfe, 0xff, 0x00, 0x00, 0x05, 0x02, 0x02, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0xe0, 0x85, 0x9f, 0xf2, 0xf9,
0x4f, 0x68, 0x10, 0xab, 0x91, 0x08, 0x00, 0x2b, 0x27, 0xb3, 0xd9,
0x30, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00,
0x00, 0x09, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x07, 0x00,
0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x90,
0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00,
0x0f, 0x00, 0x00, 0x00, 0xd8, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00,
0x00, 0x27, 0x00, 0x00, 0x00, 0x7b, 0x30, 0x46, 0x39, 0x36, 0x43,
0x44, 0x43, 0x30, 0x2d, 0x34, 0x43, 0x44, 0x46, 0x2d, 0x34, 0x33,
0x30, 0x34, 0x2d, 0x42, 0x32, 0x38, 0x33, 0x2d, 0x37, 0x42, 0x39,
0x32, 0x36, 0x34, 0x38, 0x38, 0x39, 0x45, 0x46, 0x37, 0x7d, 0x00,
0x00, 0x1e, 0x00, 0x00, 0x00, 0x27, 0x00, 0x00, 0x00, 0x7b, 0x39,
0x31, 0x33, 0x42, 0x38, 0x44, 0x31, 0x38, 0x2d, 0x46, 0x42, 0x42,
0x36, 0x2d, 0x34, 0x43, 0x41, 0x43, 0x2d, 0x41, 0x32, 0x33, 0x39,
0x2d, 0x43, 0x37, 0x34, 0x43, 0x31, 0x31, 0x45, 0x33, 0x46, 0x41,
0x37, 0x34, 0x7d, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x25, 0x00,
0x00, 0x00, 0x3a, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x54, 0x6f,
0x75, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x64, 0x3b, 0x3a, 0x23,
0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x54, 0x6f, 0x75, 0x70, 0x67,
0x72, 0x61, 0x64, 0x65, 0x64, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x00,
0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x50, 0x61, 0x74, 0x63, 0x68,
0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x00,
0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00
}

Definition at line 332 of file patch.c.

◆ p_name0

const WCHAR p_name0[] = { 0x4840, 0x3b3f, 0x43f2, 0x4438, 0x45b1, 0 }
static

Definition at line 276 of file patch.c.

◆ p_name1

const WCHAR p_name1[] = { 0x4840, 0x3f7f, 0x4164, 0x422f, 0x4836, 0 }
static

Definition at line 277 of file patch.c.

◆ p_name2

const WCHAR p_name2[] = { 0x4840, 0x3f3f, 0x4577, 0x446c, 0x3b6a, 0x45e4, 0x4824, 0 }
static

Definition at line 278 of file patch.c.

◆ p_name3

const WCHAR p_name3[] = { 0x4840, 0x3f3f, 0x4577, 0x446c, 0x3e6a, 0x44b2, 0x482f, 0 }
static

Definition at line 279 of file patch.c.

◆ p_name4

const WCHAR p_name4[] = { 0x3a8c, 0x47cb, 0x45b0, 0x45ec, 0x45a8, 0x4837, 0}
static

Definition at line 280 of file patch.c.

◆ p_name5

const WCHAR p_name5[] = { 0x4840, 0x4596, 0x3e6c, 0x45e4, 0x42e6, 0x421c, 0x4634, 0x4468, 0x4226, 0 }
static

Definition at line 281 of file patch.c.

◆ p_name6

const WCHAR p_name6[]
static
Initial value:
= { 0x0005, 0x0053, 0x0075, 0x006d, 0x006d, 0x0061, 0x0072,
0x0079, 0x0049, 0x006e, 0x0066, 0x006f, 0x0072, 0x006d,
0x0061, 0x0074, 0x0069, 0x006f, 0x006e, 0 }

Definition at line 282 of file patch.c.

◆ p_name7

const WCHAR p_name7[]
static
Initial value:
= { 0x0074, 0x0061, 0x0072, 0x0067, 0x0065, 0x0074, 0x0054, 0x006f, 0x0075, 0x0070,
0x0067, 0x0072, 0x0061, 0x0064, 0x0065, 0x0064, 0 }

Definition at line 286 of file patch.c.

Referenced by create_patch().

◆ p_name8

const WCHAR p_name8[]
static
Initial value:
= { 0x0023, 0x0074, 0x0061, 0x0072, 0x0067, 0x0065, 0x0074, 0x0054, 0x006f, 0x0075,
0x0070, 0x0067, 0x0072, 0x0061, 0x0064, 0x0065, 0x0064, 0 }

Definition at line 288 of file patch.c.

Referenced by create_patch().

◆ property_dat

const char property_dat[]
static
Initial value:
=
"Property\tValue\n"
"s72\tl0\n"
"Property\tProperty\n"
"Manufacturer\tWineHQ\n"
"ProductCode\t{913B8D18-FBB6-4CAC-A239-C74C11E3FA74}\n"
"UpgradeCode\t{A2E3D643-4E2C-477F-A309-F76F552D5F43}\n"
"ProductLanguage\t1033\n"
"ProductName\tmsitest\n"
"ProductVersion\t1.1.1\n"
"PATCHNEWSUMMARYSUBJECT\tInstaller Database\n"
"MSIFASTINSTALL\t1\n"

Definition at line 42 of file patch.c.

◆ t1_data0

const WCHAR t1_data0[]
static
Initial value:
= {
0x0008, 0x0001, 0x03ea, 0x8000
}

Definition at line 383 of file patch.c.

◆ t1_data1

const char t1_data1[]
static
Initial value:
= {
"patch.txt"
}

Definition at line 386 of file patch.c.

◆ t1_data2

const WCHAR t1_data2[]
static
Initial value:
= {
0, 0,
9, 1,
}

Definition at line 389 of file patch.c.

◆ t1_data3

const char t1_data3[]
static

Definition at line 394 of file patch.c.

◆ t1_name0

const WCHAR t1_name0[] = { 0x4840, 0x430f, 0x422f, 0 }
static

Definition at line 376 of file patch.c.

◆ t1_name1

const WCHAR t1_name1[] = { 0x4840, 0x3f3f, 0x4577, 0x446c, 0x3b6a, 0x45e4, 0x4824, 0 }
static

Definition at line 377 of file patch.c.

◆ t1_name2

const WCHAR t1_name2[] = { 0x4840, 0x3f3f, 0x4577, 0x446c, 0x3e6a, 0x44b2, 0x482f, 0 }
static

Definition at line 378 of file patch.c.

◆ t1_name3

const WCHAR t1_name3[]
static
Initial value:
= { 0x0005, 0x0053, 0x0075, 0x006d, 0x006d, 0x0061, 0x0072,
0x0079, 0x0049, 0x006e, 0x0066, 0x006f, 0x0072, 0x006d,
0x0061, 0x0074, 0x0069, 0x006f, 0x006e, 0 }

Definition at line 379 of file patch.c.

◆ t2_data0

const WCHAR t2_data0[]
static
Initial value:
= {
0x00c0, 0x0001, 0x9000, 0x83e8, 0x0801, 0x0002, 0x0003, 0x0002,
0x03e8, 0x8000, 0x0000, 0x0000, 0x9000, 0x83e9
}

Definition at line 465 of file patch.c.

◆ t2_data1

const WCHAR t2_data1[]
static
Initial value:
= {
0x0601, 0x8002, 0x03e9, 0x8000, 0x0000, 0x000d, 0x0000, 0x000e
}

Definition at line 469 of file patch.c.

◆ t2_data10

const WCHAR t2_data10[]
static
Initial value:
= {
0x0201, 0x0006, 0x0003
}

Definition at line 568 of file patch.c.

◆ t2_data11

const WCHAR t2_data11[]
static
Initial value:
= {
0x0601, 0x0003, 0x0004, 0x0005, 0x8000, 0x0000, 0x0002
}

Definition at line 571 of file patch.c.

◆ t2_data12

const WCHAR t2_data12[]
static
Initial value:
= {
0x0801, 0x0006, 0x0000, 0x0000, 0x0007, 0x8001, 0x8001, 0x0005,
0x8000
}

Definition at line 574 of file patch.c.

◆ t2_data2

const WCHAR t2_data2[]
static
Initial value:
= {
0x0401, 0x000f, 0x0000, 0x0010, 0xad48, 0x0401, 0x000f, 0x0000,
0x0011, 0xa502, 0x0401, 0x000f, 0x0000, 0x0012, 0x8104, 0x0401,
0x000f, 0x0000, 0x0013, 0x8502, 0x0401, 0x000f, 0x0000, 0x0014,
0x9900, 0x0401, 0x000f, 0x0000, 0x0015, 0x9d48, 0x0401, 0x0016,
0x0000, 0x0017, 0xad26, 0x0401, 0x0016, 0x0000, 0x0018, 0x8502,
0x0401, 0x001a, 0x0000, 0x001b, 0xad26, 0x0401, 0x001a, 0x0000,
0x0014, 0x8900
}

Definition at line 472 of file patch.c.

◆ t2_data3

const WCHAR t2_data3[]
static
Initial value:
= {
0x0101, 0x000f, 0x0101, 0x0016, 0x0101, 0x001a
}

Definition at line 481 of file patch.c.

◆ t2_data4

const WCHAR t2_data4[]
static
Initial value:
= {
0x0002, 0x0008, 0x0009, 0x0201, 0x000a, 0x000b
}

Definition at line 484 of file patch.c.

◆ t2_data5

const WCHAR t2_data5[]
static
Initial value:
= {
0x0201, 0x0019, 0x8002
}

Definition at line 487 of file patch.c.

◆ t2_data6

const WCHAR t2_data6[]
static
Initial value:
= {
0x0301, 0x000c, 0x0000, 0x87d1
}

Definition at line 490 of file patch.c.

◆ t2_data7

const char t2_data7[]
static
Initial value:
= {
"patch.txtfile.txtfile{327d9640-674f-4b9f-8b8a-547a0f6f8518}MSITESTDIRnewnew featurePATCHNEWSUMMARYSUBJECT"
"Installation DatabasePATCHNEWPACKAGECODE{42A14A82-12F8-4E6D-970E-1B4EE7BE28B0}PatchFiles#CAB_msitestprop"
"PatchFile_SequencePatchSizeAttributesHeaderStreamRef_PatchPackagePatchIdMedia_"
"{0F96CDC0-4CDF-4304-B283-7B9264889EF7}MsiPatchHeadersStreamRef"
}

Definition at line 493 of file patch.c.

◆ t2_data8

const WCHAR t2_data8[]
static

Definition at line 499 of file patch.c.

◆ t2_data9

const char t2_data9[]
static

Definition at line 530 of file patch.c.

◆ t2_name0

const WCHAR t2_name0[] = { 0x4840, 0x430f, 0x422f, 0 }
static

Definition at line 447 of file patch.c.

◆ t2_name1

const WCHAR t2_name1[] = { 0x4840, 0x4216, 0x4327, 0x4824, 0 }
static

Definition at line 448 of file patch.c.

◆ t2_name10

const WCHAR t2_name10[]
static
Initial value:
= { 0x4840, 0x420f, 0x45e4, 0x4578, 0x3b28, 0x4432, 0x44b3,
0x4231, 0x45f1, 0x4836, 0 }

Definition at line 460 of file patch.c.

◆ t2_name11

const WCHAR t2_name11[] = { 0x4840, 0x448c, 0x44f0, 0x4472, 0x4468, 0x4837, 0 }
static

Definition at line 462 of file patch.c.

◆ t2_name12

const WCHAR t2_name12[] = { 0x4840, 0x420f, 0x45e4, 0x4578, 0x4828, 0 }
static

Definition at line 463 of file patch.c.

◆ t2_name2

const WCHAR t2_name2[] = { 0x4840, 0x3b3f, 0x43f2, 0x4438, 0x45b1, 0 }
static

Definition at line 449 of file patch.c.

◆ t2_name3

const WCHAR t2_name3[] = { 0x4840, 0x3f7f, 0x4164, 0x422f, 0x4836, 0 }
static

Definition at line 450 of file patch.c.

◆ t2_name4

const WCHAR t2_name4[] = { 0x4840, 0x4559, 0x44f2, 0x4568, 0x4737, 0 }
static

Definition at line 451 of file patch.c.

◆ t2_name5

const WCHAR t2_name5[] = { 0x4840, 0x4119, 0x41b7, 0x3e6b, 0x41a4, 0x412e, 0x422a, 0 }
static

Definition at line 452 of file patch.c.

◆ t2_name6

const WCHAR t2_name6[]
static
Initial value:
= { 0x4840, 0x4452, 0x45f6, 0x43e4, 0x3baf, 0x423b, 0x4626,
0x4237, 0x421c, 0x4634, 0x4468, 0x4226, 0 }

Definition at line 453 of file patch.c.

◆ t2_name7

const WCHAR t2_name7[] = { 0x4840, 0x3f3f, 0x4577, 0x446c, 0x3b6a, 0x45e4, 0x4824, 0 }
static

Definition at line 455 of file patch.c.

◆ t2_name8

const WCHAR t2_name8[] = { 0x4840, 0x3f3f, 0x4577, 0x446c, 0x3e6a, 0x44b2, 0x482f, 0 }
static

Definition at line 456 of file patch.c.

◆ t2_name9

const WCHAR t2_name9[]
static
Initial value:
= { 0x0005, 0x0053, 0x0075, 0x006d, 0x006d, 0x0061, 0x0072,
0x0079, 0x0049, 0x006e, 0x0066, 0x006f, 0x0072, 0x006d,
0x0061, 0x0074, 0x0069, 0x006f, 0x006e, 0 }

Definition at line 457 of file patch.c.

◆ table_patch_data

const struct table_data table_patch_data[]
static
Initial value:
= {
{ p_name0, p_data0, sizeof p_data0 },
{ p_name1, p_data1, sizeof p_data1 },
{ p_name2, p_data2, sizeof p_data2 - 1 },
{ p_name3, p_data3, sizeof p_data3 },
{ p_name4, p_data4, sizeof p_data4 },
{ p_name5, p_data5, sizeof p_data5 },
{ p_name6, p_data6, sizeof p_data6 }
}
static const WCHAR p_name6[]
Definition: patch.c:282
static const char p_data6[]
Definition: patch.c:332
static const WCHAR p_data3[]
Definition: patch.c:302
static const char p_data4[]
Definition: patch.c:313
static const WCHAR p_data0[]
Definition: patch.c:292
static const WCHAR p_data1[]
Definition: patch.c:296
static const WCHAR p_name4[]
Definition: patch.c:280
static const char p_data2[]
Definition: patch.c:299
static const WCHAR p_name5[]
Definition: patch.c:281
static const WCHAR p_data5[]
Definition: patch.c:329
static const WCHAR p_name1[]
Definition: patch.c:277
static const WCHAR p_name0[]
Definition: patch.c:276
static const WCHAR p_name2[]
Definition: patch.c:278
static const WCHAR p_name3[]
Definition: patch.c:279

Definition at line 366 of file patch.c.

Referenced by create_patch().

◆ table_transform1_data

const struct table_data table_transform1_data[]
static
Initial value:
= {
{ t1_name0, t1_data0, sizeof t1_data0 },
{ t1_name1, t1_data1, sizeof t1_data1 - 1 },
{ t1_name2, t1_data2, sizeof t1_data2 },
{ t1_name3, t1_data3, sizeof t1_data3 }
}
static const WCHAR t1_data0[]
Definition: patch.c:383
static const WCHAR t1_name2[]
Definition: patch.c:378
static const WCHAR t1_name3[]
Definition: patch.c:379
static const char t1_data1[]
Definition: patch.c:386
static const WCHAR t1_name1[]
Definition: patch.c:377
static const WCHAR t1_data2[]
Definition: patch.c:389
static const char t1_data3[]
Definition: patch.c:394
static const WCHAR t1_name0[]
Definition: patch.c:376

Definition at line 440 of file patch.c.

Referenced by create_patch().

◆ table_transform2_data

const struct table_data table_transform2_data[]
static
Initial value:
= {
{ t2_name0, t2_data0, sizeof t2_data0 },
{ t2_name1, t2_data1, sizeof t2_data1 },
{ t2_name2, t2_data2, sizeof t2_data2 },
{ t2_name3, t2_data3, sizeof t2_data3 },
{ t2_name4, t2_data4, sizeof t2_data4 },
{ t2_name5, t2_data5, sizeof t2_data5 },
{ t2_name6, t2_data6, sizeof t2_data6 },
{ t2_name7, t2_data7, sizeof t2_data7 - 1 },
{ t2_name8, t2_data8, sizeof t2_data8 },
{ t2_name9, t2_data9, sizeof t2_data9 },
}
static const WCHAR t2_name12[]
Definition: patch.c:463
static const WCHAR t2_data10[]
Definition: patch.c:568
static const WCHAR t2_data4[]
Definition: patch.c:484
static const WCHAR t2_data8[]
Definition: patch.c:499
static const WCHAR t2_data2[]
Definition: patch.c:472
static const WCHAR t2_data11[]
Definition: patch.c:571
static const WCHAR t2_name11[]
Definition: patch.c:462
static const char t2_data7[]
Definition: patch.c:493
static const WCHAR t2_name7[]
Definition: patch.c:455
static const WCHAR t2_name3[]
Definition: patch.c:450
static const WCHAR t2_name1[]
Definition: patch.c:448
static const WCHAR t2_data3[]
Definition: patch.c:481
static const WCHAR t2_name9[]
Definition: patch.c:457
static const WCHAR t2_data6[]
Definition: patch.c:490
static const WCHAR t2_name10[]
Definition: patch.c:460
static const WCHAR t2_data5[]
Definition: patch.c:487
static const WCHAR t2_name4[]
Definition: patch.c:451
static const WCHAR t2_name8[]
Definition: patch.c:456
static const WCHAR t2_name6[]
Definition: patch.c:453
static const WCHAR t2_name2[]
Definition: patch.c:449
static const WCHAR t2_name5[]
Definition: patch.c:452
static const WCHAR t2_name0[]
Definition: patch.c:447
static const WCHAR t2_data1[]
Definition: patch.c:469
static const char t2_data9[]
Definition: patch.c:530
static const WCHAR t2_data0[]
Definition: patch.c:465
static const WCHAR t2_data12[]
Definition: patch.c:574

Definition at line 579 of file patch.c.

Referenced by create_patch().

◆ tables

const struct msi_table tables[]
static
Initial value:
=
{
ADD_TABLE( component ),
ADD_TABLE( feature_comp ),
ADD_TABLE( install_exec_seq ),
}
__u8 media
Definition: mkdosfs.c:9
#define ADD_TABLE(x)
Definition: automation.c:156
INTERNETFEATURELIST feature
Definition: misc.c:1719

Definition at line 130 of file patch.c.

Referenced by create_database_suminfo(), test_MsiOpenDatabase(), test_patch_registration(), test_simple_patch(), test_system_tables(), and write_tables().