Commit 25801274 authored by Hans Leidekker's avatar Hans Leidekker Committed by Alexandre Julliard

msi: Get rid of unnecessary typedefs.

parent 3611398b
...@@ -69,8 +69,7 @@ static INT ui_actionstart(MSIPACKAGE *package, LPCWSTR action, LPCWSTR descripti ...@@ -69,8 +69,7 @@ static INT ui_actionstart(MSIPACKAGE *package, LPCWSTR action, LPCWSTR descripti
return rc; return rc;
} }
static void ui_actioninfo(MSIPACKAGE *package, LPCWSTR action, BOOL start, static void ui_actioninfo(MSIPACKAGE *package, const WCHAR *action, BOOL start, INT rc)
INT rc)
{ {
MSIRECORD *row; MSIRECORD *row;
WCHAR *template; WCHAR *template;
...@@ -815,11 +814,6 @@ UINT msi_load_all_components( MSIPACKAGE *package ) ...@@ -815,11 +814,6 @@ UINT msi_load_all_components( MSIPACKAGE *package )
return r; return r;
} }
typedef struct {
MSIPACKAGE *package;
MSIFEATURE *feature;
} _ilfs;
static UINT add_feature_component( MSIFEATURE *feature, MSICOMPONENT *comp ) static UINT add_feature_component( MSIFEATURE *feature, MSICOMPONENT *comp )
{ {
ComponentList *cl; ComponentList *cl;
...@@ -846,22 +840,28 @@ static UINT add_feature_child( MSIFEATURE *parent, MSIFEATURE *child ) ...@@ -846,22 +840,28 @@ static UINT add_feature_child( MSIFEATURE *parent, MSIFEATURE *child )
return ERROR_SUCCESS; return ERROR_SUCCESS;
} }
struct package_feature
{
MSIPACKAGE *package;
MSIFEATURE *feature;
};
static UINT iterate_load_featurecomponents(MSIRECORD *row, LPVOID param) static UINT iterate_load_featurecomponents(MSIRECORD *row, LPVOID param)
{ {
_ilfs* ilfs = param; struct package_feature *package_feature = param;
LPCWSTR component; LPCWSTR component;
MSICOMPONENT *comp; MSICOMPONENT *comp;
component = MSI_RecordGetString(row,1); component = MSI_RecordGetString(row,1);
/* check to see if the component is already loaded */ /* check to see if the component is already loaded */
comp = msi_get_loaded_component( ilfs->package, component ); comp = msi_get_loaded_component( package_feature->package, component );
if (!comp) if (!comp)
{ {
WARN("ignoring unknown component %s\n", debugstr_w(component)); WARN("ignoring unknown component %s\n", debugstr_w(component));
return ERROR_SUCCESS; return ERROR_SUCCESS;
} }
add_feature_component( ilfs->feature, comp ); add_feature_component( package_feature->feature, comp );
comp->Enabled = TRUE; comp->Enabled = TRUE;
return ERROR_SUCCESS; return ERROR_SUCCESS;
...@@ -872,7 +872,7 @@ static UINT load_feature(MSIRECORD *row, LPVOID param) ...@@ -872,7 +872,7 @@ static UINT load_feature(MSIRECORD *row, LPVOID param)
MSIPACKAGE *package = param; MSIPACKAGE *package = param;
MSIFEATURE *feature; MSIFEATURE *feature;
MSIQUERY *view; MSIQUERY *view;
_ilfs ilfs; struct package_feature package_feature;
UINT rc; UINT rc;
/* fill in the data */ /* fill in the data */
...@@ -912,10 +912,10 @@ static UINT load_feature(MSIRECORD *row, LPVOID param) ...@@ -912,10 +912,10 @@ static UINT load_feature(MSIRECORD *row, LPVOID param)
if (rc != ERROR_SUCCESS) if (rc != ERROR_SUCCESS)
return ERROR_SUCCESS; return ERROR_SUCCESS;
ilfs.package = package; package_feature.package = package;
ilfs.feature = feature; package_feature.feature = feature;
rc = MSI_IterateRecords(view, NULL, iterate_load_featurecomponents , &ilfs); rc = MSI_IterateRecords(view, NULL, iterate_load_featurecomponents, &package_feature);
msiobj_release(&view->hdr); msiobj_release(&view->hdr);
return rc; return rc;
} }
...@@ -3418,19 +3418,19 @@ static UINT ACTION_ProcessComponents(MSIPACKAGE *package) ...@@ -3418,19 +3418,19 @@ static UINT ACTION_ProcessComponents(MSIPACKAGE *package)
return ERROR_SUCCESS; return ERROR_SUCCESS;
} }
typedef struct { struct typelib
{
CLSID clsid; CLSID clsid;
LPWSTR source; LPWSTR source;
LPWSTR path; LPWSTR path;
ITypeLib *ptLib; ITypeLib *ptLib;
} typelib_struct; };
static BOOL CALLBACK Typelib_EnumResNameProc( HMODULE hModule, LPCWSTR lpszType, static BOOL CALLBACK Typelib_EnumResNameProc( HMODULE hModule, LPCWSTR lpszType,
LPWSTR lpszName, LONG_PTR lParam) LPWSTR lpszName, LONG_PTR lParam)
{ {
TLIBATTR *attr; TLIBATTR *attr;
typelib_struct *tl_struct = (typelib_struct*) lParam; struct typelib *tl_struct = (struct typelib *)lParam;
int sz; int sz;
HRESULT res; HRESULT res;
...@@ -3500,7 +3500,7 @@ static UINT ITERATE_RegisterTypeLibraries(MSIRECORD *row, LPVOID param) ...@@ -3500,7 +3500,7 @@ static UINT ITERATE_RegisterTypeLibraries(MSIRECORD *row, LPVOID param)
LPCWSTR component; LPCWSTR component;
MSICOMPONENT *comp; MSICOMPONENT *comp;
MSIFILE *file; MSIFILE *file;
typelib_struct tl_struct; struct typelib tl_struct;
ITypeLib *tlib; ITypeLib *tlib;
HMODULE module; HMODULE module;
HRESULT hr; HRESULT hr;
......
...@@ -34,18 +34,18 @@ ...@@ -34,18 +34,18 @@
WINE_DEFAULT_DEBUG_CHANNEL(msidb); WINE_DEFAULT_DEBUG_CHANNEL(msidb);
typedef struct tagMSIALTERVIEW struct alter_view
{ {
MSIVIEW view; MSIVIEW view;
MSIDATABASE *db; MSIDATABASE *db;
MSIVIEW *table; MSIVIEW *table;
column_info *colinfo; column_info *colinfo;
INT hold; INT hold;
} MSIALTERVIEW; };
static UINT ALTER_fetch_int( struct tagMSIVIEW *view, UINT row, UINT col, UINT *val ) static UINT ALTER_fetch_int( struct tagMSIVIEW *view, UINT row, UINT col, UINT *val )
{ {
MSIALTERVIEW *av = (MSIALTERVIEW*)view; struct alter_view *av = (struct alter_view *)view;
TRACE("%p %d %d %p\n", av, row, col, val ); TRACE("%p %d %d %p\n", av, row, col, val );
...@@ -54,7 +54,7 @@ static UINT ALTER_fetch_int( struct tagMSIVIEW *view, UINT row, UINT col, UINT * ...@@ -54,7 +54,7 @@ static UINT ALTER_fetch_int( struct tagMSIVIEW *view, UINT row, UINT col, UINT *
static UINT ALTER_fetch_stream( struct tagMSIVIEW *view, UINT row, UINT col, IStream **stm) static UINT ALTER_fetch_stream( struct tagMSIVIEW *view, UINT row, UINT col, IStream **stm)
{ {
MSIALTERVIEW *av = (MSIALTERVIEW*)view; struct alter_view *av = (struct alter_view *)view;
TRACE("%p %d %d %p\n", av, row, col, stm ); TRACE("%p %d %d %p\n", av, row, col, stm );
...@@ -63,7 +63,7 @@ static UINT ALTER_fetch_stream( struct tagMSIVIEW *view, UINT row, UINT col, ISt ...@@ -63,7 +63,7 @@ static UINT ALTER_fetch_stream( struct tagMSIVIEW *view, UINT row, UINT col, ISt
static UINT ALTER_execute( struct tagMSIVIEW *view, MSIRECORD *record ) static UINT ALTER_execute( struct tagMSIVIEW *view, MSIRECORD *record )
{ {
MSIALTERVIEW *av = (MSIALTERVIEW*)view; struct alter_view *av = (struct alter_view *)view;
UINT ref; UINT ref;
TRACE("%p %p\n", av, record); TRACE("%p %p\n", av, record);
...@@ -86,7 +86,7 @@ static UINT ALTER_execute( struct tagMSIVIEW *view, MSIRECORD *record ) ...@@ -86,7 +86,7 @@ static UINT ALTER_execute( struct tagMSIVIEW *view, MSIRECORD *record )
static UINT ALTER_close( struct tagMSIVIEW *view ) static UINT ALTER_close( struct tagMSIVIEW *view )
{ {
MSIALTERVIEW *av = (MSIALTERVIEW*)view; struct alter_view *av = (struct alter_view *)view;
TRACE("%p\n", av ); TRACE("%p\n", av );
...@@ -95,7 +95,7 @@ static UINT ALTER_close( struct tagMSIVIEW *view ) ...@@ -95,7 +95,7 @@ static UINT ALTER_close( struct tagMSIVIEW *view )
static UINT ALTER_get_dimensions( struct tagMSIVIEW *view, UINT *rows, UINT *cols ) static UINT ALTER_get_dimensions( struct tagMSIVIEW *view, UINT *rows, UINT *cols )
{ {
MSIALTERVIEW *av = (MSIALTERVIEW*)view; struct alter_view *av = (struct alter_view *)view;
TRACE("%p %p %p\n", av, rows, cols ); TRACE("%p %p %p\n", av, rows, cols );
...@@ -105,7 +105,7 @@ static UINT ALTER_get_dimensions( struct tagMSIVIEW *view, UINT *rows, UINT *col ...@@ -105,7 +105,7 @@ static UINT ALTER_get_dimensions( struct tagMSIVIEW *view, UINT *rows, UINT *col
static UINT ALTER_get_column_info( struct tagMSIVIEW *view, UINT n, LPCWSTR *name, static UINT ALTER_get_column_info( struct tagMSIVIEW *view, UINT n, LPCWSTR *name,
UINT *type, BOOL *temporary, LPCWSTR *table_name ) UINT *type, BOOL *temporary, LPCWSTR *table_name )
{ {
MSIALTERVIEW *av = (MSIALTERVIEW*)view; struct alter_view *av = (struct alter_view *)view;
TRACE("%p %d %p %p %p %p\n", av, n, name, type, temporary, table_name ); TRACE("%p %d %p %p %p %p\n", av, n, name, type, temporary, table_name );
...@@ -115,7 +115,7 @@ static UINT ALTER_get_column_info( struct tagMSIVIEW *view, UINT n, LPCWSTR *nam ...@@ -115,7 +115,7 @@ static UINT ALTER_get_column_info( struct tagMSIVIEW *view, UINT n, LPCWSTR *nam
static UINT ALTER_modify( struct tagMSIVIEW *view, MSIMODIFY eModifyMode, static UINT ALTER_modify( struct tagMSIVIEW *view, MSIMODIFY eModifyMode,
MSIRECORD *rec, UINT row ) MSIRECORD *rec, UINT row )
{ {
MSIALTERVIEW *av = (MSIALTERVIEW*)view; struct alter_view *av = (struct alter_view *)view;
TRACE("%p %d %p\n", av, eModifyMode, rec ); TRACE("%p %d %p\n", av, eModifyMode, rec );
...@@ -124,7 +124,7 @@ static UINT ALTER_modify( struct tagMSIVIEW *view, MSIMODIFY eModifyMode, ...@@ -124,7 +124,7 @@ static UINT ALTER_modify( struct tagMSIVIEW *view, MSIMODIFY eModifyMode,
static UINT ALTER_delete( struct tagMSIVIEW *view ) static UINT ALTER_delete( struct tagMSIVIEW *view )
{ {
MSIALTERVIEW *av = (MSIALTERVIEW*)view; struct alter_view *av = (struct alter_view *)view;
TRACE("%p\n", av ); TRACE("%p\n", av );
if (av->table) if (av->table)
...@@ -159,7 +159,7 @@ static const MSIVIEWOPS alter_ops = ...@@ -159,7 +159,7 @@ static const MSIVIEWOPS alter_ops =
UINT ALTER_CreateView( MSIDATABASE *db, MSIVIEW **view, LPCWSTR name, column_info *colinfo, int hold ) UINT ALTER_CreateView( MSIDATABASE *db, MSIVIEW **view, LPCWSTR name, column_info *colinfo, int hold )
{ {
MSIALTERVIEW *av; struct alter_view *av;
UINT r; UINT r;
TRACE("%p %p %s %d\n", view, colinfo, debugstr_w(name), hold ); TRACE("%p %p %s %d\n", view, colinfo, debugstr_w(name), hold );
......
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
WINE_DEFAULT_DEBUG_CHANNEL(msi); WINE_DEFAULT_DEBUG_CHANNEL(msi);
typedef struct tagMSISIGNATURE struct signature
{ {
LPCWSTR Name; /* NOT owned by this structure */ LPCWSTR Name; /* NOT owned by this structure */
LPWSTR File; LPWSTR File;
...@@ -47,7 +47,7 @@ typedef struct tagMSISIGNATURE ...@@ -47,7 +47,7 @@ typedef struct tagMSISIGNATURE
FILETIME MinTime; FILETIME MinTime;
FILETIME MaxTime; FILETIME MaxTime;
LPWSTR Languages; LPWSTR Languages;
}MSISIGNATURE; };
void msi_parse_version_string(LPCWSTR verStr, PDWORD ms, PDWORD ls) void msi_parse_version_string(LPCWSTR verStr, PDWORD ms, PDWORD ls)
{ {
...@@ -80,7 +80,7 @@ void msi_parse_version_string(LPCWSTR verStr, PDWORD ms, PDWORD ls) ...@@ -80,7 +80,7 @@ void msi_parse_version_string(LPCWSTR verStr, PDWORD ms, PDWORD ls)
* Returns ERROR_SUCCESS upon success (where not finding the record counts as * Returns ERROR_SUCCESS upon success (where not finding the record counts as
* success), something else on error. * success), something else on error.
*/ */
static UINT get_signature( MSIPACKAGE *package, MSISIGNATURE *sig, const WCHAR *name ) static UINT get_signature( MSIPACKAGE *package, struct signature *sig, const WCHAR *name )
{ {
WCHAR *minVersion, *maxVersion, *p; WCHAR *minVersion, *maxVersion, *p;
MSIRECORD *row; MSIRECORD *row;
...@@ -148,13 +148,13 @@ static UINT get_signature( MSIPACKAGE *package, MSISIGNATURE *sig, const WCHAR * ...@@ -148,13 +148,13 @@ static UINT get_signature( MSIPACKAGE *package, MSISIGNATURE *sig, const WCHAR *
} }
/* Frees any memory allocated in sig */ /* Frees any memory allocated in sig */
static void free_signature( MSISIGNATURE *sig ) static void free_signature( struct signature *sig )
{ {
free(sig->File); free(sig->File);
free(sig->Languages); free(sig->Languages);
} }
static WCHAR *search_file( MSIPACKAGE *package, WCHAR *path, MSISIGNATURE *sig ) static WCHAR *search_file( MSIPACKAGE *package, WCHAR *path, struct signature *sig )
{ {
VS_FIXEDFILEINFO *info; VS_FIXEDFILEINFO *info;
DWORD attr; DWORD attr;
...@@ -220,7 +220,7 @@ done: ...@@ -220,7 +220,7 @@ done:
return val; return val;
} }
static UINT search_components( MSIPACKAGE *package, WCHAR **appValue, MSISIGNATURE *sig ) static UINT search_components( MSIPACKAGE *package, WCHAR **appValue, struct signature *sig )
{ {
MSIRECORD *row, *rec; MSIRECORD *row, *rec;
LPCWSTR signature, guid; LPCWSTR signature, guid;
...@@ -341,9 +341,9 @@ static void convert_reg_value( DWORD regType, const BYTE *value, DWORD sz, WCHAR ...@@ -341,9 +341,9 @@ static void convert_reg_value( DWORD regType, const BYTE *value, DWORD sz, WCHAR
} }
} }
static UINT search_directory( MSIPACKAGE *, MSISIGNATURE *, const WCHAR *, int, WCHAR ** ); static UINT search_directory( MSIPACKAGE *, struct signature *, const WCHAR *, int, WCHAR ** );
static UINT search_reg( MSIPACKAGE *package, WCHAR **appValue, MSISIGNATURE *sig ) static UINT search_reg( MSIPACKAGE *package, WCHAR **appValue, struct signature *sig )
{ {
const WCHAR *keyPath, *valueName; const WCHAR *keyPath, *valueName;
WCHAR *deformatted = NULL, *ptr = NULL, *end; WCHAR *deformatted = NULL, *ptr = NULL, *end;
...@@ -494,7 +494,7 @@ static LPWSTR get_ini_field(LPWSTR buf, int field) ...@@ -494,7 +494,7 @@ static LPWSTR get_ini_field(LPWSTR buf, int field)
return wcsdup(beg); return wcsdup(beg);
} }
static UINT search_ini( MSIPACKAGE *package, WCHAR **appValue, MSISIGNATURE *sig ) static UINT search_ini( MSIPACKAGE *package, WCHAR **appValue, struct signature *sig )
{ {
MSIRECORD *row; MSIRECORD *row;
LPWSTR fileName, section, key; LPWSTR fileName, section, key;
...@@ -652,7 +652,7 @@ done: ...@@ -652,7 +652,7 @@ done:
* Return ERROR_SUCCESS in case of success (whether or not the file matches), * Return ERROR_SUCCESS in case of success (whether or not the file matches),
* something else if an install-halting error occurs. * something else if an install-halting error occurs.
*/ */
static UINT file_version_matches( MSIPACKAGE *package, const MSISIGNATURE *sig, const WCHAR *filePath, static UINT file_version_matches( MSIPACKAGE *package, const struct signature *sig, const WCHAR *filePath,
BOOL *matches ) BOOL *matches )
{ {
UINT len; UINT len;
...@@ -712,7 +712,7 @@ static UINT file_version_matches( MSIPACKAGE *package, const MSISIGNATURE *sig, ...@@ -712,7 +712,7 @@ static UINT file_version_matches( MSIPACKAGE *package, const MSISIGNATURE *sig,
* Return ERROR_SUCCESS in case of success (whether or not the file matches), * Return ERROR_SUCCESS in case of success (whether or not the file matches),
* something else if an install-halting error occurs. * something else if an install-halting error occurs.
*/ */
static UINT file_matches_sig( MSIPACKAGE *package, const MSISIGNATURE *sig, const WIN32_FIND_DATAW *findData, static UINT file_matches_sig( MSIPACKAGE *package, const struct signature *sig, const WIN32_FIND_DATAW *findData,
const WCHAR *fullFilePath, BOOL *matches ) const WCHAR *fullFilePath, BOOL *matches )
{ {
UINT rc = ERROR_SUCCESS; UINT rc = ERROR_SUCCESS;
...@@ -757,7 +757,7 @@ static UINT file_matches_sig( MSIPACKAGE *package, const MSISIGNATURE *sig, cons ...@@ -757,7 +757,7 @@ static UINT file_matches_sig( MSIPACKAGE *package, const MSISIGNATURE *sig, cons
* Returns ERROR_SUCCESS on success (which may include non-critical errors), * Returns ERROR_SUCCESS on success (which may include non-critical errors),
* something else on failures which should halt the install. * something else on failures which should halt the install.
*/ */
static UINT recurse_search_directory( MSIPACKAGE *package, WCHAR **appValue, MSISIGNATURE *sig, const WCHAR *dir, static UINT recurse_search_directory( MSIPACKAGE *package, WCHAR **appValue, struct signature *sig, const WCHAR *dir,
int depth ) int depth )
{ {
HANDLE hFind; HANDLE hFind;
...@@ -871,7 +871,7 @@ static BOOL is_full_path( const WCHAR *path ) ...@@ -871,7 +871,7 @@ static BOOL is_full_path( const WCHAR *path )
return ret; return ret;
} }
static UINT search_directory( MSIPACKAGE *package, MSISIGNATURE *sig, const WCHAR *path, int depth, WCHAR **appValue ) static UINT search_directory( MSIPACKAGE *package, struct signature *sig, const WCHAR *path, int depth, WCHAR **appValue )
{ {
UINT rc; UINT rc;
DWORD attr; DWORD attr;
...@@ -940,9 +940,9 @@ static UINT search_directory( MSIPACKAGE *package, MSISIGNATURE *sig, const WCHA ...@@ -940,9 +940,9 @@ static UINT search_directory( MSIPACKAGE *package, MSISIGNATURE *sig, const WCHA
return rc; return rc;
} }
static UINT search_sig_name( MSIPACKAGE *, const WCHAR *, MSISIGNATURE *, WCHAR ** ); static UINT search_sig_name( MSIPACKAGE *, const WCHAR *, struct signature *, WCHAR ** );
static UINT search_dr( MSIPACKAGE *package, WCHAR **appValue, MSISIGNATURE *sig ) static UINT search_dr( MSIPACKAGE *package, WCHAR **appValue, struct signature *sig )
{ {
LPWSTR parent = NULL; LPWSTR parent = NULL;
LPCWSTR parentName; LPCWSTR parentName;
...@@ -968,7 +968,7 @@ static UINT search_dr( MSIPACKAGE *package, WCHAR **appValue, MSISIGNATURE *sig ...@@ -968,7 +968,7 @@ static UINT search_dr( MSIPACKAGE *package, WCHAR **appValue, MSISIGNATURE *sig
parentName = MSI_RecordGetString(row, 2); parentName = MSI_RecordGetString(row, 2);
if (parentName) if (parentName)
{ {
MSISIGNATURE parentSig; struct signature parentSig;
search_sig_name( package, parentName, &parentSig, &parent ); search_sig_name( package, parentName, &parentSig, &parent );
free_signature( &parentSig ); free_signature( &parentSig );
...@@ -1017,7 +1017,7 @@ static UINT search_dr( MSIPACKAGE *package, WCHAR **appValue, MSISIGNATURE *sig ...@@ -1017,7 +1017,7 @@ static UINT search_dr( MSIPACKAGE *package, WCHAR **appValue, MSISIGNATURE *sig
return rc; return rc;
} }
static UINT search_sig_name( MSIPACKAGE *package, const WCHAR *sigName, MSISIGNATURE *sig, WCHAR **appValue ) static UINT search_sig_name( MSIPACKAGE *package, const WCHAR *sigName, struct signature *sig, WCHAR **appValue )
{ {
UINT rc; UINT rc;
...@@ -1045,7 +1045,7 @@ static UINT ITERATE_AppSearch(MSIRECORD *row, LPVOID param) ...@@ -1045,7 +1045,7 @@ static UINT ITERATE_AppSearch(MSIRECORD *row, LPVOID param)
MSIPACKAGE *package = param; MSIPACKAGE *package = param;
LPCWSTR propName, sigName; LPCWSTR propName, sigName;
LPWSTR value = NULL; LPWSTR value = NULL;
MSISIGNATURE sig; struct signature sig;
MSIRECORD *uirow; MSIRECORD *uirow;
UINT r; UINT r;
...@@ -1102,7 +1102,7 @@ static UINT ITERATE_CCPSearch(MSIRECORD *row, LPVOID param) ...@@ -1102,7 +1102,7 @@ static UINT ITERATE_CCPSearch(MSIRECORD *row, LPVOID param)
MSIPACKAGE *package = param; MSIPACKAGE *package = param;
LPCWSTR signature; LPCWSTR signature;
LPWSTR value = NULL; LPWSTR value = NULL;
MSISIGNATURE sig; struct signature sig;
UINT r = ERROR_SUCCESS; UINT r = ERROR_SUCCESS;
signature = MSI_RecordGetString(row, 1); signature = MSI_RecordGetString(row, 1);
......
...@@ -38,7 +38,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(msidb); ...@@ -38,7 +38,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(msidb);
/* below is the query interface to a table */ /* below is the query interface to a table */
typedef struct tagMSICREATEVIEW struct create_view
{ {
MSIVIEW view; MSIVIEW view;
MSIDATABASE *db; MSIDATABASE *db;
...@@ -46,11 +46,11 @@ typedef struct tagMSICREATEVIEW ...@@ -46,11 +46,11 @@ typedef struct tagMSICREATEVIEW
BOOL bIsTemp; BOOL bIsTemp;
BOOL hold; BOOL hold;
column_info *col_info; column_info *col_info;
} MSICREATEVIEW; };
static UINT CREATE_fetch_int( struct tagMSIVIEW *view, UINT row, UINT col, UINT *val ) static UINT CREATE_fetch_int( struct tagMSIVIEW *view, UINT row, UINT col, UINT *val )
{ {
MSICREATEVIEW *cv = (MSICREATEVIEW*)view; struct create_view *cv = (struct create_view *)view;
TRACE("%p %d %d %p\n", cv, row, col, val ); TRACE("%p %d %d %p\n", cv, row, col, val );
...@@ -59,7 +59,7 @@ static UINT CREATE_fetch_int( struct tagMSIVIEW *view, UINT row, UINT col, UINT ...@@ -59,7 +59,7 @@ static UINT CREATE_fetch_int( struct tagMSIVIEW *view, UINT row, UINT col, UINT
static UINT CREATE_execute( struct tagMSIVIEW *view, MSIRECORD *record ) static UINT CREATE_execute( struct tagMSIVIEW *view, MSIRECORD *record )
{ {
MSICREATEVIEW *cv = (MSICREATEVIEW*)view; struct create_view *cv = (struct create_view *)view;
BOOL persist = (cv->bIsTemp) ? MSICONDITION_FALSE : MSICONDITION_TRUE; BOOL persist = (cv->bIsTemp) ? MSICONDITION_FALSE : MSICONDITION_TRUE;
TRACE("%p Table %s (%s)\n", cv, debugstr_w(cv->name), TRACE("%p Table %s (%s)\n", cv, debugstr_w(cv->name),
...@@ -73,7 +73,7 @@ static UINT CREATE_execute( struct tagMSIVIEW *view, MSIRECORD *record ) ...@@ -73,7 +73,7 @@ static UINT CREATE_execute( struct tagMSIVIEW *view, MSIRECORD *record )
static UINT CREATE_close( struct tagMSIVIEW *view ) static UINT CREATE_close( struct tagMSIVIEW *view )
{ {
MSICREATEVIEW *cv = (MSICREATEVIEW*)view; struct create_view *cv = (struct create_view *)view;
TRACE("%p\n", cv); TRACE("%p\n", cv);
...@@ -82,7 +82,7 @@ static UINT CREATE_close( struct tagMSIVIEW *view ) ...@@ -82,7 +82,7 @@ static UINT CREATE_close( struct tagMSIVIEW *view )
static UINT CREATE_get_dimensions( struct tagMSIVIEW *view, UINT *rows, UINT *cols ) static UINT CREATE_get_dimensions( struct tagMSIVIEW *view, UINT *rows, UINT *cols )
{ {
MSICREATEVIEW *cv = (MSICREATEVIEW*)view; struct create_view *cv = (struct create_view *)view;
TRACE("%p %p %p\n", cv, rows, cols ); TRACE("%p %p %p\n", cv, rows, cols );
...@@ -92,7 +92,7 @@ static UINT CREATE_get_dimensions( struct tagMSIVIEW *view, UINT *rows, UINT *co ...@@ -92,7 +92,7 @@ static UINT CREATE_get_dimensions( struct tagMSIVIEW *view, UINT *rows, UINT *co
static UINT CREATE_get_column_info( struct tagMSIVIEW *view, UINT n, LPCWSTR *name, static UINT CREATE_get_column_info( struct tagMSIVIEW *view, UINT n, LPCWSTR *name,
UINT *type, BOOL *temporary, LPCWSTR *table_name ) UINT *type, BOOL *temporary, LPCWSTR *table_name )
{ {
MSICREATEVIEW *cv = (MSICREATEVIEW*)view; struct create_view *cv = (struct create_view *)view;
TRACE("%p %d %p %p %p %p\n", cv, n, name, type, temporary, table_name ); TRACE("%p %d %p %p %p %p\n", cv, n, name, type, temporary, table_name );
...@@ -102,7 +102,7 @@ static UINT CREATE_get_column_info( struct tagMSIVIEW *view, UINT n, LPCWSTR *na ...@@ -102,7 +102,7 @@ static UINT CREATE_get_column_info( struct tagMSIVIEW *view, UINT n, LPCWSTR *na
static UINT CREATE_modify( struct tagMSIVIEW *view, MSIMODIFY eModifyMode, static UINT CREATE_modify( struct tagMSIVIEW *view, MSIMODIFY eModifyMode,
MSIRECORD *rec, UINT row) MSIRECORD *rec, UINT row)
{ {
MSICREATEVIEW *cv = (MSICREATEVIEW*)view; struct create_view *cv = (struct create_view *)view;
TRACE("%p %d %p\n", cv, eModifyMode, rec ); TRACE("%p %d %p\n", cv, eModifyMode, rec );
...@@ -111,7 +111,7 @@ static UINT CREATE_modify( struct tagMSIVIEW *view, MSIMODIFY eModifyMode, ...@@ -111,7 +111,7 @@ static UINT CREATE_modify( struct tagMSIVIEW *view, MSIMODIFY eModifyMode,
static UINT CREATE_delete( struct tagMSIVIEW *view ) static UINT CREATE_delete( struct tagMSIVIEW *view )
{ {
MSICREATEVIEW *cv = (MSICREATEVIEW*)view; struct create_view *cv = (struct create_view *)view;
TRACE("%p\n", cv ); TRACE("%p\n", cv );
...@@ -160,7 +160,7 @@ static UINT check_columns( const column_info *col_info ) ...@@ -160,7 +160,7 @@ static UINT check_columns( const column_info *col_info )
UINT CREATE_CreateView( MSIDATABASE *db, MSIVIEW **view, LPCWSTR table, UINT CREATE_CreateView( MSIDATABASE *db, MSIVIEW **view, LPCWSTR table,
column_info *col_info, BOOL hold ) column_info *col_info, BOOL hold )
{ {
MSICREATEVIEW *cv = NULL; struct create_view *cv = NULL;
UINT r; UINT r;
column_info *col; column_info *col;
BOOL temp = TRUE; BOOL temp = TRUE;
......
...@@ -43,13 +43,13 @@ WINE_DEFAULT_DEBUG_CHANNEL(msi); ...@@ -43,13 +43,13 @@ WINE_DEFAULT_DEBUG_CHANNEL(msi);
#define CUSTOM_ACTION_TYPE_MASK 0x3F #define CUSTOM_ACTION_TYPE_MASK 0x3F
typedef struct tagMSIRUNNINGACTION struct running_action
{ {
struct list entry; struct list entry;
HANDLE handle; HANDLE handle;
BOOL process; BOOL process;
LPWSTR name; LPWSTR name;
} MSIRUNNINGACTION; };
typedef UINT (WINAPI *MsiCustomActionEntryPoint)( MSIHANDLE ); typedef UINT (WINAPI *MsiCustomActionEntryPoint)( MSIHANDLE );
...@@ -298,9 +298,9 @@ static MSIBINARY *get_temp_binary(MSIPACKAGE *package, LPCWSTR source) ...@@ -298,9 +298,9 @@ static MSIBINARY *get_temp_binary(MSIPACKAGE *package, LPCWSTR source)
static void file_running_action(MSIPACKAGE* package, HANDLE Handle, static void file_running_action(MSIPACKAGE* package, HANDLE Handle,
BOOL process, LPCWSTR name) BOOL process, LPCWSTR name)
{ {
MSIRUNNINGACTION *action; struct running_action *action;
action = malloc( sizeof(MSIRUNNINGACTION) ); action = malloc( sizeof(*action) );
action->handle = Handle; action->handle = Handle;
action->process = process; action->process = process;
...@@ -1563,7 +1563,7 @@ void ACTION_FinishCustomActions(const MSIPACKAGE* package) ...@@ -1563,7 +1563,7 @@ void ACTION_FinishCustomActions(const MSIPACKAGE* package)
while ((item = list_head( &package->RunningActions ))) while ((item = list_head( &package->RunningActions )))
{ {
MSIRUNNINGACTION *action = LIST_ENTRY( item, MSIRUNNINGACTION, entry ); struct running_action *action = LIST_ENTRY( item, struct running_action, entry );
list_remove( &action->entry ); list_remove( &action->entry );
......
...@@ -1206,7 +1206,7 @@ UINT WINAPI MsiDatabaseMergeA( MSIHANDLE hDatabase, MSIHANDLE hDatabaseMerge, co ...@@ -1206,7 +1206,7 @@ UINT WINAPI MsiDatabaseMergeA( MSIHANDLE hDatabase, MSIHANDLE hDatabaseMerge, co
return r; return r;
} }
typedef struct _tagMERGETABLE struct merge_table
{ {
struct list entry; struct list entry;
struct list rows; struct list rows;
...@@ -1218,22 +1218,22 @@ typedef struct _tagMERGETABLE ...@@ -1218,22 +1218,22 @@ typedef struct _tagMERGETABLE
DWORD numtypes; DWORD numtypes;
LPWSTR *labels; LPWSTR *labels;
DWORD numlabels; DWORD numlabels;
} MERGETABLE; };
typedef struct _tagMERGEROW struct merge_row
{ {
struct list entry; struct list entry;
MSIRECORD *data; MSIRECORD *data;
} MERGEROW; };
typedef struct _tagMERGEDATA struct merge_data
{ {
MSIDATABASE *db; MSIDATABASE *db;
MSIDATABASE *merge; MSIDATABASE *merge;
MERGETABLE *curtable; struct merge_table *curtable;
MSIQUERY *curview; MSIQUERY *curview;
struct list *tabledata; struct list *tabledata;
} MERGEDATA; };
static BOOL merge_type_match(LPCWSTR type1, LPCWSTR type2) static BOOL merge_type_match(LPCWSTR type1, LPCWSTR type2)
{ {
...@@ -1462,9 +1462,9 @@ done: ...@@ -1462,9 +1462,9 @@ done:
static UINT merge_diff_row(MSIRECORD *rec, LPVOID param) static UINT merge_diff_row(MSIRECORD *rec, LPVOID param)
{ {
MERGEDATA *data = param; struct merge_data *data = param;
MERGETABLE *table = data->curtable; struct merge_table *table = data->curtable;
MERGEROW *mergerow; struct merge_row *mergerow;
MSIQUERY *dbview = NULL; MSIQUERY *dbview = NULL;
MSIRECORD *row = NULL; MSIRECORD *row = NULL;
LPWSTR query = NULL; LPWSTR query = NULL;
...@@ -1496,7 +1496,7 @@ static UINT merge_diff_row(MSIRECORD *rec, LPVOID param) ...@@ -1496,7 +1496,7 @@ static UINT merge_diff_row(MSIRECORD *rec, LPVOID param)
r = ERROR_SUCCESS; r = ERROR_SUCCESS;
} }
mergerow = malloc(sizeof(MERGEROW)); mergerow = malloc(sizeof(*mergerow));
if (!mergerow) if (!mergerow)
{ {
r = ERROR_OUTOFMEMORY; r = ERROR_OUTOFMEMORY;
...@@ -1606,13 +1606,13 @@ end: ...@@ -1606,13 +1606,13 @@ end:
return r; return r;
} }
static void merge_free_rows(MERGETABLE *table) static void merge_free_rows(struct merge_table *table)
{ {
struct list *item, *cursor; struct list *item, *cursor;
LIST_FOR_EACH_SAFE(item, cursor, &table->rows) LIST_FOR_EACH_SAFE(item, cursor, &table->rows)
{ {
MERGEROW *row = LIST_ENTRY(item, MERGEROW, entry); struct merge_row *row = LIST_ENTRY(item, struct merge_row, entry);
list_remove(&row->entry); list_remove(&row->entry);
msiobj_release(&row->data->hdr); msiobj_release(&row->data->hdr);
...@@ -1620,7 +1620,7 @@ static void merge_free_rows(MERGETABLE *table) ...@@ -1620,7 +1620,7 @@ static void merge_free_rows(MERGETABLE *table)
} }
} }
static void free_merge_table(MERGETABLE *table) static void free_merge_table(struct merge_table *table)
{ {
UINT i; UINT i;
...@@ -1654,13 +1654,13 @@ static void free_merge_table(MERGETABLE *table) ...@@ -1654,13 +1654,13 @@ static void free_merge_table(MERGETABLE *table)
free(table); free(table);
} }
static UINT get_merge_table(MSIDATABASE *db, const WCHAR *name, MERGETABLE **ptable) static UINT get_merge_table(MSIDATABASE *db, const WCHAR *name, struct merge_table **ptable)
{ {
UINT r; UINT r;
MERGETABLE *table; struct merge_table *table;
MSIQUERY *mergeview = NULL; MSIQUERY *mergeview = NULL;
table = calloc(1, sizeof(MERGETABLE)); table = calloc(1, sizeof(*table));
if (!table) if (!table)
{ {
*ptable = NULL; *ptable = NULL;
...@@ -1701,8 +1701,8 @@ err: ...@@ -1701,8 +1701,8 @@ err:
static UINT merge_diff_tables(MSIRECORD *rec, LPVOID param) static UINT merge_diff_tables(MSIRECORD *rec, LPVOID param)
{ {
MERGEDATA *data = param; struct merge_data *data = param;
MERGETABLE *table; struct merge_table *table;
MSIQUERY *dbview = NULL; MSIQUERY *dbview = NULL;
MSIQUERY *mergeview = NULL; MSIQUERY *mergeview = NULL;
LPCWSTR name; LPCWSTR name;
...@@ -1754,7 +1754,7 @@ static UINT gather_merge_data(MSIDATABASE *db, MSIDATABASE *merge, ...@@ -1754,7 +1754,7 @@ static UINT gather_merge_data(MSIDATABASE *db, MSIDATABASE *merge,
struct list *tabledata) struct list *tabledata)
{ {
MSIQUERY *view; MSIQUERY *view;
MERGEDATA data; struct merge_data data;
UINT r; UINT r;
r = MSI_DatabaseOpenViewW(merge, L"SELECT * FROM `_Tables`", &view); r = MSI_DatabaseOpenViewW(merge, L"SELECT * FROM `_Tables`", &view);
...@@ -1769,10 +1769,10 @@ static UINT gather_merge_data(MSIDATABASE *db, MSIDATABASE *merge, ...@@ -1769,10 +1769,10 @@ static UINT gather_merge_data(MSIDATABASE *db, MSIDATABASE *merge,
return r; return r;
} }
static UINT merge_table(MSIDATABASE *db, MERGETABLE *table) static UINT merge_table(MSIDATABASE *db, struct merge_table *table)
{ {
UINT r; UINT r;
MERGEROW *row; struct merge_row *row;
MSIVIEW *tv; MSIVIEW *tv;
if (!TABLE_Exists(db, table->name)) if (!TABLE_Exists(db, table->name))
...@@ -1782,7 +1782,7 @@ static UINT merge_table(MSIDATABASE *db, MERGETABLE *table) ...@@ -1782,7 +1782,7 @@ static UINT merge_table(MSIDATABASE *db, MERGETABLE *table)
return ERROR_FUNCTION_FAILED; return ERROR_FUNCTION_FAILED;
} }
LIST_FOR_EACH_ENTRY(row, &table->rows, MERGEROW, entry) LIST_FOR_EACH_ENTRY(row, &table->rows, struct merge_row, entry)
{ {
r = TABLE_CreateView(db, table->name, &tv); r = TABLE_CreateView(db, table->name, &tv);
if (r != ERROR_SUCCESS) if (r != ERROR_SUCCESS)
...@@ -1832,7 +1832,7 @@ UINT WINAPI MsiDatabaseMergeW( MSIHANDLE hDatabase, MSIHANDLE hDatabaseMerge, co ...@@ -1832,7 +1832,7 @@ UINT WINAPI MsiDatabaseMergeW( MSIHANDLE hDatabase, MSIHANDLE hDatabaseMerge, co
struct list tabledata = LIST_INIT(tabledata); struct list tabledata = LIST_INIT(tabledata);
struct list *item, *cursor; struct list *item, *cursor;
MSIDATABASE *db, *merge; MSIDATABASE *db, *merge;
MERGETABLE *table; struct merge_table *table;
BOOL conflicts; BOOL conflicts;
UINT r; UINT r;
...@@ -1854,7 +1854,7 @@ UINT WINAPI MsiDatabaseMergeW( MSIHANDLE hDatabase, MSIHANDLE hDatabaseMerge, co ...@@ -1854,7 +1854,7 @@ UINT WINAPI MsiDatabaseMergeW( MSIHANDLE hDatabase, MSIHANDLE hDatabaseMerge, co
goto done; goto done;
conflicts = FALSE; conflicts = FALSE;
LIST_FOR_EACH_ENTRY(table, &tabledata, MERGETABLE, entry) LIST_FOR_EACH_ENTRY(table, &tabledata, struct merge_table, entry)
{ {
if (table->numconflicts) if (table->numconflicts)
{ {
...@@ -1875,7 +1875,7 @@ UINT WINAPI MsiDatabaseMergeW( MSIHANDLE hDatabase, MSIHANDLE hDatabaseMerge, co ...@@ -1875,7 +1875,7 @@ UINT WINAPI MsiDatabaseMergeW( MSIHANDLE hDatabase, MSIHANDLE hDatabaseMerge, co
LIST_FOR_EACH_SAFE(item, cursor, &tabledata) LIST_FOR_EACH_SAFE(item, cursor, &tabledata)
{ {
MERGETABLE *table = LIST_ENTRY(item, MERGETABLE, entry); struct merge_table *table = LIST_ENTRY(item, struct merge_table, entry);
list_remove(&table->entry); list_remove(&table->entry);
free_merge_table(table); free_merge_table(table);
} }
......
...@@ -48,16 +48,16 @@ WINE_DEFAULT_DEBUG_CHANNEL(msidb); ...@@ -48,16 +48,16 @@ WINE_DEFAULT_DEBUG_CHANNEL(msidb);
* that's a bug in the way I'm running the query, or a just a bug. * that's a bug in the way I'm running the query, or a just a bug.
*/ */
typedef struct tagMSIDELETEVIEW struct delete_view
{ {
MSIVIEW view; MSIVIEW view;
MSIDATABASE *db; MSIDATABASE *db;
MSIVIEW *table; MSIVIEW *table;
} MSIDELETEVIEW; };
static UINT DELETE_fetch_int( struct tagMSIVIEW *view, UINT row, UINT col, UINT *val ) static UINT DELETE_fetch_int( struct tagMSIVIEW *view, UINT row, UINT col, UINT *val )
{ {
MSIDELETEVIEW *dv = (MSIDELETEVIEW*)view; struct delete_view *dv = (struct delete_view *)view;
TRACE("%p %d %d %p\n", dv, row, col, val ); TRACE("%p %d %d %p\n", dv, row, col, val );
...@@ -66,7 +66,7 @@ static UINT DELETE_fetch_int( struct tagMSIVIEW *view, UINT row, UINT col, UINT ...@@ -66,7 +66,7 @@ static UINT DELETE_fetch_int( struct tagMSIVIEW *view, UINT row, UINT col, UINT
static UINT DELETE_fetch_stream( struct tagMSIVIEW *view, UINT row, UINT col, IStream **stm) static UINT DELETE_fetch_stream( struct tagMSIVIEW *view, UINT row, UINT col, IStream **stm)
{ {
MSIDELETEVIEW *dv = (MSIDELETEVIEW*)view; struct delete_view *dv = (struct delete_view *)view;
TRACE("%p %d %d %p\n", dv, row, col, stm ); TRACE("%p %d %d %p\n", dv, row, col, stm );
...@@ -75,7 +75,7 @@ static UINT DELETE_fetch_stream( struct tagMSIVIEW *view, UINT row, UINT col, IS ...@@ -75,7 +75,7 @@ static UINT DELETE_fetch_stream( struct tagMSIVIEW *view, UINT row, UINT col, IS
static UINT DELETE_execute( struct tagMSIVIEW *view, MSIRECORD *record ) static UINT DELETE_execute( struct tagMSIVIEW *view, MSIRECORD *record )
{ {
MSIDELETEVIEW *dv = (MSIDELETEVIEW*)view; struct delete_view *dv = (struct delete_view *)view;
UINT r, i, rows = 0, cols = 0; UINT r, i, rows = 0, cols = 0;
TRACE("%p %p\n", dv, record); TRACE("%p %p\n", dv, record);
...@@ -102,7 +102,7 @@ static UINT DELETE_execute( struct tagMSIVIEW *view, MSIRECORD *record ) ...@@ -102,7 +102,7 @@ static UINT DELETE_execute( struct tagMSIVIEW *view, MSIRECORD *record )
static UINT DELETE_close( struct tagMSIVIEW *view ) static UINT DELETE_close( struct tagMSIVIEW *view )
{ {
MSIDELETEVIEW *dv = (MSIDELETEVIEW*)view; struct delete_view *dv = (struct delete_view *)view;
TRACE("%p\n", dv ); TRACE("%p\n", dv );
...@@ -114,7 +114,7 @@ static UINT DELETE_close( struct tagMSIVIEW *view ) ...@@ -114,7 +114,7 @@ static UINT DELETE_close( struct tagMSIVIEW *view )
static UINT DELETE_get_dimensions( struct tagMSIVIEW *view, UINT *rows, UINT *cols ) static UINT DELETE_get_dimensions( struct tagMSIVIEW *view, UINT *rows, UINT *cols )
{ {
MSIDELETEVIEW *dv = (MSIDELETEVIEW*)view; struct delete_view *dv = (struct delete_view *)view;
TRACE("%p %p %p\n", dv, rows, cols ); TRACE("%p %p %p\n", dv, rows, cols );
...@@ -129,7 +129,7 @@ static UINT DELETE_get_dimensions( struct tagMSIVIEW *view, UINT *rows, UINT *co ...@@ -129,7 +129,7 @@ static UINT DELETE_get_dimensions( struct tagMSIVIEW *view, UINT *rows, UINT *co
static UINT DELETE_get_column_info( struct tagMSIVIEW *view, UINT n, LPCWSTR *name, static UINT DELETE_get_column_info( struct tagMSIVIEW *view, UINT n, LPCWSTR *name,
UINT *type, BOOL *temporary, LPCWSTR *table_name ) UINT *type, BOOL *temporary, LPCWSTR *table_name )
{ {
MSIDELETEVIEW *dv = (MSIDELETEVIEW*)view; struct delete_view *dv = (struct delete_view *)view;
TRACE("%p %d %p %p %p %p\n", dv, n, name, type, temporary, table_name ); TRACE("%p %d %p %p %p %p\n", dv, n, name, type, temporary, table_name );
...@@ -143,7 +143,7 @@ static UINT DELETE_get_column_info( struct tagMSIVIEW *view, UINT n, LPCWSTR *na ...@@ -143,7 +143,7 @@ static UINT DELETE_get_column_info( struct tagMSIVIEW *view, UINT n, LPCWSTR *na
static UINT DELETE_modify( struct tagMSIVIEW *view, MSIMODIFY eModifyMode, static UINT DELETE_modify( struct tagMSIVIEW *view, MSIMODIFY eModifyMode,
MSIRECORD *rec, UINT row ) MSIRECORD *rec, UINT row )
{ {
MSIDELETEVIEW *dv = (MSIDELETEVIEW*)view; struct delete_view *dv = (struct delete_view *)view;
TRACE("%p %d %p\n", dv, eModifyMode, rec ); TRACE("%p %d %p\n", dv, eModifyMode, rec );
...@@ -152,7 +152,7 @@ static UINT DELETE_modify( struct tagMSIVIEW *view, MSIMODIFY eModifyMode, ...@@ -152,7 +152,7 @@ static UINT DELETE_modify( struct tagMSIVIEW *view, MSIMODIFY eModifyMode,
static UINT DELETE_delete( struct tagMSIVIEW *view ) static UINT DELETE_delete( struct tagMSIVIEW *view )
{ {
MSIDELETEVIEW *dv = (MSIDELETEVIEW*)view; struct delete_view *dv = (struct delete_view *)view;
TRACE("%p\n", dv ); TRACE("%p\n", dv );
...@@ -189,7 +189,7 @@ static const MSIVIEWOPS delete_ops = ...@@ -189,7 +189,7 @@ static const MSIVIEWOPS delete_ops =
UINT DELETE_CreateView( MSIDATABASE *db, MSIVIEW **view, MSIVIEW *table ) UINT DELETE_CreateView( MSIDATABASE *db, MSIVIEW **view, MSIVIEW *table )
{ {
MSIDELETEVIEW *dv = NULL; struct delete_view *dv = NULL;
TRACE("%p\n", dv ); TRACE("%p\n", dv );
......
...@@ -35,25 +35,25 @@ ...@@ -35,25 +35,25 @@
WINE_DEFAULT_DEBUG_CHANNEL(msidb); WINE_DEFAULT_DEBUG_CHANNEL(msidb);
typedef struct tagDISTINCTSET struct distinct_set
{ {
UINT val; UINT val;
UINT count; UINT count;
UINT row; UINT row;
struct tagDISTINCTSET *nextrow; struct distinct_set *nextrow;
struct tagDISTINCTSET *nextcol; struct distinct_set *nextcol;
} DISTINCTSET; };
typedef struct tagMSIDISTINCTVIEW struct distinct_view
{ {
MSIVIEW view; MSIVIEW view;
MSIDATABASE *db; MSIDATABASE *db;
MSIVIEW *table; MSIVIEW *table;
UINT row_count; UINT row_count;
UINT *translation; UINT *translation;
} MSIDISTINCTVIEW; };
static DISTINCTSET ** distinct_insert( DISTINCTSET **x, UINT val, UINT row ) static struct distinct_set **distinct_insert( struct distinct_set **x, UINT val, UINT row )
{ {
/* horrible O(n) find */ /* horrible O(n) find */
while( *x ) while( *x )
...@@ -67,7 +67,7 @@ static DISTINCTSET ** distinct_insert( DISTINCTSET **x, UINT val, UINT row ) ...@@ -67,7 +67,7 @@ static DISTINCTSET ** distinct_insert( DISTINCTSET **x, UINT val, UINT row )
} }
/* nothing found, so add one */ /* nothing found, so add one */
*x = malloc( sizeof(DISTINCTSET) ); *x = malloc( sizeof(**x) );
if( *x ) if( *x )
{ {
(*x)->val = val; (*x)->val = val;
...@@ -79,11 +79,11 @@ static DISTINCTSET ** distinct_insert( DISTINCTSET **x, UINT val, UINT row ) ...@@ -79,11 +79,11 @@ static DISTINCTSET ** distinct_insert( DISTINCTSET **x, UINT val, UINT row )
return x; return x;
} }
static void distinct_free( DISTINCTSET *x ) static void distinct_free( struct distinct_set *x )
{ {
while( x ) while( x )
{ {
DISTINCTSET *next = x->nextrow; struct distinct_set *next = x->nextrow;
distinct_free( x->nextcol ); distinct_free( x->nextcol );
free( x ); free( x );
x = next; x = next;
...@@ -92,7 +92,7 @@ static void distinct_free( DISTINCTSET *x ) ...@@ -92,7 +92,7 @@ static void distinct_free( DISTINCTSET *x )
static UINT DISTINCT_fetch_int( struct tagMSIVIEW *view, UINT row, UINT col, UINT *val ) static UINT DISTINCT_fetch_int( struct tagMSIVIEW *view, UINT row, UINT col, UINT *val )
{ {
MSIDISTINCTVIEW *dv = (MSIDISTINCTVIEW*)view; struct distinct_view *dv = (struct distinct_view *)view;
TRACE("%p %d %d %p\n", dv, row, col, val ); TRACE("%p %d %d %p\n", dv, row, col, val );
...@@ -109,9 +109,9 @@ static UINT DISTINCT_fetch_int( struct tagMSIVIEW *view, UINT row, UINT col, UIN ...@@ -109,9 +109,9 @@ static UINT DISTINCT_fetch_int( struct tagMSIVIEW *view, UINT row, UINT col, UIN
static UINT DISTINCT_execute( struct tagMSIVIEW *view, MSIRECORD *record ) static UINT DISTINCT_execute( struct tagMSIVIEW *view, MSIRECORD *record )
{ {
MSIDISTINCTVIEW *dv = (MSIDISTINCTVIEW*)view; struct distinct_view *dv = (struct distinct_view *)view;
UINT r, i, j, r_count, c_count; UINT r, i, j, r_count, c_count;
DISTINCTSET *rowset = NULL; struct distinct_set *rowset = NULL;
TRACE("%p %p\n", dv, record); TRACE("%p %p\n", dv, record);
...@@ -133,7 +133,7 @@ static UINT DISTINCT_execute( struct tagMSIVIEW *view, MSIRECORD *record ) ...@@ -133,7 +133,7 @@ static UINT DISTINCT_execute( struct tagMSIVIEW *view, MSIRECORD *record )
/* build it */ /* build it */
for( i=0; i<r_count; i++ ) for( i=0; i<r_count; i++ )
{ {
DISTINCTSET **x = &rowset; struct distinct_set **x = &rowset;
for( j=1; j<=c_count; j++ ) for( j=1; j<=c_count; j++ )
{ {
...@@ -171,7 +171,7 @@ static UINT DISTINCT_execute( struct tagMSIVIEW *view, MSIRECORD *record ) ...@@ -171,7 +171,7 @@ static UINT DISTINCT_execute( struct tagMSIVIEW *view, MSIRECORD *record )
static UINT DISTINCT_close( struct tagMSIVIEW *view ) static UINT DISTINCT_close( struct tagMSIVIEW *view )
{ {
MSIDISTINCTVIEW *dv = (MSIDISTINCTVIEW*)view; struct distinct_view *dv = (struct distinct_view *)view;
TRACE("%p\n", dv ); TRACE("%p\n", dv );
...@@ -187,7 +187,7 @@ static UINT DISTINCT_close( struct tagMSIVIEW *view ) ...@@ -187,7 +187,7 @@ static UINT DISTINCT_close( struct tagMSIVIEW *view )
static UINT DISTINCT_get_dimensions( struct tagMSIVIEW *view, UINT *rows, UINT *cols ) static UINT DISTINCT_get_dimensions( struct tagMSIVIEW *view, UINT *rows, UINT *cols )
{ {
MSIDISTINCTVIEW *dv = (MSIDISTINCTVIEW*)view; struct distinct_view *dv = (struct distinct_view *)view;
TRACE("%p %p %p\n", dv, rows, cols ); TRACE("%p %p %p\n", dv, rows, cols );
...@@ -207,7 +207,7 @@ static UINT DISTINCT_get_dimensions( struct tagMSIVIEW *view, UINT *rows, UINT * ...@@ -207,7 +207,7 @@ static UINT DISTINCT_get_dimensions( struct tagMSIVIEW *view, UINT *rows, UINT *
static UINT DISTINCT_get_column_info( struct tagMSIVIEW *view, UINT n, LPCWSTR *name, static UINT DISTINCT_get_column_info( struct tagMSIVIEW *view, UINT n, LPCWSTR *name,
UINT *type, BOOL *temporary, LPCWSTR *table_name ) UINT *type, BOOL *temporary, LPCWSTR *table_name )
{ {
MSIDISTINCTVIEW *dv = (MSIDISTINCTVIEW*)view; struct distinct_view *dv = (struct distinct_view *)view;
TRACE("%p %d %p %p %p %p\n", dv, n, name, type, temporary, table_name ); TRACE("%p %d %p %p %p %p\n", dv, n, name, type, temporary, table_name );
...@@ -221,7 +221,7 @@ static UINT DISTINCT_get_column_info( struct tagMSIVIEW *view, UINT n, LPCWSTR * ...@@ -221,7 +221,7 @@ static UINT DISTINCT_get_column_info( struct tagMSIVIEW *view, UINT n, LPCWSTR *
static UINT DISTINCT_modify( struct tagMSIVIEW *view, MSIMODIFY eModifyMode, static UINT DISTINCT_modify( struct tagMSIVIEW *view, MSIMODIFY eModifyMode,
MSIRECORD *rec, UINT row ) MSIRECORD *rec, UINT row )
{ {
MSIDISTINCTVIEW *dv = (MSIDISTINCTVIEW*)view; struct distinct_view *dv = (struct distinct_view *)view;
TRACE("%p %d %p\n", dv, eModifyMode, rec ); TRACE("%p %d %p\n", dv, eModifyMode, rec );
...@@ -233,7 +233,7 @@ static UINT DISTINCT_modify( struct tagMSIVIEW *view, MSIMODIFY eModifyMode, ...@@ -233,7 +233,7 @@ static UINT DISTINCT_modify( struct tagMSIVIEW *view, MSIMODIFY eModifyMode,
static UINT DISTINCT_delete( struct tagMSIVIEW *view ) static UINT DISTINCT_delete( struct tagMSIVIEW *view )
{ {
MSIDISTINCTVIEW *dv = (MSIDISTINCTVIEW*)view; struct distinct_view *dv = (struct distinct_view *)view;
TRACE("%p\n", dv ); TRACE("%p\n", dv );
...@@ -272,7 +272,7 @@ static const MSIVIEWOPS distinct_ops = ...@@ -272,7 +272,7 @@ static const MSIVIEWOPS distinct_ops =
UINT DISTINCT_CreateView( MSIDATABASE *db, MSIVIEW **view, MSIVIEW *table ) UINT DISTINCT_CreateView( MSIDATABASE *db, MSIVIEW **view, MSIVIEW *table )
{ {
MSIDISTINCTVIEW *dv = NULL; struct distinct_view *dv = NULL;
UINT count = 0, r; UINT count = 0, r;
TRACE("%p\n", dv ); TRACE("%p\n", dv );
......
...@@ -34,18 +34,18 @@ ...@@ -34,18 +34,18 @@
WINE_DEFAULT_DEBUG_CHANNEL(msidb); WINE_DEFAULT_DEBUG_CHANNEL(msidb);
typedef struct tagMSIDROPVIEW struct drop_view
{ {
MSIVIEW view; MSIVIEW view;
MSIDATABASE *db; MSIDATABASE *db;
MSIVIEW *table; MSIVIEW *table;
column_info *colinfo; column_info *colinfo;
INT hold; INT hold;
} MSIDROPVIEW; };
static UINT DROP_execute(struct tagMSIVIEW *view, MSIRECORD *record) static UINT DROP_execute(struct tagMSIVIEW *view, MSIRECORD *record)
{ {
MSIDROPVIEW *dv = (MSIDROPVIEW*)view; struct drop_view *dv = (struct drop_view *)view;
UINT r; UINT r;
TRACE("%p %p\n", dv, record); TRACE("%p %p\n", dv, record);
...@@ -62,7 +62,7 @@ static UINT DROP_execute(struct tagMSIVIEW *view, MSIRECORD *record) ...@@ -62,7 +62,7 @@ static UINT DROP_execute(struct tagMSIVIEW *view, MSIRECORD *record)
static UINT DROP_close(struct tagMSIVIEW *view) static UINT DROP_close(struct tagMSIVIEW *view)
{ {
MSIDROPVIEW *dv = (MSIDROPVIEW*)view; struct drop_view *dv = (struct drop_view *)view;
TRACE("%p\n", dv); TRACE("%p\n", dv);
...@@ -71,7 +71,7 @@ static UINT DROP_close(struct tagMSIVIEW *view) ...@@ -71,7 +71,7 @@ static UINT DROP_close(struct tagMSIVIEW *view)
static UINT DROP_get_dimensions(struct tagMSIVIEW *view, UINT *rows, UINT *cols) static UINT DROP_get_dimensions(struct tagMSIVIEW *view, UINT *rows, UINT *cols)
{ {
MSIDROPVIEW *dv = (MSIDROPVIEW*)view; struct drop_view *dv = (struct drop_view *)view;
TRACE("%p %p %p\n", dv, rows, cols); TRACE("%p %p %p\n", dv, rows, cols);
...@@ -80,7 +80,7 @@ static UINT DROP_get_dimensions(struct tagMSIVIEW *view, UINT *rows, UINT *cols) ...@@ -80,7 +80,7 @@ static UINT DROP_get_dimensions(struct tagMSIVIEW *view, UINT *rows, UINT *cols)
static UINT DROP_delete( struct tagMSIVIEW *view ) static UINT DROP_delete( struct tagMSIVIEW *view )
{ {
MSIDROPVIEW *dv = (MSIDROPVIEW*)view; struct drop_view *dv = (struct drop_view *)view;
TRACE("%p\n", dv ); TRACE("%p\n", dv );
...@@ -117,7 +117,7 @@ static const MSIVIEWOPS drop_ops = ...@@ -117,7 +117,7 @@ static const MSIVIEWOPS drop_ops =
UINT DROP_CreateView(MSIDATABASE *db, MSIVIEW **view, LPCWSTR name) UINT DROP_CreateView(MSIDATABASE *db, MSIVIEW **view, LPCWSTR name)
{ {
MSIDROPVIEW *dv; struct drop_view *dv;
UINT r; UINT r;
TRACE("%p %s\n", view, debugstr_w(name)); TRACE("%p %s\n", view, debugstr_w(name));
......
...@@ -851,14 +851,14 @@ done: ...@@ -851,14 +851,14 @@ done:
#define is_dot_dir(x) ((x[0] == '.') && ((x[1] == 0) || ((x[1] == '.') && (x[2] == 0)))) #define is_dot_dir(x) ((x[0] == '.') && ((x[1] == 0) || ((x[1] == '.') && (x[2] == 0))))
typedef struct struct file_list
{ {
struct list entry; struct list entry;
LPWSTR sourcename; LPWSTR sourcename;
LPWSTR destname; LPWSTR destname;
LPWSTR source; LPWSTR source;
LPWSTR dest; LPWSTR dest;
} FILE_LIST; };
static BOOL move_file( MSIPACKAGE *package, const WCHAR *source, const WCHAR *dest, int options ) static BOOL move_file( MSIPACKAGE *package, const WCHAR *source, const WCHAR *dest, int options )
{ {
...@@ -913,31 +913,31 @@ static WCHAR *wildcard_to_file( const WCHAR *wildcard, const WCHAR *filename ) ...@@ -913,31 +913,31 @@ static WCHAR *wildcard_to_file( const WCHAR *wildcard, const WCHAR *filename )
return path; return path;
} }
static void free_file_entry(FILE_LIST *file) static void free_file_entry(struct file_list *file)
{ {
free(file->source); free(file->source);
free(file->dest); free(file->dest);
free(file); free(file);
} }
static void free_list(FILE_LIST *list) static void free_list(struct file_list *list)
{ {
while (!list_empty(&list->entry)) while (!list_empty(&list->entry))
{ {
FILE_LIST *file = LIST_ENTRY(list_head(&list->entry), FILE_LIST, entry); struct file_list *file = LIST_ENTRY(list_head(&list->entry), struct file_list, entry);
list_remove(&file->entry); list_remove(&file->entry);
free_file_entry(file); free_file_entry(file);
} }
} }
static BOOL add_wildcard( FILE_LIST *files, const WCHAR *source, WCHAR *dest ) static BOOL add_wildcard( struct file_list *files, const WCHAR *source, WCHAR *dest )
{ {
FILE_LIST *new, *file; struct file_list *new, *file;
WCHAR *ptr, *filename; WCHAR *ptr, *filename;
DWORD size; DWORD size;
new = calloc(1, sizeof(FILE_LIST)); new = calloc(1, sizeof(*new));
if (!new) if (!new)
return FALSE; return FALSE;
...@@ -969,7 +969,7 @@ static BOOL add_wildcard( FILE_LIST *files, const WCHAR *source, WCHAR *dest ) ...@@ -969,7 +969,7 @@ static BOOL add_wildcard( FILE_LIST *files, const WCHAR *source, WCHAR *dest )
return TRUE; return TRUE;
} }
LIST_FOR_EACH_ENTRY(file, &files->entry, FILE_LIST, entry) LIST_FOR_EACH_ENTRY(file, &files->entry, struct file_list, entry)
{ {
if (wcscmp( source, file->source ) < 0) if (wcscmp( source, file->source ) < 0)
{ {
...@@ -988,7 +988,7 @@ static BOOL move_files_wildcard( MSIPACKAGE *package, const WCHAR *source, WCHAR ...@@ -988,7 +988,7 @@ static BOOL move_files_wildcard( MSIPACKAGE *package, const WCHAR *source, WCHAR
HANDLE hfile; HANDLE hfile;
LPWSTR path; LPWSTR path;
BOOL res; BOOL res;
FILE_LIST files, *file; struct file_list files, *file;
DWORD size; DWORD size;
hfile = msi_find_first_file( package, source, &wfd ); hfile = msi_find_first_file( package, source, &wfd );
...@@ -1016,7 +1016,7 @@ static BOOL move_files_wildcard( MSIPACKAGE *package, const WCHAR *source, WCHAR ...@@ -1016,7 +1016,7 @@ static BOOL move_files_wildcard( MSIPACKAGE *package, const WCHAR *source, WCHAR
goto done; goto done;
/* only the first wildcard match gets renamed to dest */ /* only the first wildcard match gets renamed to dest */
file = LIST_ENTRY(list_head(&files.entry), FILE_LIST, entry); file = LIST_ENTRY(list_head(&files.entry), struct file_list, entry);
size = (wcsrchr(file->dest, '\\') - file->dest) + lstrlenW(file->destname) + 2; size = (wcsrchr(file->dest, '\\') - file->dest) + lstrlenW(file->destname) + 2;
file->dest = realloc(file->dest, size * sizeof(WCHAR)); file->dest = realloc(file->dest, size * sizeof(WCHAR));
if (!file->dest) if (!file->dest)
...@@ -1034,7 +1034,7 @@ static BOOL move_files_wildcard( MSIPACKAGE *package, const WCHAR *source, WCHAR ...@@ -1034,7 +1034,7 @@ static BOOL move_files_wildcard( MSIPACKAGE *package, const WCHAR *source, WCHAR
while (!list_empty(&files.entry)) while (!list_empty(&files.entry))
{ {
file = LIST_ENTRY(list_head(&files.entry), FILE_LIST, entry); file = LIST_ENTRY(list_head(&files.entry), struct file_list, entry);
move_file( package, file->source, file->dest, options ); move_file( package, file->source, file->dest, options );
......
...@@ -28,40 +28,43 @@ ...@@ -28,40 +28,43 @@
WINE_DEFAULT_DEBUG_CHANNEL(msi); WINE_DEFAULT_DEBUG_CHANNEL(msi);
typedef struct _tagTT_OFFSET_TABLE { struct offset_table
{
USHORT uMajorVersion; USHORT uMajorVersion;
USHORT uMinorVersion; USHORT uMinorVersion;
USHORT uNumOfTables; USHORT uNumOfTables;
USHORT uSearchRange; USHORT uSearchRange;
USHORT uEntrySelector; USHORT uEntrySelector;
USHORT uRangeShift; USHORT uRangeShift;
} TT_OFFSET_TABLE; };
typedef struct _tagTT_TABLE_DIRECTORY { struct table_directory
{
char szTag[4]; /* table name */ char szTag[4]; /* table name */
ULONG uCheckSum; /* Check sum */ ULONG uCheckSum; /* Check sum */
ULONG uOffset; /* Offset from beginning of file */ ULONG uOffset; /* Offset from beginning of file */
ULONG uLength; /* length of the table in bytes */ ULONG uLength; /* length of the table in bytes */
} TT_TABLE_DIRECTORY; };
typedef struct _tagTT_NAME_TABLE_HEADER { struct name_table_header
{
USHORT uFSelector; /* format selector. Always 0 */ USHORT uFSelector; /* format selector. Always 0 */
USHORT uNRCount; /* Name Records count */ USHORT uNRCount; /* Name Records count */
USHORT uStorageOffset; /* Offset for strings storage, USHORT uStorageOffset; /* Offset for strings storage from start of the table */
* from start of the table */ };
} TT_NAME_TABLE_HEADER;
#define NAME_ID_FULL_FONT_NAME 4 #define NAME_ID_FULL_FONT_NAME 4
#define NAME_ID_VERSION 5 #define NAME_ID_VERSION 5
typedef struct _tagTT_NAME_RECORD { struct name_record
{
USHORT uPlatformID; USHORT uPlatformID;
USHORT uEncodingID; USHORT uEncodingID;
USHORT uLanguageID; USHORT uLanguageID;
USHORT uNameID; USHORT uNameID;
USHORT uStringLength; USHORT uStringLength;
USHORT uStringOffset; /* from start of storage area */ USHORT uStringOffset; /* from start of storage area */
} TT_NAME_RECORD; };
#define SWAPWORD(x) MAKEWORD(HIBYTE(x), LOBYTE(x)) #define SWAPWORD(x) MAKEWORD(HIBYTE(x), LOBYTE(x))
#define SWAPLONG(x) MAKELONG(SWAPWORD(HIWORD(x)), SWAPWORD(LOWORD(x))) #define SWAPLONG(x) MAKELONG(SWAPWORD(HIWORD(x)), SWAPWORD(LOWORD(x)))
...@@ -72,11 +75,11 @@ typedef struct _tagTT_NAME_RECORD { ...@@ -72,11 +75,11 @@ typedef struct _tagTT_NAME_RECORD {
*/ */
static WCHAR *load_ttf_name_id( MSIPACKAGE *package, const WCHAR *filename, DWORD id ) static WCHAR *load_ttf_name_id( MSIPACKAGE *package, const WCHAR *filename, DWORD id )
{ {
TT_TABLE_DIRECTORY tblDir; struct table_directory tblDir;
BOOL bFound = FALSE; BOOL bFound = FALSE;
TT_OFFSET_TABLE ttOffsetTable; struct offset_table ttOffsetTable;
TT_NAME_TABLE_HEADER ttNTHeader; struct name_table_header ttNTHeader;
TT_NAME_RECORD ttRecord; struct name_record ttRecord;
DWORD dwRead; DWORD dwRead;
HANDLE handle; HANDLE handle;
LPWSTR ret = NULL; LPWSTR ret = NULL;
...@@ -92,7 +95,7 @@ static WCHAR *load_ttf_name_id( MSIPACKAGE *package, const WCHAR *filename, DWOR ...@@ -92,7 +95,7 @@ static WCHAR *load_ttf_name_id( MSIPACKAGE *package, const WCHAR *filename, DWOR
return NULL; return NULL;
} }
if (!ReadFile(handle,&ttOffsetTable, sizeof(TT_OFFSET_TABLE),&dwRead,NULL)) if (!ReadFile(handle,&ttOffsetTable, sizeof(struct offset_table),&dwRead,NULL))
goto end; goto end;
ttOffsetTable.uNumOfTables = SWAPWORD(ttOffsetTable.uNumOfTables); ttOffsetTable.uNumOfTables = SWAPWORD(ttOffsetTable.uNumOfTables);
...@@ -105,7 +108,7 @@ static WCHAR *load_ttf_name_id( MSIPACKAGE *package, const WCHAR *filename, DWOR ...@@ -105,7 +108,7 @@ static WCHAR *load_ttf_name_id( MSIPACKAGE *package, const WCHAR *filename, DWOR
for (i=0; i< ttOffsetTable.uNumOfTables; i++) for (i=0; i< ttOffsetTable.uNumOfTables; i++)
{ {
if (!ReadFile(handle,&tblDir, sizeof(TT_TABLE_DIRECTORY),&dwRead,NULL)) if (!ReadFile(handle, &tblDir, sizeof(tblDir), &dwRead, NULL))
break; break;
if (memcmp(tblDir.szTag,"name",4)==0) if (memcmp(tblDir.szTag,"name",4)==0)
{ {
...@@ -120,14 +123,14 @@ static WCHAR *load_ttf_name_id( MSIPACKAGE *package, const WCHAR *filename, DWOR ...@@ -120,14 +123,14 @@ static WCHAR *load_ttf_name_id( MSIPACKAGE *package, const WCHAR *filename, DWOR
goto end; goto end;
SetFilePointer(handle, tblDir.uOffset, NULL, FILE_BEGIN); SetFilePointer(handle, tblDir.uOffset, NULL, FILE_BEGIN);
if (!ReadFile(handle,&ttNTHeader, sizeof(TT_NAME_TABLE_HEADER), &dwRead,NULL)) if (!ReadFile(handle, &ttNTHeader, sizeof(ttNTHeader), &dwRead, NULL))
goto end; goto end;
ttNTHeader.uNRCount = SWAPWORD(ttNTHeader.uNRCount); ttNTHeader.uNRCount = SWAPWORD(ttNTHeader.uNRCount);
ttNTHeader.uStorageOffset = SWAPWORD(ttNTHeader.uStorageOffset); ttNTHeader.uStorageOffset = SWAPWORD(ttNTHeader.uStorageOffset);
for(i=0; i<ttNTHeader.uNRCount; i++) for(i=0; i<ttNTHeader.uNRCount; i++)
{ {
if (!ReadFile(handle,&ttRecord, sizeof(TT_NAME_RECORD),&dwRead,NULL)) if (!ReadFile(handle, &ttRecord, sizeof(ttRecord), &dwRead, NULL))
break; break;
ttRecord.uNameID = SWAPWORD(ttRecord.uNameID); ttRecord.uNameID = SWAPWORD(ttRecord.uNameID);
......
...@@ -54,7 +54,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(msi); ...@@ -54,7 +54,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(msi);
#define left_type(x) (x & 0xF0) #define left_type(x) (x & 0xF0)
typedef struct _tagFORMAT struct format
{ {
MSIPACKAGE *package; MSIPACKAGE *package;
MSIRECORD *record; MSIRECORD *record;
...@@ -64,9 +64,9 @@ typedef struct _tagFORMAT ...@@ -64,9 +64,9 @@ typedef struct _tagFORMAT
BOOL propfailed; BOOL propfailed;
BOOL groupfailed; BOOL groupfailed;
int groups; int groups;
} FORMAT; };
typedef struct _tagFORMSTR struct form_str
{ {
struct list entry; struct list entry;
int n; int n;
...@@ -74,25 +74,25 @@ typedef struct _tagFORMSTR ...@@ -74,25 +74,25 @@ typedef struct _tagFORMSTR
int type; int type;
BOOL propfound; BOOL propfound;
BOOL nonprop; BOOL nonprop;
} FORMSTR; };
typedef struct _tagSTACK struct stack
{ {
struct list items; struct list items;
} STACK; };
static STACK *create_stack(void) static struct stack *create_stack(void)
{ {
STACK *stack = malloc(sizeof(STACK)); struct stack *stack = malloc(sizeof(*stack));
list_init(&stack->items); list_init(&stack->items);
return stack; return stack;
} }
static void free_stack(STACK *stack) static void free_stack(struct stack *stack)
{ {
while (!list_empty(&stack->items)) while (!list_empty(&stack->items))
{ {
FORMSTR *str = LIST_ENTRY(list_head(&stack->items), FORMSTR, entry); struct form_str *str = LIST_ENTRY(list_head(&stack->items), struct form_str, entry);
list_remove(&str->entry); list_remove(&str->entry);
free(str); free(str);
} }
...@@ -100,28 +100,28 @@ static void free_stack(STACK *stack) ...@@ -100,28 +100,28 @@ static void free_stack(STACK *stack)
free(stack); free(stack);
} }
static void stack_push(STACK *stack, FORMSTR *str) static void stack_push(struct stack *stack, struct form_str *str)
{ {
list_add_head(&stack->items, &str->entry); list_add_head(&stack->items, &str->entry);
} }
static FORMSTR *stack_pop(STACK *stack) static struct form_str *stack_pop(struct stack *stack)
{ {
FORMSTR *ret; struct form_str *ret;
if (list_empty(&stack->items)) if (list_empty(&stack->items))
return NULL; return NULL;
ret = LIST_ENTRY(list_head(&stack->items), FORMSTR, entry); ret = LIST_ENTRY(list_head(&stack->items), struct form_str, entry);
list_remove(&ret->entry); list_remove(&ret->entry);
return ret; return ret;
} }
static FORMSTR *stack_find(STACK *stack, int type) static struct form_str *stack_find(struct stack *stack, int type)
{ {
FORMSTR *str; struct form_str *str;
LIST_FOR_EACH_ENTRY(str, &stack->items, FORMSTR, entry) LIST_FOR_EACH_ENTRY(str, &stack->items, struct form_str, entry)
{ {
if (str->type == type) if (str->type == type)
return str; return str;
...@@ -130,17 +130,17 @@ static FORMSTR *stack_find(STACK *stack, int type) ...@@ -130,17 +130,17 @@ static FORMSTR *stack_find(STACK *stack, int type)
return NULL; return NULL;
} }
static FORMSTR *stack_peek(STACK *stack) static struct form_str *stack_peek(struct stack *stack)
{ {
return LIST_ENTRY(list_head(&stack->items), FORMSTR, entry); return LIST_ENTRY(list_head(&stack->items), struct form_str, entry);
} }
static LPCWSTR get_formstr_data(FORMAT *format, FORMSTR *str) static const WCHAR *get_formstr_data(struct format *format, struct form_str *str)
{ {
return &format->deformatted[str->n]; return &format->deformatted[str->n];
} }
static WCHAR *dup_formstr( FORMAT *format, FORMSTR *str, int *ret_len ) static WCHAR *dup_formstr( struct format *format, struct form_str *str, int *ret_len )
{ {
WCHAR *val; WCHAR *val;
...@@ -154,7 +154,7 @@ static WCHAR *dup_formstr( FORMAT *format, FORMSTR *str, int *ret_len ) ...@@ -154,7 +154,7 @@ static WCHAR *dup_formstr( FORMAT *format, FORMSTR *str, int *ret_len )
return val; return val;
} }
static WCHAR *deformat_index( FORMAT *format, FORMSTR *str, int *ret_len ) static WCHAR *deformat_index( struct format *format, struct form_str *str, int *ret_len )
{ {
WCHAR *val, *ret; WCHAR *val, *ret;
DWORD len; DWORD len;
...@@ -180,7 +180,7 @@ static WCHAR *deformat_index( FORMAT *format, FORMSTR *str, int *ret_len ) ...@@ -180,7 +180,7 @@ static WCHAR *deformat_index( FORMAT *format, FORMSTR *str, int *ret_len )
return ret; return ret;
} }
static WCHAR *deformat_property( FORMAT *format, FORMSTR *str, int *ret_len ) static WCHAR *deformat_property( struct format *format, struct form_str *str, int *ret_len )
{ {
WCHAR *prop, *ret; WCHAR *prop, *ret;
DWORD len = 0; DWORD len = 0;
...@@ -203,7 +203,7 @@ static WCHAR *deformat_property( FORMAT *format, FORMSTR *str, int *ret_len ) ...@@ -203,7 +203,7 @@ static WCHAR *deformat_property( FORMAT *format, FORMSTR *str, int *ret_len )
return ret; return ret;
} }
static WCHAR *deformat_component( FORMAT *format, FORMSTR *str, int *ret_len ) static WCHAR *deformat_component( struct format *format, struct form_str *str, int *ret_len )
{ {
WCHAR *key, *ret; WCHAR *key, *ret;
MSICOMPONENT *comp; MSICOMPONENT *comp;
...@@ -227,7 +227,7 @@ static WCHAR *deformat_component( FORMAT *format, FORMSTR *str, int *ret_len ) ...@@ -227,7 +227,7 @@ static WCHAR *deformat_component( FORMAT *format, FORMSTR *str, int *ret_len )
return ret; return ret;
} }
static WCHAR *deformat_file( FORMAT *format, FORMSTR *str, BOOL shortname, int *ret_len ) static WCHAR *deformat_file( struct format *format, struct form_str *str, BOOL shortname, int *ret_len )
{ {
WCHAR *key, *ret = NULL; WCHAR *key, *ret = NULL;
const MSIFILE *file; const MSIFILE *file;
...@@ -257,7 +257,7 @@ done: ...@@ -257,7 +257,7 @@ done:
return ret; return ret;
} }
static WCHAR *deformat_environment( FORMAT *format, FORMSTR *str, int *ret_len ) static WCHAR *deformat_environment( struct format *format, struct form_str *str, int *ret_len )
{ {
WCHAR *key, *ret = NULL; WCHAR *key, *ret = NULL;
DWORD len; DWORD len;
...@@ -275,7 +275,7 @@ static WCHAR *deformat_environment( FORMAT *format, FORMSTR *str, int *ret_len ) ...@@ -275,7 +275,7 @@ static WCHAR *deformat_environment( FORMAT *format, FORMSTR *str, int *ret_len )
return ret; return ret;
} }
static WCHAR *deformat_literal( FORMAT *format, FORMSTR *str, BOOL *propfound, static WCHAR *deformat_literal( struct format *format, struct form_str *str, BOOL *propfound,
int *type, int *len ) int *type, int *len )
{ {
LPCWSTR data = get_formstr_data(format, str); LPCWSTR data = get_formstr_data(format, str);
...@@ -389,10 +389,10 @@ static BOOL format_is_literal(WCHAR x) ...@@ -389,10 +389,10 @@ static BOOL format_is_literal(WCHAR x)
return (format_is_alpha(x) || format_is_number(x)); return (format_is_alpha(x) || format_is_number(x));
} }
static int format_lex(FORMAT *format, FORMSTR **out) static int format_lex(struct format *format, struct form_str **out)
{ {
int type, len = 1; int type, len = 1;
FORMSTR *str; struct form_str *str;
LPCWSTR data; LPCWSTR data;
WCHAR ch; WCHAR ch;
...@@ -401,7 +401,7 @@ static int format_lex(FORMAT *format, FORMSTR **out) ...@@ -401,7 +401,7 @@ static int format_lex(FORMAT *format, FORMSTR **out)
if (!format->deformatted) if (!format->deformatted)
return FORMAT_NULL; return FORMAT_NULL;
*out = calloc(1, sizeof(FORMSTR)); *out = calloc(1, sizeof(**out));
if (!*out) if (!*out)
return FORMAT_FAIL; return FORMAT_FAIL;
...@@ -473,10 +473,10 @@ static int format_lex(FORMAT *format, FORMSTR **out) ...@@ -473,10 +473,10 @@ static int format_lex(FORMAT *format, FORMSTR **out)
return type; return type;
} }
static FORMSTR *format_replace( FORMAT *format, BOOL propfound, BOOL nonprop, static struct form_str *format_replace( struct format *format, BOOL propfound, BOOL nonprop,
int oldsize, int type, WCHAR *replace, int len ) int oldsize, int type, WCHAR *replace, int len )
{ {
FORMSTR *ret; struct form_str *ret;
LPWSTR str, ptr; LPWSTR str, ptr;
DWORD size = 0; DWORD size = 0;
int n; int n;
...@@ -533,7 +533,7 @@ static FORMSTR *format_replace( FORMAT *format, BOOL propfound, BOOL nonprop, ...@@ -533,7 +533,7 @@ static FORMSTR *format_replace( FORMAT *format, BOOL propfound, BOOL nonprop,
if (!replace) if (!replace)
return NULL; return NULL;
ret = calloc(1, sizeof(FORMSTR)); ret = calloc(1, sizeof(*ret));
if (!ret) if (!ret)
return NULL; return NULL;
...@@ -546,12 +546,12 @@ static FORMSTR *format_replace( FORMAT *format, BOOL propfound, BOOL nonprop, ...@@ -546,12 +546,12 @@ static FORMSTR *format_replace( FORMAT *format, BOOL propfound, BOOL nonprop,
return ret; return ret;
} }
static WCHAR *replace_stack_group( FORMAT *format, STACK *values, static WCHAR *replace_stack_group( struct format *format, struct stack *values,
BOOL *propfound, BOOL *nonprop, BOOL *propfound, BOOL *nonprop,
int *oldsize, int *type, int *len ) int *oldsize, int *type, int *len )
{ {
WCHAR *replaced; WCHAR *replaced;
FORMSTR *content, *node; struct form_str *content, *node;
int n; int n;
*nonprop = FALSE; *nonprop = FALSE;
...@@ -575,7 +575,7 @@ static WCHAR *replace_stack_group( FORMAT *format, STACK *values, ...@@ -575,7 +575,7 @@ static WCHAR *replace_stack_group( FORMAT *format, STACK *values,
free(node); free(node);
} }
content = calloc(1, sizeof(FORMSTR)); content = calloc(1, sizeof(*content));
content->n = n; content->n = n;
content->len = *oldsize; content->len = *oldsize;
content->type = FORMAT_LITERAL; content->type = FORMAT_LITERAL;
...@@ -616,12 +616,12 @@ static WCHAR *replace_stack_group( FORMAT *format, STACK *values, ...@@ -616,12 +616,12 @@ static WCHAR *replace_stack_group( FORMAT *format, STACK *values,
return replaced; return replaced;
} }
static WCHAR *replace_stack_prop( FORMAT *format, STACK *values, static WCHAR *replace_stack_prop( struct format *format, struct stack *values,
BOOL *propfound, BOOL *nonprop, BOOL *propfound, BOOL *nonprop,
int *oldsize, int *type, int *len ) int *oldsize, int *type, int *len )
{ {
WCHAR *replaced; WCHAR *replaced;
FORMSTR *content, *node; struct form_str *content, *node;
int n; int n;
*propfound = FALSE; *propfound = FALSE;
...@@ -644,7 +644,7 @@ static WCHAR *replace_stack_prop( FORMAT *format, STACK *values, ...@@ -644,7 +644,7 @@ static WCHAR *replace_stack_prop( FORMAT *format, STACK *values,
free(node); free(node);
} }
content = calloc(1, sizeof(FORMSTR)); content = calloc(1, sizeof(*content));
content->n = n + 1; content->n = n + 1;
content->len = *oldsize - 2; content->len = *oldsize - 2;
content->type = *type; content->type = *type;
...@@ -676,10 +676,10 @@ static WCHAR *replace_stack_prop( FORMAT *format, STACK *values, ...@@ -676,10 +676,10 @@ static WCHAR *replace_stack_prop( FORMAT *format, STACK *values,
return replaced; return replaced;
} }
static UINT replace_stack(FORMAT *format, STACK *stack, STACK *values) static UINT replace_stack(struct format *format, struct stack *stack, struct stack *values)
{ {
WCHAR *replaced = NULL; WCHAR *replaced = NULL;
FORMSTR *beg, *top, *node; struct form_str *beg, *top, *node;
BOOL propfound = FALSE, nonprop = FALSE, group = FALSE; BOOL propfound = FALSE, nonprop = FALSE, group = FALSE;
int type, n, len = 0, oldsize = 0; int type, n, len = 0, oldsize = 0;
...@@ -757,10 +757,10 @@ static DWORD deformat_string_internal(MSIPACKAGE *package, LPCWSTR ptr, ...@@ -757,10 +757,10 @@ static DWORD deformat_string_internal(MSIPACKAGE *package, LPCWSTR ptr,
WCHAR** data, DWORD *len, WCHAR** data, DWORD *len,
MSIRECORD* record) MSIRECORD* record)
{ {
FORMAT format; struct format format;
FORMSTR *str = NULL; struct form_str *str = NULL;
STACK *stack, *temp; struct stack *stack, *temp;
FORMSTR *node; struct form_str *node;
int type; int type;
if (!ptr) if (!ptr)
...@@ -773,7 +773,7 @@ static DWORD deformat_string_internal(MSIPACKAGE *package, LPCWSTR ptr, ...@@ -773,7 +773,7 @@ static DWORD deformat_string_internal(MSIPACKAGE *package, LPCWSTR ptr,
*data = wcsdup(ptr); *data = wcsdup(ptr);
*len = lstrlenW(ptr); *len = lstrlenW(ptr);
ZeroMemory(&format, sizeof(FORMAT)); ZeroMemory(&format, sizeof(format));
format.package = package; format.package = package;
format.record = record; format.record = record;
format.deformatted = *data; format.deformatted = *data;
......
...@@ -38,7 +38,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(msidb); ...@@ -38,7 +38,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(msidb);
/* below is the query interface to a table */ /* below is the query interface to a table */
typedef struct tagMSIINSERTVIEW struct insert_view
{ {
MSIVIEW view; MSIVIEW view;
MSIVIEW *table; MSIVIEW *table;
...@@ -46,11 +46,11 @@ typedef struct tagMSIINSERTVIEW ...@@ -46,11 +46,11 @@ typedef struct tagMSIINSERTVIEW
BOOL bIsTemp; BOOL bIsTemp;
MSIVIEW *sv; MSIVIEW *sv;
column_info *vals; column_info *vals;
} MSIINSERTVIEW; };
static UINT INSERT_fetch_int( struct tagMSIVIEW *view, UINT row, UINT col, UINT *val ) static UINT INSERT_fetch_int( struct tagMSIVIEW *view, UINT row, UINT col, UINT *val )
{ {
MSIINSERTVIEW *iv = (MSIINSERTVIEW*)view; struct insert_view *iv = (struct insert_view *)view;
TRACE("%p %d %d %p\n", iv, row, col, val ); TRACE("%p %d %d %p\n", iv, row, col, val );
...@@ -106,7 +106,7 @@ err: ...@@ -106,7 +106,7 @@ err:
/* checks to see if the column order specified in the INSERT query /* checks to see if the column order specified in the INSERT query
* matches the column order of the table * matches the column order of the table
*/ */
static BOOL columns_in_order(MSIINSERTVIEW *iv, UINT col_count) static BOOL columns_in_order(struct insert_view *iv, UINT col_count)
{ {
LPCWSTR a, b; LPCWSTR a, b;
UINT i; UINT i;
...@@ -124,7 +124,7 @@ static BOOL columns_in_order(MSIINSERTVIEW *iv, UINT col_count) ...@@ -124,7 +124,7 @@ static BOOL columns_in_order(MSIINSERTVIEW *iv, UINT col_count)
/* rearranges the data in the record to be inserted based on column order, /* rearranges the data in the record to be inserted based on column order,
* and pads the record for any missing columns in the INSERT query * and pads the record for any missing columns in the INSERT query
*/ */
static UINT arrange_record(MSIINSERTVIEW *iv, MSIRECORD **values) static UINT arrange_record(struct insert_view *iv, MSIRECORD **values)
{ {
MSIRECORD *padded; MSIRECORD *padded;
UINT col_count, val_count; UINT col_count, val_count;
...@@ -176,7 +176,7 @@ err: ...@@ -176,7 +176,7 @@ err:
return r; return r;
} }
static BOOL row_has_null_primary_keys(MSIINSERTVIEW *iv, MSIRECORD *row) static BOOL row_has_null_primary_keys(struct insert_view *iv, MSIRECORD *row)
{ {
UINT r, i, col_count, type; UINT r, i, col_count, type;
...@@ -203,7 +203,7 @@ static BOOL row_has_null_primary_keys(MSIINSERTVIEW *iv, MSIRECORD *row) ...@@ -203,7 +203,7 @@ static BOOL row_has_null_primary_keys(MSIINSERTVIEW *iv, MSIRECORD *row)
static UINT INSERT_execute( struct tagMSIVIEW *view, MSIRECORD *record ) static UINT INSERT_execute( struct tagMSIVIEW *view, MSIRECORD *record )
{ {
MSIINSERTVIEW *iv = (MSIINSERTVIEW*)view; struct insert_view *iv = (struct insert_view *)view;
UINT r, row = -1, col_count = 0; UINT r, row = -1, col_count = 0;
MSIVIEW *sv; MSIVIEW *sv;
MSIRECORD *values = NULL; MSIRECORD *values = NULL;
...@@ -251,7 +251,7 @@ err: ...@@ -251,7 +251,7 @@ err:
static UINT INSERT_close( struct tagMSIVIEW *view ) static UINT INSERT_close( struct tagMSIVIEW *view )
{ {
MSIINSERTVIEW *iv = (MSIINSERTVIEW*)view; struct insert_view *iv = (struct insert_view *)view;
MSIVIEW *sv; MSIVIEW *sv;
TRACE("%p\n", iv); TRACE("%p\n", iv);
...@@ -265,7 +265,7 @@ static UINT INSERT_close( struct tagMSIVIEW *view ) ...@@ -265,7 +265,7 @@ static UINT INSERT_close( struct tagMSIVIEW *view )
static UINT INSERT_get_dimensions( struct tagMSIVIEW *view, UINT *rows, UINT *cols ) static UINT INSERT_get_dimensions( struct tagMSIVIEW *view, UINT *rows, UINT *cols )
{ {
MSIINSERTVIEW *iv = (MSIINSERTVIEW*)view; struct insert_view *iv = (struct insert_view *)view;
MSIVIEW *sv; MSIVIEW *sv;
TRACE("%p %p %p\n", iv, rows, cols ); TRACE("%p %p %p\n", iv, rows, cols );
...@@ -280,7 +280,7 @@ static UINT INSERT_get_dimensions( struct tagMSIVIEW *view, UINT *rows, UINT *co ...@@ -280,7 +280,7 @@ static UINT INSERT_get_dimensions( struct tagMSIVIEW *view, UINT *rows, UINT *co
static UINT INSERT_get_column_info( struct tagMSIVIEW *view, UINT n, LPCWSTR *name, static UINT INSERT_get_column_info( struct tagMSIVIEW *view, UINT n, LPCWSTR *name,
UINT *type, BOOL *temporary, LPCWSTR *table_name ) UINT *type, BOOL *temporary, LPCWSTR *table_name )
{ {
MSIINSERTVIEW *iv = (MSIINSERTVIEW*)view; struct insert_view *iv = (struct insert_view *)view;
MSIVIEW *sv; MSIVIEW *sv;
TRACE("%p %d %p %p %p %p\n", iv, n, name, type, temporary, table_name ); TRACE("%p %d %p %p %p %p\n", iv, n, name, type, temporary, table_name );
...@@ -294,7 +294,7 @@ static UINT INSERT_get_column_info( struct tagMSIVIEW *view, UINT n, LPCWSTR *na ...@@ -294,7 +294,7 @@ static UINT INSERT_get_column_info( struct tagMSIVIEW *view, UINT n, LPCWSTR *na
static UINT INSERT_modify( struct tagMSIVIEW *view, MSIMODIFY eModifyMode, MSIRECORD *rec, UINT row) static UINT INSERT_modify( struct tagMSIVIEW *view, MSIMODIFY eModifyMode, MSIRECORD *rec, UINT row)
{ {
MSIINSERTVIEW *iv = (MSIINSERTVIEW*)view; struct insert_view *iv = (struct insert_view *)view;
TRACE("%p %d %p\n", iv, eModifyMode, rec ); TRACE("%p %d %p\n", iv, eModifyMode, rec );
...@@ -303,7 +303,7 @@ static UINT INSERT_modify( struct tagMSIVIEW *view, MSIMODIFY eModifyMode, MSIRE ...@@ -303,7 +303,7 @@ static UINT INSERT_modify( struct tagMSIVIEW *view, MSIMODIFY eModifyMode, MSIRE
static UINT INSERT_delete( struct tagMSIVIEW *view ) static UINT INSERT_delete( struct tagMSIVIEW *view )
{ {
MSIINSERTVIEW *iv = (MSIINSERTVIEW*)view; struct insert_view *iv = (struct insert_view *)view;
MSIVIEW *sv; MSIVIEW *sv;
TRACE("%p\n", iv ); TRACE("%p\n", iv );
...@@ -351,7 +351,7 @@ static UINT count_column_info( const column_info *ci ) ...@@ -351,7 +351,7 @@ static UINT count_column_info( const column_info *ci )
UINT INSERT_CreateView( MSIDATABASE *db, MSIVIEW **view, LPCWSTR table, UINT INSERT_CreateView( MSIDATABASE *db, MSIVIEW **view, LPCWSTR table,
column_info *columns, column_info *values, BOOL temp ) column_info *columns, column_info *values, BOOL temp )
{ {
MSIINSERTVIEW *iv = NULL; struct insert_view *iv = NULL;
UINT r; UINT r;
MSIVIEW *tv = NULL, *sv = NULL; MSIVIEW *tv = NULL, *sv = NULL;
......
...@@ -4005,17 +4005,17 @@ UINT WINAPI MsiReinstallFeatureA( const char *szProduct, const char *szFeature, ...@@ -4005,17 +4005,17 @@ UINT WINAPI MsiReinstallFeatureA( const char *szProduct, const char *szFeature,
return rc; return rc;
} }
typedef struct struct md5_ctx
{ {
unsigned int i[2]; unsigned int i[2];
unsigned int buf[4]; unsigned int buf[4];
unsigned char in[64]; unsigned char in[64];
unsigned char digest[16]; unsigned char digest[16];
} MD5_CTX; };
extern VOID WINAPI MD5Init( MD5_CTX *); extern void WINAPI MD5Init( struct md5_ctx * );
extern VOID WINAPI MD5Update( MD5_CTX *, const unsigned char *, unsigned int ); extern void WINAPI MD5Update( struct md5_ctx *, const unsigned char *, unsigned int );
extern VOID WINAPI MD5Final( MD5_CTX *); extern void WINAPI MD5Final( struct md5_ctx * );
UINT msi_get_filehash( MSIPACKAGE *package, const WCHAR *path, MSIFILEHASHINFO *hash ) UINT msi_get_filehash( MSIPACKAGE *package, const WCHAR *path, MSIFILEHASHINFO *hash )
{ {
...@@ -4039,7 +4039,7 @@ UINT msi_get_filehash( MSIPACKAGE *package, const WCHAR *path, MSIFILEHASHINFO * ...@@ -4039,7 +4039,7 @@ UINT msi_get_filehash( MSIPACKAGE *package, const WCHAR *path, MSIFILEHASHINFO *
{ {
if ((p = MapViewOfFile( mapping, FILE_MAP_READ, 0, 0, length ))) if ((p = MapViewOfFile( mapping, FILE_MAP_READ, 0, 0, length )))
{ {
MD5_CTX ctx; struct md5_ctx ctx;
MD5Init( &ctx ); MD5Init( &ctx );
MD5Update( &ctx, p, length ); MD5Update( &ctx, p, length );
......
...@@ -87,20 +87,21 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) ...@@ -87,20 +87,21 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
return TRUE; return TRUE;
} }
typedef struct tagIClassFactoryImpl { struct class_factory
{
IClassFactory IClassFactory_iface; IClassFactory IClassFactory_iface;
HRESULT (*create_object)( IUnknown*, LPVOID* ); HRESULT (*create_object)( IUnknown *, void ** );
} IClassFactoryImpl; };
static inline IClassFactoryImpl *impl_from_IClassFactory(IClassFactory *iface) static inline struct class_factory *impl_from_IClassFactory(IClassFactory *iface)
{ {
return CONTAINING_RECORD(iface, IClassFactoryImpl, IClassFactory_iface); return CONTAINING_RECORD(iface, struct class_factory, IClassFactory_iface);
} }
static HRESULT WINAPI MsiCF_QueryInterface(LPCLASSFACTORY iface, static HRESULT WINAPI MsiCF_QueryInterface(LPCLASSFACTORY iface,
REFIID riid,LPVOID *ppobj) REFIID riid,LPVOID *ppobj)
{ {
IClassFactoryImpl *This = impl_from_IClassFactory(iface); struct class_factory *This = impl_from_IClassFactory(iface);
TRACE("%p %s %p\n",This,debugstr_guid(riid),ppobj); TRACE("%p %s %p\n",This,debugstr_guid(riid),ppobj);
...@@ -129,7 +130,7 @@ static ULONG WINAPI MsiCF_Release(LPCLASSFACTORY iface) ...@@ -129,7 +130,7 @@ static ULONG WINAPI MsiCF_Release(LPCLASSFACTORY iface)
static HRESULT WINAPI MsiCF_CreateInstance(LPCLASSFACTORY iface, static HRESULT WINAPI MsiCF_CreateInstance(LPCLASSFACTORY iface,
LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj)
{ {
IClassFactoryImpl *This = impl_from_IClassFactory(iface); struct class_factory *This = impl_from_IClassFactory(iface);
IUnknown *unk = NULL; IUnknown *unk = NULL;
HRESULT r; HRESULT r;
...@@ -165,7 +166,7 @@ static const IClassFactoryVtbl MsiCF_Vtbl = ...@@ -165,7 +166,7 @@ static const IClassFactoryVtbl MsiCF_Vtbl =
MsiCF_LockServer MsiCF_LockServer
}; };
static IClassFactoryImpl MsiServer_CF = { { &MsiCF_Vtbl }, create_msiserver }; static struct class_factory MsiServer_CF = { { &MsiCF_Vtbl }, create_msiserver };
/****************************************************************** /******************************************************************
* DllGetClassObject [MSI.@] * DllGetClassObject [MSI.@]
......
...@@ -573,11 +573,11 @@ static LPWSTR get_fusion_filename(MSIPACKAGE *package) ...@@ -573,11 +573,11 @@ static LPWSTR get_fusion_filename(MSIPACKAGE *package)
return filename; return filename;
} }
typedef struct tagLANGANDCODEPAGE struct lang_codepage
{ {
WORD wLanguage; WORD wLanguage;
WORD wCodePage; WORD wCodePage;
} LANGANDCODEPAGE; };
static void set_msi_assembly_prop(MSIPACKAGE *package) static void set_msi_assembly_prop(MSIPACKAGE *package)
{ {
...@@ -586,7 +586,7 @@ static void set_msi_assembly_prop(MSIPACKAGE *package) ...@@ -586,7 +586,7 @@ static void set_msi_assembly_prop(MSIPACKAGE *package)
LPVOID version = NULL; LPVOID version = NULL;
WCHAR buf[MAX_PATH]; WCHAR buf[MAX_PATH];
LPWSTR fusion, verstr; LPWSTR fusion, verstr;
LANGANDCODEPAGE *translate; struct lang_codepage *translate;
fusion = get_fusion_filename(package); fusion = get_fusion_filename(package);
if (!fusion) if (!fusion)
......
...@@ -68,7 +68,6 @@ struct complex_expr ...@@ -68,7 +68,6 @@ struct complex_expr
struct expr *right; struct expr *right;
}; };
struct tagJOINTABLE;
union ext_column union ext_column
{ {
struct struct
...@@ -79,7 +78,7 @@ union ext_column ...@@ -79,7 +78,7 @@ union ext_column
struct struct
{ {
UINT column; UINT column;
struct tagJOINTABLE *table; struct join_table *table;
} parsed; } parsed;
}; };
......
...@@ -50,18 +50,19 @@ WINE_DEFAULT_DEBUG_CHANNEL(msi); ...@@ -50,18 +50,19 @@ WINE_DEFAULT_DEBUG_CHANNEL(msi);
#endif #endif
/* /*
* MsiActiveScriptSite - Our IActiveScriptSite implementation. * struct script_site - Our IActiveScriptSite implementation.
*/ */
typedef struct { struct script_site
{
IActiveScriptSite IActiveScriptSite_iface; IActiveScriptSite IActiveScriptSite_iface;
IDispatch *installer; IDispatch *installer;
IDispatch *session; IDispatch *session;
LONG ref; LONG ref;
} MsiActiveScriptSite; };
static inline MsiActiveScriptSite *impl_from_IActiveScriptSite( IActiveScriptSite *iface ) static inline struct script_site *impl_from_IActiveScriptSite( IActiveScriptSite *iface )
{ {
return CONTAINING_RECORD(iface, MsiActiveScriptSite, IActiveScriptSite_iface); return CONTAINING_RECORD(iface, struct script_site, IActiveScriptSite_iface);
} }
/* /*
...@@ -69,7 +70,7 @@ static inline MsiActiveScriptSite *impl_from_IActiveScriptSite( IActiveScriptSit ...@@ -69,7 +70,7 @@ static inline MsiActiveScriptSite *impl_from_IActiveScriptSite( IActiveScriptSit
*/ */
static HRESULT WINAPI MsiActiveScriptSite_QueryInterface(IActiveScriptSite* iface, REFIID riid, void** obj) static HRESULT WINAPI MsiActiveScriptSite_QueryInterface(IActiveScriptSite* iface, REFIID riid, void** obj)
{ {
MsiActiveScriptSite *This = impl_from_IActiveScriptSite(iface); struct script_site *This = impl_from_IActiveScriptSite(iface);
TRACE("(%p)->(%s, %p)\n", This, debugstr_guid(riid), obj); TRACE("(%p)->(%s, %p)\n", This, debugstr_guid(riid), obj);
...@@ -88,7 +89,7 @@ static HRESULT WINAPI MsiActiveScriptSite_QueryInterface(IActiveScriptSite* ifac ...@@ -88,7 +89,7 @@ static HRESULT WINAPI MsiActiveScriptSite_QueryInterface(IActiveScriptSite* ifac
static ULONG WINAPI MsiActiveScriptSite_AddRef(IActiveScriptSite* iface) static ULONG WINAPI MsiActiveScriptSite_AddRef(IActiveScriptSite* iface)
{ {
MsiActiveScriptSite *This = impl_from_IActiveScriptSite(iface); struct script_site *This = impl_from_IActiveScriptSite(iface);
ULONG ref = InterlockedIncrement(&This->ref); ULONG ref = InterlockedIncrement(&This->ref);
TRACE( "(%p)->(%lu)\n", This, ref ); TRACE( "(%p)->(%lu)\n", This, ref );
return ref; return ref;
...@@ -96,7 +97,7 @@ static ULONG WINAPI MsiActiveScriptSite_AddRef(IActiveScriptSite* iface) ...@@ -96,7 +97,7 @@ static ULONG WINAPI MsiActiveScriptSite_AddRef(IActiveScriptSite* iface)
static ULONG WINAPI MsiActiveScriptSite_Release(IActiveScriptSite* iface) static ULONG WINAPI MsiActiveScriptSite_Release(IActiveScriptSite* iface)
{ {
MsiActiveScriptSite *This = impl_from_IActiveScriptSite(iface); struct script_site *This = impl_from_IActiveScriptSite(iface);
ULONG ref = InterlockedDecrement(&This->ref); ULONG ref = InterlockedDecrement(&This->ref);
TRACE( "(%p)->(%lu)\n", This, ref ); TRACE( "(%p)->(%lu)\n", This, ref );
...@@ -109,14 +110,14 @@ static ULONG WINAPI MsiActiveScriptSite_Release(IActiveScriptSite* iface) ...@@ -109,14 +110,14 @@ static ULONG WINAPI MsiActiveScriptSite_Release(IActiveScriptSite* iface)
static HRESULT WINAPI MsiActiveScriptSite_GetLCID(IActiveScriptSite* iface, LCID* plcid) static HRESULT WINAPI MsiActiveScriptSite_GetLCID(IActiveScriptSite* iface, LCID* plcid)
{ {
MsiActiveScriptSite *This = impl_from_IActiveScriptSite(iface); struct script_site *This = impl_from_IActiveScriptSite(iface);
TRACE("(%p)->(%p)\n", This, plcid); TRACE("(%p)->(%p)\n", This, plcid);
return E_NOTIMPL; /* Script will use system-defined locale */ return E_NOTIMPL; /* Script will use system-defined locale */
} }
static HRESULT WINAPI MsiActiveScriptSite_GetItemInfo(IActiveScriptSite* iface, LPCOLESTR pstrName, DWORD dwReturnMask, IUnknown** ppiunkItem, ITypeInfo** ppti) static HRESULT WINAPI MsiActiveScriptSite_GetItemInfo(IActiveScriptSite* iface, LPCOLESTR pstrName, DWORD dwReturnMask, IUnknown** ppiunkItem, ITypeInfo** ppti)
{ {
MsiActiveScriptSite *This = impl_from_IActiveScriptSite(iface); struct script_site *This = impl_from_IActiveScriptSite(iface);
TRACE( "(%p)->(%p, %lu, %p, %p)\n", This, pstrName, dwReturnMask, ppiunkItem, ppti ); TRACE( "(%p)->(%p, %lu, %p, %p)\n", This, pstrName, dwReturnMask, ppiunkItem, ppti );
...@@ -149,14 +150,14 @@ static HRESULT WINAPI MsiActiveScriptSite_GetItemInfo(IActiveScriptSite* iface, ...@@ -149,14 +150,14 @@ static HRESULT WINAPI MsiActiveScriptSite_GetItemInfo(IActiveScriptSite* iface,
static HRESULT WINAPI MsiActiveScriptSite_GetDocVersionString(IActiveScriptSite* iface, BSTR* pbstrVersion) static HRESULT WINAPI MsiActiveScriptSite_GetDocVersionString(IActiveScriptSite* iface, BSTR* pbstrVersion)
{ {
MsiActiveScriptSite *This = impl_from_IActiveScriptSite(iface); struct script_site *This = impl_from_IActiveScriptSite(iface);
TRACE("(%p)->(%p)\n", This, pbstrVersion); TRACE("(%p)->(%p)\n", This, pbstrVersion);
return E_NOTIMPL; return E_NOTIMPL;
} }
static HRESULT WINAPI MsiActiveScriptSite_OnScriptTerminate(IActiveScriptSite* iface, const VARIANT* pvarResult, const EXCEPINFO* pexcepinfo) static HRESULT WINAPI MsiActiveScriptSite_OnScriptTerminate(IActiveScriptSite* iface, const VARIANT* pvarResult, const EXCEPINFO* pexcepinfo)
{ {
MsiActiveScriptSite *This = impl_from_IActiveScriptSite(iface); struct script_site *This = impl_from_IActiveScriptSite(iface);
TRACE("(%p)->(%p, %p)\n", This, pvarResult, pexcepinfo); TRACE("(%p)->(%p, %p)\n", This, pvarResult, pexcepinfo);
return S_OK; return S_OK;
} }
...@@ -198,7 +199,7 @@ static HRESULT WINAPI MsiActiveScriptSite_OnStateChange(IActiveScriptSite* iface ...@@ -198,7 +199,7 @@ static HRESULT WINAPI MsiActiveScriptSite_OnStateChange(IActiveScriptSite* iface
static HRESULT WINAPI MsiActiveScriptSite_OnScriptError(IActiveScriptSite* iface, IActiveScriptError* pscripterror) static HRESULT WINAPI MsiActiveScriptSite_OnScriptError(IActiveScriptSite* iface, IActiveScriptError* pscripterror)
{ {
MsiActiveScriptSite *This = impl_from_IActiveScriptSite(iface); struct script_site *This = impl_from_IActiveScriptSite(iface);
EXCEPINFO exception; EXCEPINFO exception;
HRESULT hr; HRESULT hr;
...@@ -219,14 +220,14 @@ static HRESULT WINAPI MsiActiveScriptSite_OnScriptError(IActiveScriptSite* iface ...@@ -219,14 +220,14 @@ static HRESULT WINAPI MsiActiveScriptSite_OnScriptError(IActiveScriptSite* iface
static HRESULT WINAPI MsiActiveScriptSite_OnEnterScript(IActiveScriptSite* iface) static HRESULT WINAPI MsiActiveScriptSite_OnEnterScript(IActiveScriptSite* iface)
{ {
MsiActiveScriptSite *This = impl_from_IActiveScriptSite(iface); struct script_site *This = impl_from_IActiveScriptSite(iface);
TRACE("(%p)\n", This); TRACE("(%p)\n", This);
return S_OK; return S_OK;
} }
static HRESULT WINAPI MsiActiveScriptSite_OnLeaveScript(IActiveScriptSite* iface) static HRESULT WINAPI MsiActiveScriptSite_OnLeaveScript(IActiveScriptSite* iface)
{ {
MsiActiveScriptSite *This = impl_from_IActiveScriptSite(iface); struct script_site *This = impl_from_IActiveScriptSite(iface);
TRACE("(%p)\n", This); TRACE("(%p)\n", This);
return S_OK; return S_OK;
} }
...@@ -246,15 +247,15 @@ static const struct IActiveScriptSiteVtbl activescriptsitevtbl = ...@@ -246,15 +247,15 @@ static const struct IActiveScriptSiteVtbl activescriptsitevtbl =
MsiActiveScriptSite_OnLeaveScript MsiActiveScriptSite_OnLeaveScript
}; };
static HRESULT create_activescriptsite(MsiActiveScriptSite **obj) static HRESULT create_activescriptsite(struct script_site **obj)
{ {
MsiActiveScriptSite* object; struct script_site *object;
TRACE("(%p)\n", obj); TRACE("(%p)\n", obj);
*obj = NULL; *obj = NULL;
object = malloc(sizeof(MsiActiveScriptSite)); object = malloc(sizeof(*object));
if (!object) if (!object)
return E_OUTOFMEMORY; return E_OUTOFMEMORY;
...@@ -290,7 +291,7 @@ DWORD call_script(MSIHANDLE hPackage, INT type, LPCWSTR script, LPCWSTR function ...@@ -290,7 +291,7 @@ DWORD call_script(MSIHANDLE hPackage, INT type, LPCWSTR script, LPCWSTR function
HRESULT hr; HRESULT hr;
IActiveScript *pActiveScript = NULL; IActiveScript *pActiveScript = NULL;
IActiveScriptParse *pActiveScriptParse = NULL; IActiveScriptParse *pActiveScriptParse = NULL;
MsiActiveScriptSite *scriptsite; struct script_site *scriptsite;
IDispatch *pDispatch = NULL; IDispatch *pDispatch = NULL;
DISPPARAMS dispparamsNoArgs = {NULL, NULL, 0, 0}; DISPPARAMS dispparamsNoArgs = {NULL, NULL, 0, 0};
DISPID dispid; DISPID dispid;
......
...@@ -38,7 +38,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(msidb); ...@@ -38,7 +38,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(msidb);
/* below is the query interface to a table */ /* below is the query interface to a table */
typedef struct tagMSISELECTVIEW struct select_view
{ {
MSIVIEW view; MSIVIEW view;
MSIDATABASE *db; MSIDATABASE *db;
...@@ -46,9 +46,9 @@ typedef struct tagMSISELECTVIEW ...@@ -46,9 +46,9 @@ typedef struct tagMSISELECTVIEW
UINT num_cols; UINT num_cols;
UINT max_cols; UINT max_cols;
UINT cols[1]; UINT cols[1];
} MSISELECTVIEW; };
static UINT translate_record( MSISELECTVIEW *sv, MSIRECORD *in, MSIRECORD **out ) static UINT translate_record( struct select_view *sv, MSIRECORD *in, MSIRECORD **out )
{ {
UINT r, col_count, i; UINT r, col_count, i;
MSIRECORD *object; MSIRECORD *object;
...@@ -74,7 +74,7 @@ static UINT translate_record( MSISELECTVIEW *sv, MSIRECORD *in, MSIRECORD **out ...@@ -74,7 +74,7 @@ static UINT translate_record( MSISELECTVIEW *sv, MSIRECORD *in, MSIRECORD **out
static UINT SELECT_fetch_int( struct tagMSIVIEW *view, UINT row, UINT col, UINT *val ) static UINT SELECT_fetch_int( struct tagMSIVIEW *view, UINT row, UINT col, UINT *val )
{ {
MSISELECTVIEW *sv = (MSISELECTVIEW*)view; struct select_view *sv = (struct select_view *)view;
TRACE("%p %d %d %p\n", sv, row, col, val ); TRACE("%p %d %d %p\n", sv, row, col, val );
...@@ -95,7 +95,7 @@ static UINT SELECT_fetch_int( struct tagMSIVIEW *view, UINT row, UINT col, UINT ...@@ -95,7 +95,7 @@ static UINT SELECT_fetch_int( struct tagMSIVIEW *view, UINT row, UINT col, UINT
static UINT SELECT_fetch_stream( struct tagMSIVIEW *view, UINT row, UINT col, IStream **stm) static UINT SELECT_fetch_stream( struct tagMSIVIEW *view, UINT row, UINT col, IStream **stm)
{ {
MSISELECTVIEW *sv = (MSISELECTVIEW*)view; struct select_view *sv = (struct select_view *)view;
TRACE("%p %d %d %p\n", sv, row, col, stm ); TRACE("%p %d %d %p\n", sv, row, col, stm );
...@@ -116,7 +116,7 @@ static UINT SELECT_fetch_stream( struct tagMSIVIEW *view, UINT row, UINT col, IS ...@@ -116,7 +116,7 @@ static UINT SELECT_fetch_stream( struct tagMSIVIEW *view, UINT row, UINT col, IS
static UINT SELECT_set_row( struct tagMSIVIEW *view, UINT row, MSIRECORD *rec, UINT mask ) static UINT SELECT_set_row( struct tagMSIVIEW *view, UINT row, MSIRECORD *rec, UINT mask )
{ {
MSISELECTVIEW *sv = (MSISELECTVIEW*)view; struct select_view *sv = (struct select_view *)view;
UINT i, expanded_mask = 0, r = ERROR_SUCCESS, col_count = 0; UINT i, expanded_mask = 0, r = ERROR_SUCCESS, col_count = 0;
MSIRECORD *expanded; MSIRECORD *expanded;
...@@ -158,7 +158,7 @@ static UINT SELECT_set_row( struct tagMSIVIEW *view, UINT row, MSIRECORD *rec, U ...@@ -158,7 +158,7 @@ static UINT SELECT_set_row( struct tagMSIVIEW *view, UINT row, MSIRECORD *rec, U
static UINT SELECT_insert_row( struct tagMSIVIEW *view, MSIRECORD *record, UINT row, BOOL temporary ) static UINT SELECT_insert_row( struct tagMSIVIEW *view, MSIRECORD *record, UINT row, BOOL temporary )
{ {
MSISELECTVIEW *sv = (MSISELECTVIEW*)view; struct select_view *sv = (struct select_view *)view;
UINT table_cols, r; UINT table_cols, r;
MSIRECORD *outrec; MSIRECORD *outrec;
...@@ -183,7 +183,7 @@ static UINT SELECT_insert_row( struct tagMSIVIEW *view, MSIRECORD *record, UINT ...@@ -183,7 +183,7 @@ static UINT SELECT_insert_row( struct tagMSIVIEW *view, MSIRECORD *record, UINT
static UINT SELECT_execute( struct tagMSIVIEW *view, MSIRECORD *record ) static UINT SELECT_execute( struct tagMSIVIEW *view, MSIRECORD *record )
{ {
MSISELECTVIEW *sv = (MSISELECTVIEW*)view; struct select_view *sv = (struct select_view *)view;
TRACE("%p %p\n", sv, record); TRACE("%p %p\n", sv, record);
...@@ -195,7 +195,7 @@ static UINT SELECT_execute( struct tagMSIVIEW *view, MSIRECORD *record ) ...@@ -195,7 +195,7 @@ static UINT SELECT_execute( struct tagMSIVIEW *view, MSIRECORD *record )
static UINT SELECT_close( struct tagMSIVIEW *view ) static UINT SELECT_close( struct tagMSIVIEW *view )
{ {
MSISELECTVIEW *sv = (MSISELECTVIEW*)view; struct select_view *sv = (struct select_view *)view;
TRACE("%p\n", sv ); TRACE("%p\n", sv );
...@@ -207,7 +207,7 @@ static UINT SELECT_close( struct tagMSIVIEW *view ) ...@@ -207,7 +207,7 @@ static UINT SELECT_close( struct tagMSIVIEW *view )
static UINT SELECT_get_dimensions( struct tagMSIVIEW *view, UINT *rows, UINT *cols ) static UINT SELECT_get_dimensions( struct tagMSIVIEW *view, UINT *rows, UINT *cols )
{ {
MSISELECTVIEW *sv = (MSISELECTVIEW*)view; struct select_view *sv = (struct select_view *)view;
TRACE("%p %p %p\n", sv, rows, cols ); TRACE("%p %p %p\n", sv, rows, cols );
...@@ -223,7 +223,7 @@ static UINT SELECT_get_dimensions( struct tagMSIVIEW *view, UINT *rows, UINT *co ...@@ -223,7 +223,7 @@ static UINT SELECT_get_dimensions( struct tagMSIVIEW *view, UINT *rows, UINT *co
static UINT SELECT_get_column_info( struct tagMSIVIEW *view, UINT n, LPCWSTR *name, static UINT SELECT_get_column_info( struct tagMSIVIEW *view, UINT n, LPCWSTR *name,
UINT *type, BOOL *temporary, LPCWSTR *table_name ) UINT *type, BOOL *temporary, LPCWSTR *table_name )
{ {
MSISELECTVIEW *sv = (MSISELECTVIEW*)view; struct select_view *sv = (struct select_view *)view;
TRACE("%p %d %p %p %p %p\n", sv, n, name, type, temporary, table_name ); TRACE("%p %d %p %p %p %p\n", sv, n, name, type, temporary, table_name );
...@@ -248,7 +248,7 @@ static UINT SELECT_get_column_info( struct tagMSIVIEW *view, UINT n, LPCWSTR *na ...@@ -248,7 +248,7 @@ static UINT SELECT_get_column_info( struct tagMSIVIEW *view, UINT n, LPCWSTR *na
UINT msi_select_update(MSIVIEW *view, MSIRECORD *rec, UINT row) UINT msi_select_update(MSIVIEW *view, MSIRECORD *rec, UINT row)
{ {
MSISELECTVIEW *sv = (MSISELECTVIEW*)view; struct select_view *sv = (struct select_view *)view;
UINT r, i, col, type, val; UINT r, i, col, type, val;
IStream *stream; IStream *stream;
LPCWSTR str; LPCWSTR str;
...@@ -295,7 +295,7 @@ UINT msi_select_update(MSIVIEW *view, MSIRECORD *rec, UINT row) ...@@ -295,7 +295,7 @@ UINT msi_select_update(MSIVIEW *view, MSIRECORD *rec, UINT row)
static UINT SELECT_modify( struct tagMSIVIEW *view, MSIMODIFY mode, static UINT SELECT_modify( struct tagMSIVIEW *view, MSIMODIFY mode,
MSIRECORD *rec, UINT row ) MSIRECORD *rec, UINT row )
{ {
MSISELECTVIEW *sv = (MSISELECTVIEW*)view; struct select_view *sv = (struct select_view *)view;
MSIRECORD *table_rec; MSIRECORD *table_rec;
UINT r; UINT r;
...@@ -336,7 +336,7 @@ static UINT SELECT_modify( struct tagMSIVIEW *view, MSIMODIFY mode, ...@@ -336,7 +336,7 @@ static UINT SELECT_modify( struct tagMSIVIEW *view, MSIMODIFY mode,
static UINT SELECT_delete( struct tagMSIVIEW *view ) static UINT SELECT_delete( struct tagMSIVIEW *view )
{ {
MSISELECTVIEW *sv = (MSISELECTVIEW*)view; struct select_view *sv = (struct select_view *)view;
TRACE("%p\n", sv ); TRACE("%p\n", sv );
...@@ -372,8 +372,7 @@ static const MSIVIEWOPS select_ops = ...@@ -372,8 +372,7 @@ static const MSIVIEWOPS select_ops =
NULL, NULL,
}; };
static UINT SELECT_AddColumn( MSISELECTVIEW *sv, LPCWSTR name, static UINT SELECT_AddColumn( struct select_view *sv, const WCHAR *name, const WCHAR *table_name )
LPCWSTR table_name )
{ {
UINT r, n; UINT r, n;
MSIVIEW *table; MSIVIEW *table;
...@@ -423,14 +422,14 @@ static int select_count_columns( const column_info *col ) ...@@ -423,14 +422,14 @@ static int select_count_columns( const column_info *col )
UINT SELECT_CreateView( MSIDATABASE *db, MSIVIEW **view, MSIVIEW *table, UINT SELECT_CreateView( MSIDATABASE *db, MSIVIEW **view, MSIVIEW *table,
const column_info *columns ) const column_info *columns )
{ {
MSISELECTVIEW *sv = NULL; struct select_view *sv = NULL;
UINT count = 0, r = ERROR_SUCCESS; UINT count = 0, r = ERROR_SUCCESS;
TRACE("%p\n", sv ); TRACE("%p\n", sv );
count = select_count_columns( columns ); count = select_count_columns( columns );
sv = calloc( 1, offsetof( MSISELECTVIEW, cols[count] ) ); sv = calloc( 1, offsetof( struct select_view, cols[count] ) );
if( !sv ) if( !sv )
return ERROR_FUNCTION_FAILED; return ERROR_FUNCTION_FAILED;
......
...@@ -42,13 +42,13 @@ WINE_DEFAULT_DEBUG_CHANNEL(msi); ...@@ -42,13 +42,13 @@ WINE_DEFAULT_DEBUG_CHANNEL(msi);
* These apis are defined in MSI 3.0 * These apis are defined in MSI 3.0
*/ */
typedef struct tagMediaInfo struct media_info
{ {
struct list entry; struct list entry;
LPWSTR path; LPWSTR path;
WCHAR szIndex[10]; WCHAR szIndex[10];
DWORD index; DWORD index;
} media_info; };
static UINT OpenSourceKey(LPCWSTR szProduct, HKEY* key, DWORD dwOptions, static UINT OpenSourceKey(LPCWSTR szProduct, HKEY* key, DWORD dwOptions,
MSIINSTALLCONTEXT context, BOOL create) MSIINSTALLCONTEXT context, BOOL create)
...@@ -937,17 +937,16 @@ static void free_source_list(struct list *sourcelist) ...@@ -937,17 +937,16 @@ static void free_source_list(struct list *sourcelist)
{ {
while (!list_empty(sourcelist)) while (!list_empty(sourcelist))
{ {
media_info *info = LIST_ENTRY(list_head(sourcelist), media_info, entry); struct media_info *info = LIST_ENTRY(list_head(sourcelist), struct media_info, entry);
list_remove(&info->entry); list_remove(&info->entry);
free(info->path); free(info->path);
free(info); free(info);
} }
} }
static void add_source_to_list(struct list *sourcelist, media_info *info, static void add_source_to_list(struct list *sourcelist, struct media_info *info, DWORD *index)
DWORD *index)
{ {
media_info *iter; struct media_info *iter;
BOOL found = FALSE; BOOL found = FALSE;
if (index) *index = 0; if (index) *index = 0;
...@@ -958,7 +957,7 @@ static void add_source_to_list(struct list *sourcelist, media_info *info, ...@@ -958,7 +957,7 @@ static void add_source_to_list(struct list *sourcelist, media_info *info,
return; return;
} }
LIST_FOR_EACH_ENTRY(iter, sourcelist, media_info, entry) LIST_FOR_EACH_ENTRY(iter, sourcelist, struct media_info, entry)
{ {
if (!found && info->index < iter->index) if (!found && info->index < iter->index)
{ {
...@@ -983,7 +982,7 @@ static UINT fill_source_list(struct list *sourcelist, HKEY sourcekey, DWORD *cou ...@@ -983,7 +982,7 @@ static UINT fill_source_list(struct list *sourcelist, HKEY sourcekey, DWORD *cou
DWORD index = 0; DWORD index = 0;
WCHAR name[10]; WCHAR name[10];
DWORD size, val_size; DWORD size, val_size;
media_info *entry; struct media_info *entry;
*count = 0; *count = 0;
...@@ -994,7 +993,7 @@ static UINT fill_source_list(struct list *sourcelist, HKEY sourcekey, DWORD *cou ...@@ -994,7 +993,7 @@ static UINT fill_source_list(struct list *sourcelist, HKEY sourcekey, DWORD *cou
if (r != ERROR_SUCCESS) if (r != ERROR_SUCCESS)
return r; return r;
entry = malloc(sizeof(media_info)); entry = malloc(sizeof(*entry));
if (!entry) if (!entry)
goto error; goto error;
...@@ -1037,7 +1036,7 @@ UINT WINAPI MsiSourceListAddSourceExW( const WCHAR *szProduct, const WCHAR *szUs ...@@ -1037,7 +1036,7 @@ UINT WINAPI MsiSourceListAddSourceExW( const WCHAR *szProduct, const WCHAR *szUs
HKEY sourcekey, typekey; HKEY sourcekey, typekey;
UINT rc; UINT rc;
struct list sourcelist; struct list sourcelist;
media_info *info; struct media_info *info;
WCHAR *source, squashed_pc[SQUASHED_GUID_SIZE], name[10]; WCHAR *source, squashed_pc[SQUASHED_GUID_SIZE], name[10];
LPCWSTR postfix; LPCWSTR postfix;
DWORD size, count, index; DWORD size, count, index;
...@@ -1118,7 +1117,7 @@ UINT WINAPI MsiSourceListAddSourceExW( const WCHAR *szProduct, const WCHAR *szUs ...@@ -1118,7 +1117,7 @@ UINT WINAPI MsiSourceListAddSourceExW( const WCHAR *szProduct, const WCHAR *szUs
else else
{ {
swprintf(name, ARRAY_SIZE(name), L"%d", dwIndex); swprintf(name, ARRAY_SIZE(name), L"%d", dwIndex);
info = malloc(sizeof(media_info)); info = malloc(sizeof(*info));
if (!info) if (!info)
{ {
rc = ERROR_OUTOFMEMORY; rc = ERROR_OUTOFMEMORY;
...@@ -1130,7 +1129,7 @@ UINT WINAPI MsiSourceListAddSourceExW( const WCHAR *szProduct, const WCHAR *szUs ...@@ -1130,7 +1129,7 @@ UINT WINAPI MsiSourceListAddSourceExW( const WCHAR *szProduct, const WCHAR *szUs
info->index = dwIndex; info->index = dwIndex;
add_source_to_list(&sourcelist, info, &index); add_source_to_list(&sourcelist, info, &index);
LIST_FOR_EACH_ENTRY(info, &sourcelist, media_info, entry) LIST_FOR_EACH_ENTRY(info, &sourcelist, struct media_info, entry)
{ {
if (info->index < index) if (info->index < index)
continue; continue;
......
...@@ -40,23 +40,23 @@ WINE_DEFAULT_DEBUG_CHANNEL(msidb); ...@@ -40,23 +40,23 @@ WINE_DEFAULT_DEBUG_CHANNEL(msidb);
#define NUM_STORAGES_COLS 2 #define NUM_STORAGES_COLS 2
#define MAX_STORAGES_NAME_LEN 62 #define MAX_STORAGES_NAME_LEN 62
typedef struct tabSTORAGE struct storage
{ {
UINT str_index; UINT str_index;
IStorage *storage; IStorage *storage;
} STORAGE; } STORAGE;
typedef struct tagMSISTORAGESVIEW struct storages_view
{ {
MSIVIEW view; MSIVIEW view;
MSIDATABASE *db; MSIDATABASE *db;
STORAGE *storages; struct storage *storages;
UINT max_storages; UINT max_storages;
UINT num_rows; UINT num_rows;
UINT row_size; UINT row_size;
} MSISTORAGESVIEW; };
static BOOL storages_set_table_size(MSISTORAGESVIEW *sv, UINT size) static BOOL storages_set_table_size(struct storages_view *sv, UINT size)
{ {
if (size >= sv->max_storages) if (size >= sv->max_storages)
{ {
...@@ -71,7 +71,7 @@ static BOOL storages_set_table_size(MSISTORAGESVIEW *sv, UINT size) ...@@ -71,7 +71,7 @@ static BOOL storages_set_table_size(MSISTORAGESVIEW *sv, UINT size)
static UINT STORAGES_fetch_int(struct tagMSIVIEW *view, UINT row, UINT col, UINT *val) static UINT STORAGES_fetch_int(struct tagMSIVIEW *view, UINT row, UINT col, UINT *val)
{ {
MSISTORAGESVIEW *sv = (MSISTORAGESVIEW *)view; struct storages_view *sv = (struct storages_view *)view;
TRACE("(%p, %d, %d, %p)\n", view, row, col, val); TRACE("(%p, %d, %d, %p)\n", view, row, col, val);
...@@ -88,7 +88,7 @@ static UINT STORAGES_fetch_int(struct tagMSIVIEW *view, UINT row, UINT col, UINT ...@@ -88,7 +88,7 @@ static UINT STORAGES_fetch_int(struct tagMSIVIEW *view, UINT row, UINT col, UINT
static UINT STORAGES_fetch_stream(struct tagMSIVIEW *view, UINT row, UINT col, IStream **stm) static UINT STORAGES_fetch_stream(struct tagMSIVIEW *view, UINT row, UINT col, IStream **stm)
{ {
MSISTORAGESVIEW *sv = (MSISTORAGESVIEW *)view; struct storages_view *sv = (struct storages_view *)view;
TRACE("(%p, %d, %d, %p)\n", view, row, col, stm); TRACE("(%p, %d, %d, %p)\n", view, row, col, stm);
...@@ -155,7 +155,7 @@ done: ...@@ -155,7 +155,7 @@ done:
static UINT STORAGES_set_stream( MSIVIEW *view, UINT row, UINT col, IStream *stream ) static UINT STORAGES_set_stream( MSIVIEW *view, UINT row, UINT col, IStream *stream )
{ {
MSISTORAGESVIEW *sv = (MSISTORAGESVIEW *)view; struct storages_view *sv = (struct storages_view *)view;
IStorage *stg, *substg, *prev; IStorage *stg, *substg, *prev;
const WCHAR *name; const WCHAR *name;
HRESULT hr; HRESULT hr;
...@@ -195,7 +195,7 @@ static UINT STORAGES_set_stream( MSIVIEW *view, UINT row, UINT col, IStream *str ...@@ -195,7 +195,7 @@ static UINT STORAGES_set_stream( MSIVIEW *view, UINT row, UINT col, IStream *str
static UINT STORAGES_set_row(struct tagMSIVIEW *view, UINT row, MSIRECORD *rec, UINT mask) static UINT STORAGES_set_row(struct tagMSIVIEW *view, UINT row, MSIRECORD *rec, UINT mask)
{ {
MSISTORAGESVIEW *sv = (MSISTORAGESVIEW *)view; struct storages_view *sv = (struct storages_view *)view;
IStorage *stg, *substg = NULL, *prev; IStorage *stg, *substg = NULL, *prev;
IStream *stm; IStream *stm;
LPWSTR name = NULL; LPWSTR name = NULL;
...@@ -259,7 +259,7 @@ done: ...@@ -259,7 +259,7 @@ done:
static UINT STORAGES_insert_row(struct tagMSIVIEW *view, MSIRECORD *rec, UINT row, BOOL temporary) static UINT STORAGES_insert_row(struct tagMSIVIEW *view, MSIRECORD *rec, UINT row, BOOL temporary)
{ {
MSISTORAGESVIEW *sv = (MSISTORAGESVIEW *)view; struct storages_view *sv = (struct storages_view *)view;
if (!storages_set_table_size(sv, ++sv->num_rows)) if (!storages_set_table_size(sv, ++sv->num_rows))
return ERROR_FUNCTION_FAILED; return ERROR_FUNCTION_FAILED;
...@@ -294,7 +294,7 @@ static UINT STORAGES_close(struct tagMSIVIEW *view) ...@@ -294,7 +294,7 @@ static UINT STORAGES_close(struct tagMSIVIEW *view)
static UINT STORAGES_get_dimensions(struct tagMSIVIEW *view, UINT *rows, UINT *cols) static UINT STORAGES_get_dimensions(struct tagMSIVIEW *view, UINT *rows, UINT *cols)
{ {
MSISTORAGESVIEW *sv = (MSISTORAGESVIEW *)view; struct storages_view *sv = (struct storages_view *)view;
TRACE("(%p, %p, %p)\n", view, rows, cols); TRACE("(%p, %p, %p)\n", view, rows, cols);
...@@ -330,7 +330,7 @@ static UINT STORAGES_get_column_info( struct tagMSIVIEW *view, UINT n, LPCWSTR * ...@@ -330,7 +330,7 @@ static UINT STORAGES_get_column_info( struct tagMSIVIEW *view, UINT n, LPCWSTR *
return ERROR_SUCCESS; return ERROR_SUCCESS;
} }
static UINT storages_find_row(MSISTORAGESVIEW *sv, MSIRECORD *rec, UINT *row) static UINT storages_find_row(struct storages_view *sv, MSIRECORD *rec, UINT *row)
{ {
LPCWSTR str; LPCWSTR str;
UINT r, i, id, data; UINT r, i, id, data;
...@@ -356,7 +356,7 @@ static UINT storages_find_row(MSISTORAGESVIEW *sv, MSIRECORD *rec, UINT *row) ...@@ -356,7 +356,7 @@ static UINT storages_find_row(MSISTORAGESVIEW *sv, MSIRECORD *rec, UINT *row)
static UINT storages_modify_update(struct tagMSIVIEW *view, MSIRECORD *rec) static UINT storages_modify_update(struct tagMSIVIEW *view, MSIRECORD *rec)
{ {
MSISTORAGESVIEW *sv = (MSISTORAGESVIEW *)view; struct storages_view *sv = (struct storages_view *)view;
UINT r, row; UINT r, row;
r = storages_find_row(sv, rec, &row); r = storages_find_row(sv, rec, &row);
...@@ -368,7 +368,7 @@ static UINT storages_modify_update(struct tagMSIVIEW *view, MSIRECORD *rec) ...@@ -368,7 +368,7 @@ static UINT storages_modify_update(struct tagMSIVIEW *view, MSIRECORD *rec)
static UINT storages_modify_assign(struct tagMSIVIEW *view, MSIRECORD *rec) static UINT storages_modify_assign(struct tagMSIVIEW *view, MSIRECORD *rec)
{ {
MSISTORAGESVIEW *sv = (MSISTORAGESVIEW *)view; struct storages_view *sv = (struct storages_view *)view;
UINT r, row; UINT r, row;
r = storages_find_row(sv, rec, &row); r = storages_find_row(sv, rec, &row);
...@@ -420,7 +420,7 @@ static UINT STORAGES_modify(struct tagMSIVIEW *view, MSIMODIFY eModifyMode, MSIR ...@@ -420,7 +420,7 @@ static UINT STORAGES_modify(struct tagMSIVIEW *view, MSIMODIFY eModifyMode, MSIR
static UINT STORAGES_delete(struct tagMSIVIEW *view) static UINT STORAGES_delete(struct tagMSIVIEW *view)
{ {
MSISTORAGESVIEW *sv = (MSISTORAGESVIEW *)view; struct storages_view *sv = (struct storages_view *)view;
UINT i; UINT i;
TRACE("(%p)\n", view); TRACE("(%p)\n", view);
...@@ -461,7 +461,7 @@ static const MSIVIEWOPS storages_ops = ...@@ -461,7 +461,7 @@ static const MSIVIEWOPS storages_ops =
NULL, NULL,
}; };
static INT add_storages_to_table(MSISTORAGESVIEW *sv) static INT add_storages_to_table(struct storages_view *sv)
{ {
IEnumSTATSTG *stgenum = NULL; IEnumSTATSTG *stgenum = NULL;
STATSTG stat; STATSTG stat;
...@@ -514,12 +514,12 @@ static INT add_storages_to_table(MSISTORAGESVIEW *sv) ...@@ -514,12 +514,12 @@ static INT add_storages_to_table(MSISTORAGESVIEW *sv)
UINT STORAGES_CreateView(MSIDATABASE *db, MSIVIEW **view) UINT STORAGES_CreateView(MSIDATABASE *db, MSIVIEW **view)
{ {
MSISTORAGESVIEW *sv; struct storages_view *sv;
INT rows; INT rows;
TRACE("(%p, %p)\n", db, view); TRACE("(%p, %p)\n", db, view);
sv = calloc(1, sizeof(MSISTORAGESVIEW)); sv = calloc(1, sizeof(*sv));
if (!sv) if (!sv)
return ERROR_FUNCTION_FAILED; return ERROR_FUNCTION_FAILED;
......
...@@ -38,12 +38,12 @@ WINE_DEFAULT_DEBUG_CHANNEL(msidb); ...@@ -38,12 +38,12 @@ WINE_DEFAULT_DEBUG_CHANNEL(msidb);
#define NUM_STREAMS_COLS 2 #define NUM_STREAMS_COLS 2
typedef struct tagMSISTREAMSVIEW struct streams_view
{ {
MSIVIEW view; MSIVIEW view;
MSIDATABASE *db; MSIDATABASE *db;
UINT num_cols; UINT num_cols;
} MSISTREAMSVIEW; };
static BOOL streams_resize_table( MSIDATABASE *db, UINT size ) static BOOL streams_resize_table( MSIDATABASE *db, UINT size )
{ {
...@@ -67,7 +67,7 @@ static BOOL streams_resize_table( MSIDATABASE *db, UINT size ) ...@@ -67,7 +67,7 @@ static BOOL streams_resize_table( MSIDATABASE *db, UINT size )
static UINT STREAMS_fetch_int(struct tagMSIVIEW *view, UINT row, UINT col, UINT *val) static UINT STREAMS_fetch_int(struct tagMSIVIEW *view, UINT row, UINT col, UINT *val)
{ {
MSISTREAMSVIEW *sv = (MSISTREAMSVIEW *)view; struct streams_view *sv = (struct streams_view *)view;
TRACE("(%p, %d, %d, %p)\n", view, row, col, val); TRACE("(%p, %d, %d, %p)\n", view, row, col, val);
...@@ -84,7 +84,7 @@ static UINT STREAMS_fetch_int(struct tagMSIVIEW *view, UINT row, UINT col, UINT ...@@ -84,7 +84,7 @@ static UINT STREAMS_fetch_int(struct tagMSIVIEW *view, UINT row, UINT col, UINT
static UINT STREAMS_fetch_stream(struct tagMSIVIEW *view, UINT row, UINT col, IStream **stm) static UINT STREAMS_fetch_stream(struct tagMSIVIEW *view, UINT row, UINT col, IStream **stm)
{ {
MSISTREAMSVIEW *sv = (MSISTREAMSVIEW *)view; struct streams_view *sv = (struct streams_view *)view;
LARGE_INTEGER pos; LARGE_INTEGER pos;
HRESULT hr; HRESULT hr;
...@@ -112,7 +112,7 @@ static UINT STREAMS_set_string( struct tagMSIVIEW *view, UINT row, UINT col, con ...@@ -112,7 +112,7 @@ static UINT STREAMS_set_string( struct tagMSIVIEW *view, UINT row, UINT col, con
static UINT STREAMS_set_stream( MSIVIEW *view, UINT row, UINT col, IStream *stream ) static UINT STREAMS_set_stream( MSIVIEW *view, UINT row, UINT col, IStream *stream )
{ {
MSISTREAMSVIEW *sv = (MSISTREAMSVIEW *)view; struct streams_view *sv = (struct streams_view *)view;
IStream *prev; IStream *prev;
TRACE("view %p, row %u, col %u, stream %p.\n", view, row, col, stream); TRACE("view %p, row %u, col %u, stream %p.\n", view, row, col, stream);
...@@ -125,7 +125,7 @@ static UINT STREAMS_set_stream( MSIVIEW *view, UINT row, UINT col, IStream *stre ...@@ -125,7 +125,7 @@ static UINT STREAMS_set_stream( MSIVIEW *view, UINT row, UINT col, IStream *stre
static UINT STREAMS_set_row(struct tagMSIVIEW *view, UINT row, MSIRECORD *rec, UINT mask) static UINT STREAMS_set_row(struct tagMSIVIEW *view, UINT row, MSIRECORD *rec, UINT mask)
{ {
MSISTREAMSVIEW *sv = (MSISTREAMSVIEW *)view; struct streams_view *sv = (struct streams_view *)view;
TRACE("(%p, %d, %p, %08x)\n", view, row, rec, mask); TRACE("(%p, %d, %p, %08x)\n", view, row, rec, mask);
...@@ -162,7 +162,7 @@ static UINT STREAMS_set_row(struct tagMSIVIEW *view, UINT row, MSIRECORD *rec, U ...@@ -162,7 +162,7 @@ static UINT STREAMS_set_row(struct tagMSIVIEW *view, UINT row, MSIRECORD *rec, U
return ERROR_SUCCESS; return ERROR_SUCCESS;
} }
static UINT streams_find_row( MSISTREAMSVIEW *sv, MSIRECORD *rec, UINT *row ) static UINT streams_find_row( struct streams_view *sv, MSIRECORD *rec, UINT *row )
{ {
const WCHAR *str; const WCHAR *str;
UINT r, i, id, val; UINT r, i, id, val;
...@@ -188,7 +188,7 @@ static UINT streams_find_row( MSISTREAMSVIEW *sv, MSIRECORD *rec, UINT *row ) ...@@ -188,7 +188,7 @@ static UINT streams_find_row( MSISTREAMSVIEW *sv, MSIRECORD *rec, UINT *row )
static UINT STREAMS_insert_row(struct tagMSIVIEW *view, MSIRECORD *rec, UINT row, BOOL temporary) static UINT STREAMS_insert_row(struct tagMSIVIEW *view, MSIRECORD *rec, UINT row, BOOL temporary)
{ {
MSISTREAMSVIEW *sv = (MSISTREAMSVIEW *)view; struct streams_view *sv = (struct streams_view *)view;
UINT i, r, num_rows = sv->db->num_streams + 1; UINT i, r, num_rows = sv->db->num_streams + 1;
TRACE("(%p, %p, %d, %d)\n", view, rec, row, temporary); TRACE("(%p, %p, %d, %d)\n", view, rec, row, temporary);
...@@ -218,7 +218,7 @@ static UINT STREAMS_insert_row(struct tagMSIVIEW *view, MSIRECORD *rec, UINT row ...@@ -218,7 +218,7 @@ static UINT STREAMS_insert_row(struct tagMSIVIEW *view, MSIRECORD *rec, UINT row
static UINT STREAMS_delete_row(struct tagMSIVIEW *view, UINT row) static UINT STREAMS_delete_row(struct tagMSIVIEW *view, UINT row)
{ {
MSIDATABASE *db = ((MSISTREAMSVIEW *)view)->db; MSIDATABASE *db = ((struct streams_view *)view)->db;
UINT i, num_rows = db->num_streams - 1; UINT i, num_rows = db->num_streams - 1;
const WCHAR *name; const WCHAR *name;
WCHAR *encname; WCHAR *encname;
...@@ -256,7 +256,7 @@ static UINT STREAMS_close(struct tagMSIVIEW *view) ...@@ -256,7 +256,7 @@ static UINT STREAMS_close(struct tagMSIVIEW *view)
static UINT STREAMS_get_dimensions(struct tagMSIVIEW *view, UINT *rows, UINT *cols) static UINT STREAMS_get_dimensions(struct tagMSIVIEW *view, UINT *rows, UINT *cols)
{ {
MSISTREAMSVIEW *sv = (MSISTREAMSVIEW *)view; struct streams_view *sv = (struct streams_view *)view;
TRACE("(%p, %p, %p)\n", view, rows, cols); TRACE("(%p, %p, %p)\n", view, rows, cols);
...@@ -269,7 +269,7 @@ static UINT STREAMS_get_dimensions(struct tagMSIVIEW *view, UINT *rows, UINT *co ...@@ -269,7 +269,7 @@ static UINT STREAMS_get_dimensions(struct tagMSIVIEW *view, UINT *rows, UINT *co
static UINT STREAMS_get_column_info( struct tagMSIVIEW *view, UINT n, LPCWSTR *name, static UINT STREAMS_get_column_info( struct tagMSIVIEW *view, UINT n, LPCWSTR *name,
UINT *type, BOOL *temporary, LPCWSTR *table_name ) UINT *type, BOOL *temporary, LPCWSTR *table_name )
{ {
MSISTREAMSVIEW *sv = (MSISTREAMSVIEW *)view; struct streams_view *sv = (struct streams_view *)view;
TRACE("(%p, %d, %p, %p, %p, %p)\n", view, n, name, type, temporary, table_name); TRACE("(%p, %d, %p, %p, %p, %p)\n", view, n, name, type, temporary, table_name);
...@@ -295,7 +295,7 @@ static UINT STREAMS_get_column_info( struct tagMSIVIEW *view, UINT n, LPCWSTR *n ...@@ -295,7 +295,7 @@ static UINT STREAMS_get_column_info( struct tagMSIVIEW *view, UINT n, LPCWSTR *n
static UINT streams_modify_update(struct tagMSIVIEW *view, MSIRECORD *rec) static UINT streams_modify_update(struct tagMSIVIEW *view, MSIRECORD *rec)
{ {
MSISTREAMSVIEW *sv = (MSISTREAMSVIEW *)view; struct streams_view *sv = (struct streams_view *)view;
UINT r, row; UINT r, row;
r = streams_find_row(sv, rec, &row); r = streams_find_row(sv, rec, &row);
...@@ -307,7 +307,7 @@ static UINT streams_modify_update(struct tagMSIVIEW *view, MSIRECORD *rec) ...@@ -307,7 +307,7 @@ static UINT streams_modify_update(struct tagMSIVIEW *view, MSIRECORD *rec)
static UINT streams_modify_assign(struct tagMSIVIEW *view, MSIRECORD *rec) static UINT streams_modify_assign(struct tagMSIVIEW *view, MSIRECORD *rec)
{ {
MSISTREAMSVIEW *sv = (MSISTREAMSVIEW *)view; struct streams_view *sv = (struct streams_view *)view;
UINT r; UINT r;
r = streams_find_row( sv, rec, NULL ); r = streams_find_row( sv, rec, NULL );
...@@ -362,7 +362,7 @@ static UINT STREAMS_modify(struct tagMSIVIEW *view, MSIMODIFY eModifyMode, MSIRE ...@@ -362,7 +362,7 @@ static UINT STREAMS_modify(struct tagMSIVIEW *view, MSIMODIFY eModifyMode, MSIRE
static UINT STREAMS_delete(struct tagMSIVIEW *view) static UINT STREAMS_delete(struct tagMSIVIEW *view)
{ {
MSISTREAMSVIEW *sv = (MSISTREAMSVIEW *)view; struct streams_view *sv = (struct streams_view *)view;
TRACE("(%p)\n", view); TRACE("(%p)\n", view);
...@@ -538,7 +538,7 @@ UINT msi_get_stream( MSIDATABASE *db, const WCHAR *name, IStream **ret ) ...@@ -538,7 +538,7 @@ UINT msi_get_stream( MSIDATABASE *db, const WCHAR *name, IStream **ret )
UINT STREAMS_CreateView(MSIDATABASE *db, MSIVIEW **view) UINT STREAMS_CreateView(MSIDATABASE *db, MSIVIEW **view)
{ {
MSISTREAMSVIEW *sv; struct streams_view *sv;
UINT r; UINT r;
TRACE("(%p, %p)\n", db, view); TRACE("(%p, %p)\n", db, view);
...@@ -547,7 +547,7 @@ UINT STREAMS_CreateView(MSIDATABASE *db, MSIVIEW **view) ...@@ -547,7 +547,7 @@ UINT STREAMS_CreateView(MSIDATABASE *db, MSIVIEW **view)
if (r != ERROR_SUCCESS) if (r != ERROR_SUCCESS)
return r; return r;
if (!(sv = calloc( 1, sizeof(MSISTREAMSVIEW) ))) if (!(sv = calloc( 1, sizeof(*sv) )))
return ERROR_OUTOFMEMORY; return ERROR_OUTOFMEMORY;
sv->view.ops = &streams_ops; sv->view.ops = &streams_ops;
......
...@@ -44,30 +44,35 @@ WINE_DEFAULT_DEBUG_CHANNEL(msi); ...@@ -44,30 +44,35 @@ WINE_DEFAULT_DEBUG_CHANNEL(msi);
#include "pshpack1.h" #include "pshpack1.h"
typedef struct { struct property_set_header
{
WORD wByteOrder; WORD wByteOrder;
WORD wFormat; WORD wFormat;
DWORD dwOSVer; DWORD dwOSVer;
CLSID clsID; CLSID clsID;
DWORD reserved; DWORD reserved;
} PROPERTYSETHEADER; };
typedef struct { struct format_id_offset
{
FMTID fmtid; FMTID fmtid;
DWORD dwOffset; DWORD dwOffset;
} FORMATIDOFFSET; };
typedef struct { struct property_section_header
{
DWORD cbSection; DWORD cbSection;
DWORD cProperties; DWORD cProperties;
} PROPERTYSECTIONHEADER; };
typedef struct { struct property_id_offset
{
DWORD propid; DWORD propid;
DWORD dwOffset; DWORD dwOffset;
} PROPERTYIDOFFSET; };
typedef struct { struct property_data
{
DWORD type; DWORD type;
union { union {
INT i4; INT i4;
...@@ -78,7 +83,7 @@ typedef struct { ...@@ -78,7 +83,7 @@ typedef struct {
BYTE str[1]; BYTE str[1];
} str; } str;
} u; } u;
} PROPERTY_DATA; };
#include "poppack.h" #include "poppack.h"
...@@ -86,7 +91,7 @@ static HRESULT (WINAPI *pPropVariantChangeType) ...@@ -86,7 +91,7 @@ static HRESULT (WINAPI *pPropVariantChangeType)
(PROPVARIANT *ppropvarDest, REFPROPVARIANT propvarSrc, (PROPVARIANT *ppropvarDest, REFPROPVARIANT propvarSrc,
PROPVAR_CHANGE_FLAGS flags, VARTYPE vt); PROPVAR_CHANGE_FLAGS flags, VARTYPE vt);
#define SECT_HDR_SIZE (sizeof(PROPERTYSECTIONHEADER)) #define SECT_HDR_SIZE (sizeof(struct property_section_header))
static void free_prop( PROPVARIANT *prop ) static void free_prop( PROPVARIANT *prop )
{ {
...@@ -170,14 +175,14 @@ static void read_properties_from_data( PROPVARIANT *prop, LPBYTE data, DWORD sz ...@@ -170,14 +175,14 @@ static void read_properties_from_data( PROPVARIANT *prop, LPBYTE data, DWORD sz
{ {
UINT type; UINT type;
DWORD i, size; DWORD i, size;
PROPERTY_DATA *propdata; struct property_data *propdata;
PROPVARIANT property, *ptr; PROPVARIANT property, *ptr;
PROPVARIANT changed; PROPVARIANT changed;
PROPERTYIDOFFSET *idofs; struct property_id_offset *idofs;
PROPERTYSECTIONHEADER *section_hdr; struct property_section_header *section_hdr;
section_hdr = (PROPERTYSECTIONHEADER*) &data[0]; section_hdr = (struct property_section_header *) &data[0];
idofs = (PROPERTYIDOFFSET*) &data[SECT_HDR_SIZE]; idofs = (struct property_id_offset *)&data[SECT_HDR_SIZE];
/* now set all the properties */ /* now set all the properties */
for( i = 0; i < section_hdr->cProperties; i++ ) for( i = 0; i < section_hdr->cProperties; i++ )
...@@ -195,7 +200,7 @@ static void read_properties_from_data( PROPVARIANT *prop, LPBYTE data, DWORD sz ...@@ -195,7 +200,7 @@ static void read_properties_from_data( PROPVARIANT *prop, LPBYTE data, DWORD sz
break; break;
} }
propdata = (PROPERTY_DATA*) &data[ idofs[i].dwOffset ]; propdata = (struct property_data *)&data[ idofs[i].dwOffset ];
/* check we don't run off the end of the data */ /* check we don't run off the end of the data */
size = sz - idofs[i].dwOffset - sizeof(DWORD); size = sz - idofs[i].dwOffset - sizeof(DWORD);
...@@ -237,9 +242,9 @@ static void read_properties_from_data( PROPVARIANT *prop, LPBYTE data, DWORD sz ...@@ -237,9 +242,9 @@ static void read_properties_from_data( PROPVARIANT *prop, LPBYTE data, DWORD sz
static UINT load_summary_info( MSISUMMARYINFO *si, IStream *stm ) static UINT load_summary_info( MSISUMMARYINFO *si, IStream *stm )
{ {
PROPERTYSETHEADER set_hdr; struct property_set_header set_hdr;
FORMATIDOFFSET format_hdr; struct format_id_offset format_hdr;
PROPERTYSECTIONHEADER section_hdr; struct property_section_header section_hdr;
LPBYTE data = NULL; LPBYTE data = NULL;
LARGE_INTEGER ofs; LARGE_INTEGER ofs;
ULONG count, sz; ULONG count, sz;
...@@ -362,10 +367,10 @@ static UINT write_property_to_data( const PROPVARIANT *prop, LPBYTE data ) ...@@ -362,10 +367,10 @@ static UINT write_property_to_data( const PROPVARIANT *prop, LPBYTE data )
static UINT save_summary_info( const MSISUMMARYINFO * si, IStream *stm ) static UINT save_summary_info( const MSISUMMARYINFO * si, IStream *stm )
{ {
UINT ret = ERROR_FUNCTION_FAILED; UINT ret = ERROR_FUNCTION_FAILED;
PROPERTYSETHEADER set_hdr; struct property_set_header set_hdr;
FORMATIDOFFSET format_hdr; struct format_id_offset format_hdr;
PROPERTYSECTIONHEADER section_hdr; struct property_section_header section_hdr;
PROPERTYIDOFFSET idofs[MSI_MAX_PROPS]; struct property_id_offset idofs[MSI_MAX_PROPS];
LPBYTE data = NULL; LPBYTE data = NULL;
ULONG count, sz; ULONG count, sz;
HRESULT r; HRESULT r;
......
...@@ -29,8 +29,8 @@ ...@@ -29,8 +29,8 @@
** All the keywords of the SQL language are stored as in a hash ** All the keywords of the SQL language are stored as in a hash
** table composed of instances of the following structure. ** table composed of instances of the following structure.
*/ */
typedef struct Keyword Keyword; struct keyword
struct Keyword { {
const WCHAR *name; /* The keyword name */ const WCHAR *name; /* The keyword name */
unsigned int len; unsigned int len;
int tokenType; /* The token value for this keyword */ int tokenType; /* The token value for this keyword */
...@@ -43,7 +43,7 @@ struct Keyword { ...@@ -43,7 +43,7 @@ struct Keyword {
** They MUST be in alphabetical order ** They MUST be in alphabetical order
*/ */
#define X(str) str, ARRAY_SIZE(str) - 1 #define X(str) str, ARRAY_SIZE(str) - 1
static const Keyword aKeywordTable[] = { static const struct keyword aKeywordTable[] = {
{ X(L"ADD"), TK_ADD }, { X(L"ADD"), TK_ADD },
{ X(L"ALTER"), TK_ALTER }, { X(L"ALTER"), TK_ALTER },
{ X(L"AND"), TK_AND }, { X(L"AND"), TK_AND },
...@@ -88,7 +88,7 @@ static const Keyword aKeywordTable[] = { ...@@ -88,7 +88,7 @@ static const Keyword aKeywordTable[] = {
** Comparison function for binary search. ** Comparison function for binary search.
*/ */
static int __cdecl compKeyword(const void *m1, const void *m2){ static int __cdecl compKeyword(const void *m1, const void *m2){
const Keyword *k1 = m1, *k2 = m2; const struct keyword *k1 = m1, *k2 = m2;
int ret, len = min( k1->len, k2->len ); int ret, len = min( k1->len, k2->len );
if ((ret = wcsnicmp( k1->name, k2->name, len ))) return ret; if ((ret = wcsnicmp( k1->name, k2->name, len ))) return ret;
...@@ -103,7 +103,7 @@ static int __cdecl compKeyword(const void *m1, const void *m2){ ...@@ -103,7 +103,7 @@ static int __cdecl compKeyword(const void *m1, const void *m2){
** returned. If the input is not a keyword, TK_ID is returned. ** returned. If the input is not a keyword, TK_ID is returned.
*/ */
static int sqliteKeywordCode(const WCHAR *z, int n){ static int sqliteKeywordCode(const WCHAR *z, int n){
Keyword key, *r; struct keyword key, *r;
if( n>MAX_TOKEN_LEN ) if( n>MAX_TOKEN_LEN )
return TK_ID; return TK_ID;
...@@ -111,7 +111,7 @@ static int sqliteKeywordCode(const WCHAR *z, int n){ ...@@ -111,7 +111,7 @@ static int sqliteKeywordCode(const WCHAR *z, int n){
key.tokenType = 0; key.tokenType = 0;
key.name = z; key.name = z;
key.len = n; key.len = n;
r = bsearch( &key, aKeywordTable, ARRAY_SIZE(aKeywordTable), sizeof(Keyword), compKeyword ); r = bsearch( &key, aKeywordTable, ARRAY_SIZE(aKeywordTable), sizeof(struct keyword), compKeyword );
if( r ) if( r )
return r->tokenType; return r->tokenType;
return TK_ID; return TK_ID;
......
...@@ -38,17 +38,17 @@ WINE_DEFAULT_DEBUG_CHANNEL(msidb); ...@@ -38,17 +38,17 @@ WINE_DEFAULT_DEBUG_CHANNEL(msidb);
/* below is the query interface to a table */ /* below is the query interface to a table */
typedef struct tagMSIUPDATEVIEW struct update_view
{ {
MSIVIEW view; MSIVIEW view;
MSIDATABASE *db; MSIDATABASE *db;
MSIVIEW *wv; MSIVIEW *wv;
column_info *vals; column_info *vals;
} MSIUPDATEVIEW; };
static UINT UPDATE_fetch_int( struct tagMSIVIEW *view, UINT row, UINT col, UINT *val ) static UINT UPDATE_fetch_int( struct tagMSIVIEW *view, UINT row, UINT col, UINT *val )
{ {
MSIUPDATEVIEW *uv = (MSIUPDATEVIEW*)view; struct update_view *uv = (struct update_view *)view;
TRACE("%p %d %d %p\n", uv, row, col, val ); TRACE("%p %d %d %p\n", uv, row, col, val );
...@@ -57,7 +57,7 @@ static UINT UPDATE_fetch_int( struct tagMSIVIEW *view, UINT row, UINT col, UINT ...@@ -57,7 +57,7 @@ static UINT UPDATE_fetch_int( struct tagMSIVIEW *view, UINT row, UINT col, UINT
static UINT UPDATE_execute( struct tagMSIVIEW *view, MSIRECORD *record ) static UINT UPDATE_execute( struct tagMSIVIEW *view, MSIRECORD *record )
{ {
MSIUPDATEVIEW *uv = (MSIUPDATEVIEW*)view; struct update_view *uv = (struct update_view *)view;
UINT i, r, col_count = 0, row_count = 0; UINT i, r, col_count = 0, row_count = 0;
MSIRECORD *values = NULL; MSIRECORD *values = NULL;
MSIRECORD *where = NULL; MSIRECORD *where = NULL;
...@@ -128,7 +128,7 @@ done: ...@@ -128,7 +128,7 @@ done:
static UINT UPDATE_close( struct tagMSIVIEW *view ) static UINT UPDATE_close( struct tagMSIVIEW *view )
{ {
MSIUPDATEVIEW *uv = (MSIUPDATEVIEW*)view; struct update_view *uv = (struct update_view *)view;
MSIVIEW *wv; MSIVIEW *wv;
TRACE("%p\n", uv); TRACE("%p\n", uv);
...@@ -142,7 +142,7 @@ static UINT UPDATE_close( struct tagMSIVIEW *view ) ...@@ -142,7 +142,7 @@ static UINT UPDATE_close( struct tagMSIVIEW *view )
static UINT UPDATE_get_dimensions( struct tagMSIVIEW *view, UINT *rows, UINT *cols ) static UINT UPDATE_get_dimensions( struct tagMSIVIEW *view, UINT *rows, UINT *cols )
{ {
MSIUPDATEVIEW *uv = (MSIUPDATEVIEW*)view; struct update_view *uv = (struct update_view *)view;
MSIVIEW *wv; MSIVIEW *wv;
TRACE("%p %p %p\n", uv, rows, cols ); TRACE("%p %p %p\n", uv, rows, cols );
...@@ -157,7 +157,7 @@ static UINT UPDATE_get_dimensions( struct tagMSIVIEW *view, UINT *rows, UINT *co ...@@ -157,7 +157,7 @@ static UINT UPDATE_get_dimensions( struct tagMSIVIEW *view, UINT *rows, UINT *co
static UINT UPDATE_get_column_info( struct tagMSIVIEW *view, UINT n, LPCWSTR *name, static UINT UPDATE_get_column_info( struct tagMSIVIEW *view, UINT n, LPCWSTR *name,
UINT *type, BOOL *temporary, LPCWSTR *table_name ) UINT *type, BOOL *temporary, LPCWSTR *table_name )
{ {
MSIUPDATEVIEW *uv = (MSIUPDATEVIEW*)view; struct update_view *uv = (struct update_view *)view;
MSIVIEW *wv; MSIVIEW *wv;
TRACE("%p %d %p %p %p %p\n", uv, n, name, type, temporary, table_name ); TRACE("%p %d %p %p %p %p\n", uv, n, name, type, temporary, table_name );
...@@ -172,7 +172,7 @@ static UINT UPDATE_get_column_info( struct tagMSIVIEW *view, UINT n, LPCWSTR *na ...@@ -172,7 +172,7 @@ static UINT UPDATE_get_column_info( struct tagMSIVIEW *view, UINT n, LPCWSTR *na
static UINT UPDATE_modify( struct tagMSIVIEW *view, MSIMODIFY eModifyMode, static UINT UPDATE_modify( struct tagMSIVIEW *view, MSIMODIFY eModifyMode,
MSIRECORD *rec, UINT row ) MSIRECORD *rec, UINT row )
{ {
MSIUPDATEVIEW *uv = (MSIUPDATEVIEW*)view; struct update_view *uv = (struct update_view *)view;
TRACE("%p %d %p\n", uv, eModifyMode, rec ); TRACE("%p %d %p\n", uv, eModifyMode, rec );
...@@ -181,7 +181,7 @@ static UINT UPDATE_modify( struct tagMSIVIEW *view, MSIMODIFY eModifyMode, ...@@ -181,7 +181,7 @@ static UINT UPDATE_modify( struct tagMSIVIEW *view, MSIMODIFY eModifyMode,
static UINT UPDATE_delete( struct tagMSIVIEW *view ) static UINT UPDATE_delete( struct tagMSIVIEW *view )
{ {
MSIUPDATEVIEW *uv = (MSIUPDATEVIEW*)view; struct update_view *uv = (struct update_view *)view;
MSIVIEW *wv; MSIVIEW *wv;
TRACE("%p\n", uv ); TRACE("%p\n", uv );
...@@ -220,7 +220,7 @@ static const MSIVIEWOPS update_ops = ...@@ -220,7 +220,7 @@ static const MSIVIEWOPS update_ops =
UINT UPDATE_CreateView( MSIDATABASE *db, MSIVIEW **view, LPWSTR table, UINT UPDATE_CreateView( MSIDATABASE *db, MSIVIEW **view, LPWSTR table,
column_info *columns, struct expr *expr ) column_info *columns, struct expr *expr )
{ {
MSIUPDATEVIEW *uv = NULL; struct update_view *uv = NULL;
UINT r; UINT r;
MSIVIEW *sv = NULL, *wv = NULL; MSIVIEW *sv = NULL, *wv = NULL;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment