From: Hans Leidekker hans@codeweavers.com
Installing global assemblies requires assembly caches to be initialized and this is no longer the case after the PE conversion (builtin fusion no longer loads if the dll is not present on disk).
The next patch changes msi to perform late initialization of the assembly caches so that native fusion can be loaded once it's installed by .NET installers. However, there's no guarantee that all necessary files and registry keys are installed before the InstallFiles and PatchFiles actions are executed. Therefore this patch moves the parts of these actions handling global assemblies to InstallFinalize.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51345 --- dlls/msi/action.c | 43 +++++++++++++++++++++++++++++++++-- dlls/msi/assembly.c | 55 --------------------------------------------- dlls/msi/files.c | 40 +++++---------------------------- dlls/msi/msipriv.h | 2 +- 4 files changed, 47 insertions(+), 93 deletions(-)
diff --git a/dlls/msi/action.c b/dlls/msi/action.c index d856e94efa7..2bb9604adb8 100644 --- a/dlls/msi/action.c +++ b/dlls/msi/action.c @@ -2068,8 +2068,7 @@ static UINT calculate_file_cost( MSIPACKAGE *package )
set_target_path( package, file );
- if ((comp->assembly && !comp->assembly->installed) || - msi_get_file_attributes( package, file->TargetPath ) == INVALID_FILE_ATTRIBUTES) + if (msi_get_file_attributes( package, file->TargetPath ) == INVALID_FILE_ATTRIBUTES) { comp->Cost += file->FileSize; continue; @@ -5134,6 +5133,8 @@ static BOOL is_full_uninstall( MSIPACKAGE *package ) static UINT ACTION_InstallFinalize(MSIPACKAGE *package) { UINT rc; + MSIFILE *file; + MSIFILEPATCH *patch;
/* first do the same as an InstallExecute */ rc = execute_script(package, SCRIPT_INSTALL); @@ -5145,6 +5146,44 @@ static UINT ACTION_InstallFinalize(MSIPACKAGE *package) if (rc != ERROR_SUCCESS) return rc;
+ /* install global assemblies */ + LIST_FOR_EACH_ENTRY( file, &package->files, MSIFILE, entry ) + { + MSICOMPONENT *comp = file->Component; + + if (!msi_is_global_assembly( comp ) || (file->state != msifs_missing && file->state != msifs_overwrite)) + continue; + + rc = msi_install_assembly( package, comp ); + if (rc != ERROR_SUCCESS) + { + ERR("Failed to install assembly\n"); + return ERROR_INSTALL_FAILURE; + } + file->state = msifs_installed; + } + + /* patch global assemblies */ + LIST_FOR_EACH_ENTRY( patch, &package->filepatches, MSIFILEPATCH, entry ) + { + MSICOMPONENT *comp = patch->File->Component; + + if (!msi_is_global_assembly( comp ) || !patch->path) continue; + + rc = msi_patch_assembly( package, comp->assembly, patch ); + if (rc && !(patch->Attributes & msidbPatchAttributesNonVital)) + { + ERR("Failed to apply patch to file: %s\n", debugstr_w(patch->File->File)); + return rc; + } + + if ((rc = msi_install_assembly( package, comp ))) + { + ERR("Failed to install patched assembly\n"); + return rc; + } + } + if (is_full_uninstall(package)) rc = ACTION_UnpublishProduct(package);
diff --git a/dlls/msi/assembly.c b/dlls/msi/assembly.c index 7f75d225be0..586521342b6 100644 --- a/dlls/msi/assembly.c +++ b/dlls/msi/assembly.c @@ -219,24 +219,6 @@ done: return display_name; }
-static BOOL is_assembly_installed( IAssemblyCache *cache, const WCHAR *display_name ) -{ - HRESULT hr; - ASSEMBLY_INFO info; - - if (!cache) return FALSE; - - memset( &info, 0, sizeof(info) ); - info.cbAssemblyInfo = sizeof(info); - hr = IAssemblyCache_QueryAssemblyInfo( cache, 0, display_name, &info ); - if (hr == S_OK /* sxs version */ || hr == E_NOT_SUFFICIENT_BUFFER) - { - return (info.dwAssemblyFlags == ASSEMBLYINFO_FLAG_INSTALLED); - } - TRACE( "QueryAssemblyInfo returned %#lx\n", hr ); - return FALSE; -} - WCHAR *msi_get_assembly_path( MSIPACKAGE *package, const WCHAR *displayname ) { HRESULT hr; @@ -309,13 +291,6 @@ static const WCHAR *clr_version[] = L"v4.0.30319" };
-static const WCHAR *get_clr_version_str( enum clr_version version ) -{ - if (version >= ARRAY_SIZE( clr_version )) return L"unknown"; - return clr_version[version]; -} - -/* assembly caches must be initialized */ MSIASSEMBLY *msi_load_assembly( MSIPACKAGE *package, MSICOMPONENT *comp ) { MSIRECORD *rec; @@ -351,34 +326,6 @@ MSIASSEMBLY *msi_load_assembly( MSIPACKAGE *package, MSICOMPONENT *comp ) } TRACE("display name %s\n", debugstr_w(a->display_name));
- if (a->application) - { - /* We can't check the manifest here because the target path may still change. - So we assume that the assembly is not installed and lean on the InstallFiles - action to determine which files need to be installed. - */ - a->installed = FALSE; - } - else - { - if (a->attributes == msidbAssemblyAttributesWin32) - a->installed = is_assembly_installed( package->cache_sxs, a->display_name ); - else - { - UINT i; - for (i = 0; i < CLR_VERSION_MAX; i++) - { - a->clr_version[i] = is_assembly_installed( package->cache_net[i], a->display_name ); - if (a->clr_version[i]) - { - TRACE("runtime version %s\n", debugstr_w(get_clr_version_str( i ))); - a->installed = TRUE; - break; - } - } - } - } - TRACE("assembly is %s\n", a->installed ? "installed" : "not installed"); msiobj_release( &rec->hdr ); return a; } @@ -449,7 +396,6 @@ UINT msi_install_assembly( MSIPACKAGE *package, MSICOMPONENT *comp ) return ERROR_FUNCTION_FAILED; } if (feature) feature->Action = INSTALLSTATE_LOCAL; - assembly->installed = TRUE; return ERROR_SUCCESS; }
@@ -491,7 +437,6 @@ UINT msi_uninstall_assembly( MSIPACKAGE *package, MSICOMPONENT *comp ) } } if (feature) feature->Action = INSTALLSTATE_ABSENT; - assembly->installed = FALSE; return ERROR_SUCCESS; }
diff --git a/dlls/msi/files.c b/dlls/msi/files.c index 75075a37b5f..8267691a94d 100644 --- a/dlls/msi/files.c +++ b/dlls/msi/files.c @@ -305,7 +305,7 @@ static msi_file_state calculate_install_state( MSIPACKAGE *package, MSIFILE *fil DWORD size;
comp->Action = msi_get_component_action( package, comp ); - if (!comp->Enabled || comp->Action != INSTALLSTATE_LOCAL || (comp->assembly && comp->assembly->installed)) + if (!comp->Enabled || comp->Action != INSTALLSTATE_LOCAL) { TRACE("skipping %s (not scheduled for install)\n", debugstr_w(file->File)); return msifs_skipped; @@ -315,8 +315,7 @@ static msi_file_state calculate_install_state( MSIPACKAGE *package, MSIFILE *fil TRACE("skipping %s (obsoleted by patch)\n", debugstr_w(file->File)); return msifs_skipped; } - if ((msi_is_global_assembly( comp ) && !comp->assembly->installed) || - msi_get_file_attributes( package, file->TargetPath ) == INVALID_FILE_ATTRIBUTES) + if (msi_get_file_attributes( package, file->TargetPath ) == INVALID_FILE_ATTRIBUTES) { TRACE("installing %s (missing)\n", debugstr_w(file->File)); return msifs_missing; @@ -650,22 +649,6 @@ UINT ACTION_InstallFiles(MSIPACKAGE *package) goto done; } } - LIST_FOR_EACH_ENTRY( file, &package->files, MSIFILE, entry ) - { - MSICOMPONENT *comp = file->Component; - - if (!msi_is_global_assembly( comp ) || comp->assembly->installed || - (file->state != msifs_missing && file->state != msifs_overwrite)) continue; - - rc = msi_install_assembly( package, comp ); - if (rc != ERROR_SUCCESS) - { - ERR("Failed to install assembly\n"); - rc = ERROR_INSTALL_FAILURE; - break; - } - file->state = msifs_installed; - }
done: msi_free_media_info(mi); @@ -740,7 +723,7 @@ static UINT patch_file( MSIPACKAGE *package, MSIFILEPATCH *patch ) return r; }
-static UINT patch_assembly( MSIPACKAGE *package, MSIASSEMBLY *assembly, MSIFILEPATCH *patch ) +UINT msi_patch_assembly( MSIPACKAGE *package, MSIASSEMBLY *assembly, MSIFILEPATCH *patch ) { UINT r = ERROR_FUNCTION_FAILED; IAssemblyName *name; @@ -851,27 +834,14 @@ UINT ACTION_PatchFiles( MSIPACKAGE *package ) { MSICOMPONENT *comp = patch->File->Component;
- if (!patch->path) continue; - - if (msi_is_global_assembly( comp )) - rc = patch_assembly( package, comp->assembly, patch ); - else - rc = patch_file( package, patch ); + if (msi_is_global_assembly( comp ) || !patch->path) continue;
+ rc = patch_file( package, patch ); if (rc && !(patch->Attributes & msidbPatchAttributesNonVital)) { ERR("Failed to apply patch to file: %s\n", debugstr_w(patch->File->File)); break; } - - if (msi_is_global_assembly( comp )) - { - if ((rc = msi_install_assembly( package, comp ))) - { - ERR("Failed to install patched assembly\n"); - break; - } - } }
done: diff --git a/dlls/msi/msipriv.h b/dlls/msi/msipriv.h index 1db770481ef..902dd01205c 100644 --- a/dlls/msi/msipriv.h +++ b/dlls/msi/msipriv.h @@ -515,7 +515,6 @@ typedef struct tagMSIASSEMBLY DWORD attributes; LPWSTR display_name; LPWSTR tempdir; - BOOL installed; BOOL clr_version[CLR_VERSION_MAX]; } MSIASSEMBLY;
@@ -806,6 +805,7 @@ extern UINT msi_check_patch_applicable( MSIPACKAGE *package, MSISUMMARYINFO *si extern UINT msi_apply_patches( MSIPACKAGE *package ) DECLSPEC_HIDDEN; extern UINT msi_apply_registered_patch( MSIPACKAGE *package, LPCWSTR patch_code ) DECLSPEC_HIDDEN; extern void msi_free_patchinfo( MSIPATCHINFO *patch ) DECLSPEC_HIDDEN; +extern UINT msi_patch_assembly( MSIPACKAGE *, MSIASSEMBLY *, MSIFILEPATCH * ) DECLSPEC_HIDDEN;
/* action internals */ extern UINT MSI_InstallPackage( MSIPACKAGE *, LPCWSTR, LPCWSTR ) DECLSPEC_HIDDEN;
From: Hans Leidekker hans@codeweavers.com
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51345 --- dlls/msi/assembly.c | 42 ++++++++++++++++++++++-------------------- dlls/msi/msipriv.h | 1 - dlls/msi/package.c | 7 ------- 3 files changed, 22 insertions(+), 28 deletions(-)
diff --git a/dlls/msi/assembly.c b/dlls/msi/assembly.c index 586521342b6..47e8071502c 100644 --- a/dlls/msi/assembly.c +++ b/dlls/msi/assembly.c @@ -30,55 +30,52 @@
WINE_DEFAULT_DEBUG_CHANNEL(msi);
-static BOOL load_fusion_dlls( MSIPACKAGE *package ) +static void load_fusion_dlls( MSIPACKAGE *package ) { HRESULT (WINAPI *pLoadLibraryShim)( const WCHAR *, const WCHAR *, void *, HMODULE * ); WCHAR path[MAX_PATH]; DWORD len = GetSystemDirectoryW( path, MAX_PATH );
lstrcpyW( path + len, L"\mscoree.dll" ); - if (package->hmscoree || !(package->hmscoree = LoadLibraryW( path ))) return TRUE; + if (!package->hmscoree && !(package->hmscoree = LoadLibraryW( path ))) return; if (!(pLoadLibraryShim = (void *)GetProcAddress( package->hmscoree, "LoadLibraryShim" ))) { FreeLibrary( package->hmscoree ); package->hmscoree = NULL; - return TRUE; + return; }
- pLoadLibraryShim( L"fusion.dll", L"v1.0.3705", NULL, &package->hfusion10 ); - pLoadLibraryShim( L"fusion.dll", L"v1.1.4322", NULL, &package->hfusion11 ); - pLoadLibraryShim( L"fusion.dll", L"v2.0.50727", NULL, &package->hfusion20 ); - pLoadLibraryShim( L"fusion.dll", L"v4.0.30319", NULL, &package->hfusion40 ); - - return TRUE; + if (!package->hfusion10) pLoadLibraryShim( L"fusion.dll", L"v1.0.3705", NULL, &package->hfusion10 ); + if (!package->hfusion11) pLoadLibraryShim( L"fusion.dll", L"v1.1.4322", NULL, &package->hfusion11 ); + if (!package->hfusion20) pLoadLibraryShim( L"fusion.dll", L"v2.0.50727", NULL, &package->hfusion20 ); + if (!package->hfusion40) pLoadLibraryShim( L"fusion.dll", L"v4.0.30319", NULL, &package->hfusion40 ); }
-BOOL msi_init_assembly_caches( MSIPACKAGE *package ) +static BOOL init_assembly_caches( MSIPACKAGE *package ) { HRESULT (WINAPI *pCreateAssemblyCache)( IAssemblyCache **, DWORD );
- if (package->cache_sxs) return TRUE; - if (CreateAssemblyCache( &package->cache_sxs, 0 ) != S_OK) return FALSE; + if (!package->cache_sxs && CreateAssemblyCache( &package->cache_sxs, 0 ) != S_OK) return FALSE;
- if (!load_fusion_dlls( package )) return FALSE; + load_fusion_dlls( package ); package->pGetFileVersion = (void *)GetProcAddress( package->hmscoree, "GetFileVersion" ); /* missing from v1.0.3705 */
- if (package->hfusion10) + if (package->hfusion10 && !package->cache_net[CLR_VERSION_V10]) { pCreateAssemblyCache = (void *)GetProcAddress( package->hfusion10, "CreateAssemblyCache" ); pCreateAssemblyCache( &package->cache_net[CLR_VERSION_V10], 0 ); } - if (package->hfusion11) + if (package->hfusion11 && !package->cache_net[CLR_VERSION_V11]) { pCreateAssemblyCache = (void *)GetProcAddress( package->hfusion11, "CreateAssemblyCache" ); pCreateAssemblyCache( &package->cache_net[CLR_VERSION_V11], 0 ); } - if (package->hfusion20) + if (package->hfusion20 && !package->cache_net[CLR_VERSION_V20]) { pCreateAssemblyCache = (void *)GetProcAddress( package->hfusion20, "CreateAssemblyCache" ); pCreateAssemblyCache( &package->cache_net[CLR_VERSION_V20], 0 ); } - if (package->hfusion40) + if (package->hfusion40 && !package->cache_net[CLR_VERSION_V40]) { pCreateAssemblyCache = (void *)GetProcAddress( package->hfusion40, "CreateAssemblyCache" ); pCreateAssemblyCache( &package->cache_net[CLR_VERSION_V40], 0 ); @@ -223,9 +220,9 @@ WCHAR *msi_get_assembly_path( MSIPACKAGE *package, const WCHAR *displayname ) { HRESULT hr; ASSEMBLY_INFO info; - IAssemblyCache *cache = package->cache_net[CLR_VERSION_V40]; + IAssemblyCache *cache;
- if (!cache) return NULL; + if (!init_assembly_caches( package ) || !(cache = package->cache_net[CLR_VERSION_V40])) return NULL;
memset( &info, 0, sizeof(info) ); info.cbAssemblyInfo = sizeof(info); @@ -252,7 +249,8 @@ IAssemblyEnum *msi_create_assembly_enum( MSIPACKAGE *package, const WCHAR *displ WCHAR *str; DWORD len = 0;
- if (!package->pCreateAssemblyNameObject || !package->pCreateAssemblyEnum) return NULL; + if (!init_assembly_caches( package ) || !package->pCreateAssemblyNameObject || !package->pCreateAssemblyEnum) + return NULL;
hr = package->pCreateAssemblyNameObject( &name, displayname, CANOF_PARSE_DISPLAY_NAME, NULL ); if (FAILED( hr )) return NULL; @@ -363,6 +361,8 @@ UINT msi_install_assembly( MSIPACKAGE *package, MSICOMPONENT *comp ) MSIASSEMBLY *assembly = comp->assembly; MSIFEATURE *feature = NULL;
+ if (!init_assembly_caches( package )) return ERROR_FUNCTION_FAILED; + if (comp->assembly->feature) feature = msi_get_loaded_feature( package, comp->assembly->feature );
@@ -406,6 +406,8 @@ UINT msi_uninstall_assembly( MSIPACKAGE *package, MSICOMPONENT *comp ) MSIASSEMBLY *assembly = comp->assembly; MSIFEATURE *feature = NULL;
+ if (!init_assembly_caches( package )) return ERROR_FUNCTION_FAILED; + if (comp->assembly->feature) feature = msi_get_loaded_feature( package, comp->assembly->feature );
diff --git a/dlls/msi/msipriv.h b/dlls/msi/msipriv.h index 902dd01205c..92c406b8ec5 100644 --- a/dlls/msi/msipriv.h +++ b/dlls/msi/msipriv.h @@ -1052,7 +1052,6 @@ extern UINT msi_set_sourcedir_props(MSIPACKAGE *package, BOOL replace) DECLSPEC_ extern MSIASSEMBLY *msi_load_assembly(MSIPACKAGE *, MSICOMPONENT *) DECLSPEC_HIDDEN; extern UINT msi_install_assembly(MSIPACKAGE *, MSICOMPONENT *) DECLSPEC_HIDDEN; extern UINT msi_uninstall_assembly(MSIPACKAGE *, MSICOMPONENT *) DECLSPEC_HIDDEN; -extern BOOL msi_init_assembly_caches(MSIPACKAGE *) DECLSPEC_HIDDEN; extern void msi_destroy_assembly_caches(MSIPACKAGE *) DECLSPEC_HIDDEN; extern BOOL msi_is_global_assembly(MSICOMPONENT *) DECLSPEC_HIDDEN; extern IAssemblyEnum *msi_create_assembly_enum(MSIPACKAGE *, const WCHAR *) DECLSPEC_HIDDEN; diff --git a/dlls/msi/package.c b/dlls/msi/package.c index bfbbaadae1b..f09d0c6fc92 100644 --- a/dlls/msi/package.c +++ b/dlls/msi/package.c @@ -1502,13 +1502,6 @@ UINT MSI_OpenPackageW(LPCWSTR szPackage, DWORD dwOptions, MSIPACKAGE **pPackage) package->log_file = CreateFileW( gszLogFile, GENERIC_WRITE, FILE_SHARE_WRITE, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL );
- if (!msi_init_assembly_caches( package )) - { - ERR("can't initialize assembly caches\n"); - msiobj_release( &package->hdr ); - return ERROR_FUNCTION_FAILED; - } - /* FIXME: when should these messages be sent? */ data_row = MSI_CreateRecord(3); if (!data_row)
From: Hans Leidekker hans@codeweavers.com
--- dlls/msi/action.c | 87 +++--- dlls/msi/custom.c | 107 +++---- dlls/msi/database.c | 94 +++--- dlls/msi/dialog.c | 736 +++++++++++++++++++++----------------------- dlls/msi/files.c | 40 +-- dlls/msi/handle.c | 144 ++++----- dlls/msi/insert.c | 8 +- dlls/msi/media.c | 16 +- dlls/msi/msi.c | 31 +- dlls/msi/msiquery.c | 20 +- dlls/msi/package.c | 12 +- dlls/msi/patch.c | 16 +- dlls/msi/record.c | 8 +- dlls/msi/registry.c | 65 ++-- dlls/msi/suminfo.c | 8 +- dlls/msi/table.c | 92 +++--- 16 files changed, 711 insertions(+), 773 deletions(-)
diff --git a/dlls/msi/action.c b/dlls/msi/action.c index 2bb9604adb8..fa15a5d24cf 100644 --- a/dlls/msi/action.c +++ b/dlls/msi/action.c @@ -3476,7 +3476,7 @@ static BOOL CALLBACK Typelib_EnumResNameProc( HMODULE hModule, LPCWSTR lpszType, return TRUE; }
-static HMODULE msi_load_library( MSIPACKAGE *package, const WCHAR *filename, DWORD flags ) +static HMODULE load_library( MSIPACKAGE *package, const WCHAR *filename, DWORD flags ) { HMODULE module; msi_disable_fs_redirection( package ); @@ -3485,7 +3485,7 @@ static HMODULE msi_load_library( MSIPACKAGE *package, const WCHAR *filename, DWO return module; }
-static HRESULT msi_load_typelib( MSIPACKAGE *package, const WCHAR *filename, REGKIND kind, ITypeLib **lib ) +static HRESULT load_typelib( MSIPACKAGE *package, const WCHAR *filename, REGKIND kind, ITypeLib **lib ) { HRESULT hr; msi_disable_fs_redirection( package ); @@ -3524,7 +3524,7 @@ static UINT ITERATE_RegisterTypeLibraries(MSIRECORD *row, LPVOID param) } MSI_ProcessMessage(package, INSTALLMESSAGE_ACTIONDATA, row);
- module = msi_load_library( package, file->TargetPath, LOAD_LIBRARY_AS_DATAFILE ); + module = load_library( package, file->TargetPath, LOAD_LIBRARY_AS_DATAFILE ); if (module) { LPCWSTR guid; @@ -3561,7 +3561,7 @@ static UINT ITERATE_RegisterTypeLibraries(MSIRECORD *row, LPVOID param) } else { - hr = msi_load_typelib( package, file->TargetPath, REGKIND_REGISTER, &tlib ); + hr = load_typelib( package, file->TargetPath, REGKIND_REGISTER, &tlib ); if (FAILED(hr)) { ERR( "failed to load type library: %#lx\n", hr ); @@ -3935,7 +3935,7 @@ static UINT ITERATE_PublishIcon(MSIRECORD *row, LPVOID param) return ERROR_SUCCESS; }
-static UINT msi_publish_icons(MSIPACKAGE *package) +static UINT publish_icons(MSIPACKAGE *package) { MSIQUERY *view; UINT r; @@ -3951,7 +3951,7 @@ static UINT msi_publish_icons(MSIPACKAGE *package) return ERROR_SUCCESS; }
-static UINT msi_publish_sourcelist(MSIPACKAGE *package, HKEY hkey) +static UINT publish_sourcelist(MSIPACKAGE *package, HKEY hkey) { UINT r; HKEY source; @@ -4005,7 +4005,7 @@ static UINT msi_publish_sourcelist(MSIPACKAGE *package, HKEY hkey) return ERROR_SUCCESS; }
-static UINT msi_publish_product_properties(MSIPACKAGE *package, HKEY hkey) +static UINT publish_product_properties(MSIPACKAGE *package, HKEY hkey) { WCHAR *buffer, *ptr, *guids, packcode[SQUASHED_GUID_SIZE]; DWORD langid; @@ -4051,7 +4051,7 @@ static UINT msi_publish_product_properties(MSIPACKAGE *package, HKEY hkey) return ERROR_SUCCESS; }
-static UINT msi_publish_upgrade_code(MSIPACKAGE *package) +static UINT publish_upgrade_code(MSIPACKAGE *package) { UINT r; HKEY hkey; @@ -4079,7 +4079,7 @@ static UINT msi_publish_upgrade_code(MSIPACKAGE *package) return ERROR_SUCCESS; }
-static BOOL msi_check_publish(MSIPACKAGE *package) +static BOOL check_publish(MSIPACKAGE *package) { MSIFEATURE *feature;
@@ -4093,7 +4093,7 @@ static BOOL msi_check_publish(MSIPACKAGE *package) return FALSE; }
-static BOOL msi_check_unpublish(MSIPACKAGE *package) +static BOOL check_unpublish(MSIPACKAGE *package) { MSIFEATURE *feature;
@@ -4107,7 +4107,7 @@ static BOOL msi_check_unpublish(MSIPACKAGE *package) return TRUE; }
-static UINT msi_publish_patches( MSIPACKAGE *package ) +static UINT publish_patches( MSIPACKAGE *package ) { WCHAR patch_squashed[GUID_SIZE]; HKEY patches_key = NULL, product_patches_key = NULL, product_key; @@ -4221,7 +4221,7 @@ static UINT ACTION_PublishProduct(MSIPACKAGE *package)
if (!list_empty(&package->patches)) { - rc = msi_publish_patches(package); + rc = publish_patches(package); if (rc != ERROR_SUCCESS) goto end; } @@ -4255,7 +4255,7 @@ static UINT ACTION_PublishProduct(MSIPACKAGE *package) }
/* FIXME: also need to publish if the product is in advertise mode */ - if (!republish && !msi_check_publish(package)) + if (!republish && !check_publish(package)) { if (hukey) RegCloseKey(hukey); @@ -4275,19 +4275,19 @@ static UINT ACTION_PublishProduct(MSIPACKAGE *package) if (rc != ERROR_SUCCESS) goto end;
- rc = msi_publish_upgrade_code(package); + rc = publish_upgrade_code(package); if (rc != ERROR_SUCCESS) goto end;
- rc = msi_publish_product_properties(package, hukey); + rc = publish_product_properties(package, hukey); if (rc != ERROR_SUCCESS) goto end;
- rc = msi_publish_sourcelist(package, hukey); + rc = publish_sourcelist(package, hukey); if (rc != ERROR_SUCCESS) goto end;
- rc = msi_publish_icons(package); + rc = publish_icons(package);
end: uirow = MSI_CreateRecord( 1 ); @@ -4707,7 +4707,7 @@ static UINT ACTION_PublishFeatures(MSIPACKAGE *package) if (package->script == SCRIPT_NONE) return msi_schedule_action(package, SCRIPT_INSTALL, L"PublishFeatures");
- if (!msi_check_publish(package)) + if (!check_publish(package)) return ERROR_SUCCESS;
rc = MSIREG_OpenFeaturesKey(package->ProductCode, NULL, package->Context, @@ -4810,7 +4810,7 @@ end: return rc; }
-static UINT msi_unpublish_feature(MSIPACKAGE *package, MSIFEATURE *feature) +static UINT unpublish_feature(MSIPACKAGE *package, MSIFEATURE *feature) { UINT r; HKEY hkey; @@ -4849,18 +4849,18 @@ static UINT ACTION_UnpublishFeatures(MSIPACKAGE *package) if (package->script == SCRIPT_NONE) return msi_schedule_action(package, SCRIPT_INSTALL, L"UnpublishFeatures");
- if (!msi_check_unpublish(package)) + if (!check_unpublish(package)) return ERROR_SUCCESS;
LIST_FOR_EACH_ENTRY(feature, &package->features, MSIFEATURE, entry) { - msi_unpublish_feature(package, feature); + unpublish_feature(package, feature); }
return ERROR_SUCCESS; }
-static UINT msi_publish_install_properties(MSIPACKAGE *package, HKEY hkey) +static UINT publish_install_properties(MSIPACKAGE *package, HKEY hkey) { static const WCHAR *propval[] = { @@ -4959,8 +4959,7 @@ static UINT ACTION_RegisterProduct(MSIPACKAGE *package) return msi_schedule_action(package, SCRIPT_INSTALL, L"RegisterProduct");
/* FIXME: also need to publish if the product is in advertise mode */ - if (!msi_get_property_int( package->db, L"ProductToBeRegistered", 0 ) - && !msi_check_publish(package)) + if (!msi_get_property_int( package->db, L"ProductToBeRegistered", 0 ) && !check_publish(package)) return ERROR_SUCCESS;
rc = MSIREG_OpenUninstallKey(package->ProductCode, package->platform, &hkey, TRUE); @@ -4971,11 +4970,11 @@ static UINT ACTION_RegisterProduct(MSIPACKAGE *package) if (rc != ERROR_SUCCESS) goto done;
- rc = msi_publish_install_properties(package, hkey); + rc = publish_install_properties(package, hkey); if (rc != ERROR_SUCCESS) goto done;
- rc = msi_publish_install_properties(package, props); + rc = publish_install_properties(package, props); if (rc != ERROR_SUCCESS) goto done;
@@ -5030,7 +5029,7 @@ static UINT ITERATE_UnpublishIcon( MSIRECORD *row, LPVOID param ) return ERROR_SUCCESS; }
-static UINT msi_unpublish_icons( MSIPACKAGE *package ) +static UINT unpublish_icons( MSIPACKAGE *package ) { MSIQUERY *view; UINT r; @@ -5112,7 +5111,7 @@ static UINT ACTION_UnpublishProduct(MSIPACKAGE *package) TRACE("removing local package %s\n", debugstr_w(package->localfile)); package->delete_on_close = TRUE;
- msi_unpublish_icons( package ); + unpublish_icons( package ); return ERROR_SUCCESS; }
@@ -5295,7 +5294,7 @@ static UINT ACTION_RegisterUser(MSIPACKAGE *package) if (package->script == SCRIPT_NONE) return msi_schedule_action(package, SCRIPT_INSTALL, L"RegisterUser");
- if (msi_check_unpublish(package)) + if (check_unpublish(package)) { MSIREG_DeleteUserDataProductKey(package->ProductCode, package->Context); goto end; @@ -5832,7 +5831,7 @@ static UINT ACTION_InstallServices( MSIPACKAGE *package ) }
/* converts arg1[~]arg2[~]arg3 to a list of ptrs to the strings */ -static LPCWSTR *msi_service_args_to_vector(LPWSTR args, DWORD *numargs) +static const WCHAR **service_args_to_vector(WCHAR *args, DWORD *numargs) { LPCWSTR *vector, *temp_vector; LPWSTR p, q; @@ -5928,7 +5927,7 @@ static UINT ITERATE_StartService(MSIRECORD *rec, LPVOID param) goto done; }
- vector = msi_service_args_to_vector(args, &numargs); + vector = service_args_to_vector(args, &numargs);
if (!StartServiceW(service, numargs, vector) && GetLastError() != ERROR_SERVICE_ALREADY_RUNNING) @@ -7368,21 +7367,11 @@ static UINT ACTION_MigrateFeatureStates( MSIPACKAGE *package ) return ERROR_SUCCESS; }
-static BOOL msi_bind_image( MSIPACKAGE *package, const char *filename, const char *path ) +static void bind_image( MSIPACKAGE *package, const char *filename, const char *path ) { - BOOL ret; msi_disable_fs_redirection( package ); - ret = BindImage( filename, path, NULL ); + if (!BindImage( filename, path, NULL )) WARN( "failed to bind image %lu\n", GetLastError() ); msi_revert_fs_redirection( package ); - return ret; -} - -static void bind_image( MSIPACKAGE *package, const char *filename, const char *path ) -{ - if (!msi_bind_image( package, filename, path )) - { - WARN( "failed to bind image %lu\n", GetLastError() ); - } }
static UINT ITERATE_BindImage( MSIRECORD *rec, LPVOID param ) @@ -7437,7 +7426,7 @@ static UINT ACTION_BindImage( MSIPACKAGE *package ) return ERROR_SUCCESS; }
-static UINT msi_unimplemented_action_stub( MSIPACKAGE *package, LPCSTR action, LPCWSTR table ) +static UINT unimplemented_action_stub( MSIPACKAGE *package, LPCSTR action, LPCWSTR table ) { MSIQUERY *view; DWORD count = 0; @@ -7457,27 +7446,27 @@ static UINT msi_unimplemented_action_stub( MSIPACKAGE *package, LPCSTR action, L
static UINT ACTION_IsolateComponents( MSIPACKAGE *package ) { - return msi_unimplemented_action_stub( package, "IsolateComponents", L"IsolateComponent" ); + return unimplemented_action_stub( package, "IsolateComponents", L"IsolateComponent" ); }
static UINT ACTION_RMCCPSearch( MSIPACKAGE *package ) { - return msi_unimplemented_action_stub( package, "RMCCPSearch", L"CCPSearch" ); + return unimplemented_action_stub( package, "RMCCPSearch", L"CCPSearch" ); }
static UINT ACTION_RegisterComPlus( MSIPACKAGE *package ) { - return msi_unimplemented_action_stub( package, "RegisterComPlus", L"Complus" ); + return unimplemented_action_stub( package, "RegisterComPlus", L"Complus" ); }
static UINT ACTION_UnregisterComPlus( MSIPACKAGE *package ) { - return msi_unimplemented_action_stub( package, "UnregisterComPlus", L"Complus" ); + return unimplemented_action_stub( package, "UnregisterComPlus", L"Complus" ); }
static UINT ACTION_InstallSFPCatalogFile( MSIPACKAGE *package ) { - return msi_unimplemented_action_stub( package, "InstallSFPCatalogFile", L"SFPCatalog" ); + return unimplemented_action_stub( package, "InstallSFPCatalogFile", L"SFPCatalog" ); }
static const struct diff --git a/dlls/msi/custom.c b/dlls/msi/custom.c index 035b2dd2c0f..fa5c1051fee 100644 --- a/dlls/msi/custom.c +++ b/dlls/msi/custom.c @@ -53,17 +53,17 @@ typedef struct tagMSIRUNNINGACTION
typedef UINT (WINAPI *MsiCustomActionEntryPoint)( MSIHANDLE );
-static CRITICAL_SECTION msi_custom_action_cs; -static CRITICAL_SECTION_DEBUG msi_custom_action_cs_debug = +static CRITICAL_SECTION custom_action_cs; +static CRITICAL_SECTION_DEBUG custom_action_cs_debug = { - 0, 0, &msi_custom_action_cs, - { &msi_custom_action_cs_debug.ProcessLocksList, - &msi_custom_action_cs_debug.ProcessLocksList }, - 0, 0, { (DWORD_PTR)(__FILE__ ": msi_custom_action_cs") } + 0, 0, &custom_action_cs, + { &custom_action_cs_debug.ProcessLocksList, + &custom_action_cs_debug.ProcessLocksList }, + 0, 0, { (DWORD_PTR)(__FILE__ ": custom_action_cs") } }; -static CRITICAL_SECTION msi_custom_action_cs = { &msi_custom_action_cs_debug, -1, 0, 0, 0, 0 }; +static CRITICAL_SECTION custom_action_cs = { &custom_action_cs_debug, -1, 0, 0, 0, 0 };
-static struct list msi_pending_custom_actions = LIST_INIT( msi_pending_custom_actions ); +static struct list pending_custom_actions = LIST_INIT( pending_custom_actions );
void __RPC_FAR * __RPC_USER MIDL_user_allocate(SIZE_T len) { @@ -171,8 +171,8 @@ static BOOL check_execution_scheduling_options(MSIPACKAGE *package, LPCWSTR acti * * [CustomActionData<=>UserSID<=>ProductCode]Action */ -static LPWSTR msi_get_deferred_action(LPCWSTR action, LPCWSTR actiondata, - LPCWSTR usersid, LPCWSTR prodcode) +static WCHAR *get_deferred_action(const WCHAR *action, const WCHAR *actiondata, const WCHAR *usersid, + const WCHAR *prodcode) { LPWSTR deferred; DWORD len; @@ -373,7 +373,8 @@ static UINT wait_process_handle(MSIPACKAGE* package, UINT type, return rc; }
-typedef struct _msi_custom_action_info { +typedef struct +{ struct list entry; MSIPACKAGE *package; LPWSTR source; @@ -383,11 +384,11 @@ typedef struct _msi_custom_action_info { INT type; GUID guid; DWORD arch; -} msi_custom_action_info; +} custom_action_info;
-static void free_custom_action_data( msi_custom_action_info *info ) +static void free_custom_action_data( custom_action_info *info ) { - EnterCriticalSection( &msi_custom_action_cs ); + EnterCriticalSection( &custom_action_cs );
list_remove( &info->entry ); if (info->handle) @@ -398,10 +399,10 @@ static void free_custom_action_data( msi_custom_action_info *info ) msiobj_release( &info->package->hdr ); free( info );
- LeaveCriticalSection( &msi_custom_action_cs ); + LeaveCriticalSection( &custom_action_cs ); }
-static UINT wait_thread_handle( msi_custom_action_info *info ) +static UINT wait_thread_handle( custom_action_info *info ) { UINT rc = ERROR_SUCCESS;
@@ -424,14 +425,14 @@ static UINT wait_thread_handle( msi_custom_action_info *info ) return rc; }
-static msi_custom_action_info *find_action_by_guid( const GUID *guid ) +static custom_action_info *find_action_by_guid( const GUID *guid ) { - msi_custom_action_info *info; + custom_action_info *info; BOOL found = FALSE;
- EnterCriticalSection( &msi_custom_action_cs ); + EnterCriticalSection( &custom_action_cs );
- LIST_FOR_EACH_ENTRY( info, &msi_pending_custom_actions, msi_custom_action_info, entry ) + LIST_FOR_EACH_ENTRY( info, &pending_custom_actions, custom_action_info, entry ) { if (IsEqualGUID( &info->guid, guid )) { @@ -440,7 +441,7 @@ static msi_custom_action_info *find_action_by_guid( const GUID *guid ) } }
- LeaveCriticalSection( &msi_custom_action_cs ); + LeaveCriticalSection( &custom_action_cs );
if (!found) return NULL; @@ -642,7 +643,7 @@ void custom_stop_server(HANDLE process, HANDLE pipe)
static DWORD WINAPI custom_client_thread(void *arg) { - msi_custom_action_info *info = arg; + custom_action_info *info = arg; DWORD64 thread64; HANDLE process; HANDLE thread; @@ -663,23 +664,23 @@ static DWORD WINAPI custom_client_thread(void *arg) pipe = info->package->custom_server_64_pipe; }
- EnterCriticalSection(&msi_custom_action_cs); + EnterCriticalSection(&custom_action_cs);
if (!WriteFile(pipe, &info->guid, sizeof(info->guid), &size, NULL) || size != sizeof(info->guid)) { ERR("failed to write to custom action client pipe: %lu\n", GetLastError()); - LeaveCriticalSection(&msi_custom_action_cs); + LeaveCriticalSection(&custom_action_cs); return GetLastError(); } if (!ReadFile(pipe, &thread64, sizeof(thread64), &size, NULL) || size != sizeof(thread64)) { ERR("failed to read from custom action client pipe: %lu\n", GetLastError()); - LeaveCriticalSection(&msi_custom_action_cs); + LeaveCriticalSection(&custom_action_cs); return GetLastError(); }
- LeaveCriticalSection(&msi_custom_action_cs); + LeaveCriticalSection(&custom_action_cs);
if (DuplicateHandle(process, (HANDLE)(DWORD_PTR)thread64, GetCurrentProcess(), &thread, 0, FALSE, DUPLICATE_SAME_ACCESS | DUPLICATE_CLOSE_SOURCE)) @@ -740,10 +741,10 @@ static BOOL get_binary_type( const WCHAR *name, DWORD *type ) } }
-static msi_custom_action_info *do_msidbCustomActionTypeDll( +static custom_action_info *do_msidbCustomActionTypeDll( MSIPACKAGE *package, INT type, LPCWSTR source, LPCWSTR target, LPCWSTR action ) { - msi_custom_action_info *info; + custom_action_info *info; RPC_STATUS status; BOOL ret;
@@ -759,9 +760,9 @@ static msi_custom_action_info *do_msidbCustomActionTypeDll( info->action = wcsdup( action ); CoCreateGuid( &info->guid );
- EnterCriticalSection( &msi_custom_action_cs ); - list_add_tail( &msi_pending_custom_actions, &info->entry ); - LeaveCriticalSection( &msi_custom_action_cs ); + EnterCriticalSection( &custom_action_cs ); + list_add_tail( &pending_custom_actions, &info->entry ); + LeaveCriticalSection( &custom_action_cs );
if (!package->rpc_server_started) { @@ -813,7 +814,7 @@ static msi_custom_action_info *do_msidbCustomActionTypeDll( static UINT HANDLE_CustomType1( MSIPACKAGE *package, const WCHAR *source, const WCHAR *target, INT type, const WCHAR *action ) { - msi_custom_action_info *info; + custom_action_info *info; MSIBINARY *binary;
if (!(binary = get_temp_binary(package, source))) @@ -915,7 +916,7 @@ static UINT HANDLE_CustomType2( MSIPACKAGE *package, const WCHAR *source, const static UINT HANDLE_CustomType17( MSIPACKAGE *package, const WCHAR *source, const WCHAR *target, INT type, const WCHAR *action ) { - msi_custom_action_info *info; + custom_action_info *info; MSIFILE *file;
TRACE("%s %s\n", debugstr_w(source), debugstr_w(target)); @@ -1148,7 +1149,7 @@ static UINT HANDLE_CustomType34( MSIPACKAGE *package, const WCHAR *source, const
static DWORD ACTION_CallScript( const GUID *guid ) { - msi_custom_action_info *info; + custom_action_info *info; MSIHANDLE hPackage; UINT r = ERROR_FUNCTION_FAILED;
@@ -1189,10 +1190,10 @@ static DWORD WINAPI ScriptThread( LPVOID arg ) return rc; }
-static msi_custom_action_info *do_msidbCustomActionTypeScript( +static custom_action_info *do_msidbCustomActionTypeScript( MSIPACKAGE *package, INT type, LPCWSTR script, LPCWSTR function, LPCWSTR action ) { - msi_custom_action_info *info; + custom_action_info *info;
info = malloc( sizeof *info ); if (!info) @@ -1206,9 +1207,9 @@ static msi_custom_action_info *do_msidbCustomActionTypeScript( info->action = wcsdup( action ); CoCreateGuid( &info->guid );
- EnterCriticalSection( &msi_custom_action_cs ); - list_add_tail( &msi_pending_custom_actions, &info->entry ); - LeaveCriticalSection( &msi_custom_action_cs ); + EnterCriticalSection( &custom_action_cs ); + list_add_tail( &pending_custom_actions, &info->entry ); + LeaveCriticalSection( &custom_action_cs );
info->handle = CreateThread( NULL, 0, ScriptThread, &info->guid, 0, NULL ); if (!info->handle) @@ -1223,7 +1224,7 @@ static msi_custom_action_info *do_msidbCustomActionTypeScript( static UINT HANDLE_CustomType37_38( MSIPACKAGE *package, const WCHAR *source, const WCHAR *target, INT type, const WCHAR *action ) { - msi_custom_action_info *info; + custom_action_info *info;
TRACE("%s %s\n", debugstr_w(source), debugstr_w(target));
@@ -1235,7 +1236,7 @@ static UINT HANDLE_CustomType5_6( MSIPACKAGE *package, const WCHAR *source, cons INT type, const WCHAR *action ) { MSIRECORD *row = NULL; - msi_custom_action_info *info; + custom_action_info *info; CHAR *buffer = NULL; WCHAR *bufferw = NULL; DWORD sz = 0; @@ -1282,7 +1283,7 @@ done: static UINT HANDLE_CustomType21_22( MSIPACKAGE *package, const WCHAR *source, const WCHAR *target, INT type, const WCHAR *action ) { - msi_custom_action_info *info; + custom_action_info *info; MSIFILE *file; HANDLE hFile; DWORD sz, szHighWord = 0, read; @@ -1341,7 +1342,7 @@ done: static UINT HANDLE_CustomType53_54( MSIPACKAGE *package, const WCHAR *source, const WCHAR *target, INT type, const WCHAR *action ) { - msi_custom_action_info *info; + custom_action_info *info; WCHAR *prop;
TRACE("%s %s\n", debugstr_w(source), debugstr_w(target)); @@ -1377,7 +1378,7 @@ static UINT defer_custom_action( MSIPACKAGE *package, const WCHAR *action, UINT WCHAR *actiondata = msi_dup_property( package->db, action ); WCHAR *usersid = msi_dup_property( package->db, L"UserSID" ); WCHAR *prodcode = msi_dup_property( package->db, L"ProductCode" ); - WCHAR *deferred = msi_get_deferred_action( action, actiondata, usersid, prodcode ); + WCHAR *deferred = get_deferred_action( action, actiondata, usersid, prodcode );
if (!deferred) { @@ -1558,7 +1559,7 @@ void ACTION_FinishCustomActions(const MSIPACKAGE* package) struct list *item; HANDLE *wait_handles; unsigned int handle_count, i; - msi_custom_action_info *info, *cursor; + custom_action_info *info, *cursor;
while ((item = list_head( &package->RunningActions ))) { @@ -1574,13 +1575,13 @@ void ACTION_FinishCustomActions(const MSIPACKAGE* package) free( action ); }
- EnterCriticalSection( &msi_custom_action_cs ); + EnterCriticalSection( &custom_action_cs );
- handle_count = list_count( &msi_pending_custom_actions ); + handle_count = list_count( &pending_custom_actions ); wait_handles = malloc( handle_count * sizeof(HANDLE) );
handle_count = 0; - LIST_FOR_EACH_ENTRY_SAFE( info, cursor, &msi_pending_custom_actions, msi_custom_action_info, entry ) + LIST_FOR_EACH_ENTRY_SAFE( info, cursor, &pending_custom_actions, custom_action_info, entry ) { if (info->package == package ) { @@ -1589,7 +1590,7 @@ void ACTION_FinishCustomActions(const MSIPACKAGE* package) } }
- LeaveCriticalSection( &msi_custom_action_cs ); + LeaveCriticalSection( &custom_action_cs );
for (i = 0; i < handle_count; i++) { @@ -1598,18 +1599,18 @@ void ACTION_FinishCustomActions(const MSIPACKAGE* package) } free( wait_handles );
- EnterCriticalSection( &msi_custom_action_cs ); - LIST_FOR_EACH_ENTRY_SAFE( info, cursor, &msi_pending_custom_actions, msi_custom_action_info, entry ) + EnterCriticalSection( &custom_action_cs ); + LIST_FOR_EACH_ENTRY_SAFE( info, cursor, &pending_custom_actions, custom_action_info, entry ) { if (info->package == package) free_custom_action_data( info ); } - LeaveCriticalSection( &msi_custom_action_cs ); + LeaveCriticalSection( &custom_action_cs ); }
UINT __cdecl s_remote_GetActionInfo(const GUID *guid, WCHAR **name, int *type, WCHAR **dll, char **func, MSIHANDLE *hinst) { - msi_custom_action_info *info; + custom_action_info *info;
info = find_action_by_guid(guid); if (!info) diff --git a/dlls/msi/database.c b/dlls/msi/database.c index c50e34cc8cd..504e81f57c7 100644 --- a/dlls/msi/database.c +++ b/dlls/msi/database.c @@ -347,7 +347,7 @@ end: return r; }
-static LPWSTR msi_read_text_archive(LPCWSTR path, DWORD *len) +static WCHAR *read_text_archive(const WCHAR *path, DWORD *len) { HANDLE file; LPSTR data = NULL; @@ -377,7 +377,7 @@ done: return wdata; }
-static void msi_parse_line(LPWSTR *line, LPWSTR **entries, DWORD *num_entries, DWORD *len) +static void parse_line(WCHAR **line, WCHAR ***entries, DWORD *num_entries, DWORD *len) { LPWSTR ptr = *line, save; DWORD i, count = 1, chars_left = *len; @@ -446,7 +446,7 @@ static void msi_parse_line(LPWSTR *line, LPWSTR **entries, DWORD *num_entries, D *num_entries = count; }
-static LPWSTR msi_build_createsql_prelude(LPWSTR table) +static WCHAR *build_createsql_prelude(const WCHAR *table) { LPWSTR prelude; DWORD size; @@ -460,7 +460,7 @@ static LPWSTR msi_build_createsql_prelude(LPWSTR table) return prelude; }
-static LPWSTR msi_build_createsql_columns(LPWSTR *columns_data, LPWSTR *types, DWORD num_columns) +static WCHAR *build_createsql_columns(WCHAR **columns_data, WCHAR **types, DWORD num_columns) { LPWSTR columns, p; LPCWSTR type; @@ -547,7 +547,7 @@ static LPWSTR msi_build_createsql_columns(LPWSTR *columns_data, LPWSTR *types, D return columns; }
-static LPWSTR msi_build_createsql_postlude(LPWSTR *primary_keys, DWORD num_keys) +static WCHAR *build_createsql_postlude(WCHAR **primary_keys, DWORD num_keys) { LPWSTR postlude, keys, ptr; DWORD size, i; @@ -579,7 +579,8 @@ done: return postlude; }
-static UINT msi_add_table_to_db(MSIDATABASE *db, LPWSTR *columns, LPWSTR *types, LPWSTR *labels, DWORD num_labels, DWORD num_columns) +static UINT add_table_to_db(MSIDATABASE *db, WCHAR **columns, WCHAR **types, WCHAR **labels, DWORD num_labels, + DWORD num_columns) { UINT r = ERROR_OUTOFMEMORY; DWORD size; @@ -587,9 +588,9 @@ static UINT msi_add_table_to_db(MSIDATABASE *db, LPWSTR *columns, LPWSTR *types, LPWSTR create_sql = NULL; LPWSTR prelude, columns_sql, postlude;
- prelude = msi_build_createsql_prelude(labels[0]); - columns_sql = msi_build_createsql_columns(columns, types, num_columns); - postlude = msi_build_createsql_postlude(labels + 1, num_labels - 1); /* skip over table name */ + prelude = build_createsql_prelude(labels[0]); + columns_sql = build_createsql_columns(columns, types, num_columns); + postlude = build_createsql_postlude(labels + 1, num_labels - 1); /* skip over table name */
if (!prelude || !columns_sql || !postlude) goto done; @@ -619,7 +620,7 @@ done: return r; }
-static LPWSTR msi_import_stream_filename(LPCWSTR path, LPCWSTR name) +static WCHAR *import_stream_filename(const WCHAR *path, const WCHAR *name) { DWORD len; LPWSTR fullname, ptr; @@ -667,7 +668,7 @@ static UINT construct_record(DWORD num_columns, LPWSTR *types, if (*data[i]) { UINT r; - LPWSTR file = msi_import_stream_filename(path, data[i]); + WCHAR *file = import_stream_filename(path, data[i]); if (!file) return ERROR_FUNCTION_FAILED;
@@ -687,10 +688,8 @@ static UINT construct_record(DWORD num_columns, LPWSTR *types, return ERROR_SUCCESS; }
-static UINT msi_add_records_to_table(MSIDATABASE *db, LPWSTR *columns, LPWSTR *types, - LPWSTR *labels, LPWSTR **records, - int num_columns, int num_records, - LPWSTR path) +static UINT add_records_to_table(MSIDATABASE *db, WCHAR **columns, WCHAR **types, WCHAR **labels, WCHAR ***records, + int num_columns, int num_records, WCHAR *path) { UINT r; int i; @@ -750,7 +749,7 @@ static UINT MSI_DatabaseImport(MSIDATABASE *db, LPCWSTR folder, LPCWSTR file) lstrcatW( path, L"\" ); lstrcatW( path, file );
- data = msi_read_text_archive( path, &len ); + data = read_text_archive( path, &len ); if (!data) { free(path); @@ -758,9 +757,9 @@ static UINT MSI_DatabaseImport(MSIDATABASE *db, LPCWSTR folder, LPCWSTR file) }
ptr = data; - msi_parse_line( &ptr, &columns, &num_columns, &len ); - msi_parse_line( &ptr, &types, &num_types, &len ); - msi_parse_line( &ptr, &labels, &num_labels, &len ); + parse_line( &ptr, &columns, &num_columns, &len ); + parse_line( &ptr, &types, &num_types, &len ); + parse_line( &ptr, &labels, &num_labels, &len );
if (num_columns == 1 && !columns[0][0] && num_labels == 1 && !labels[0][0] && num_types == 2 && !wcscmp( types[1], L"_ForceCodepage" )) @@ -785,7 +784,7 @@ static UINT MSI_DatabaseImport(MSIDATABASE *db, LPCWSTR folder, LPCWSTR file) /* read in the table records */ while (len) { - msi_parse_line( &ptr, &records[num_records], NULL, &len ); + parse_line( &ptr, &records[num_records], NULL, &len );
num_records++; temp_records = realloc(records, (num_records + 1) * sizeof(WCHAR **)); @@ -810,7 +809,7 @@ static UINT MSI_DatabaseImport(MSIDATABASE *db, LPCWSTR folder, LPCWSTR file) { if (!TABLE_Exists(db, labels[0])) { - r = msi_add_table_to_db( db, columns, types, labels, num_labels, num_columns ); + r = add_table_to_db( db, columns, types, labels, num_labels, num_columns ); if (r != ERROR_SUCCESS) { r = ERROR_FUNCTION_FAILED; @@ -818,7 +817,7 @@ static UINT MSI_DatabaseImport(MSIDATABASE *db, LPCWSTR folder, LPCWSTR file) } }
- r = msi_add_records_to_table( db, columns, types, labels, records, num_columns, num_records, path ); + r = add_records_to_table( db, columns, types, labels, records, num_columns, num_records, path ); }
done: @@ -880,7 +879,7 @@ end: return r; }
-static UINT msi_export_field( HANDLE handle, MSIRECORD *row, UINT field ) +static UINT export_field( HANDLE handle, MSIRECORD *row, UINT field ) { char *buffer; BOOL ret; @@ -923,7 +922,7 @@ static UINT msi_export_field( HANDLE handle, MSIRECORD *row, UINT field ) return ret ? ERROR_SUCCESS : ERROR_FUNCTION_FAILED; }
-static UINT msi_export_stream( const WCHAR *folder, const WCHAR *table, MSIRECORD *row, UINT field, UINT start ) +static UINT export_stream( const WCHAR *folder, const WCHAR *table, MSIRECORD *row, UINT field, UINT start ) { WCHAR stream[MAX_STREAM_NAME_LEN + 1], *path; DWORD sz, read_size, write_size; @@ -981,7 +980,7 @@ struct row_export_info const WCHAR *table; };
-static UINT msi_export_record( struct row_export_info *row_export_info, MSIRECORD *row, UINT start ) +static UINT export_record( struct row_export_info *row_export_info, MSIRECORD *row, UINT start ) { HANDLE handle = row_export_info->handle; UINT i, count, r = ERROR_SUCCESS; @@ -991,15 +990,15 @@ static UINT msi_export_record( struct row_export_info *row_export_info, MSIRECOR count = MSI_RecordGetFieldCount( row ); for (i = start; i <= count; i++) { - r = msi_export_field( handle, row, i ); + r = export_field( handle, row, i ); if (r == ERROR_INVALID_PARAMETER) { - r = msi_export_stream( row_export_info->folder, row_export_info->table, row, i, start ); + r = export_stream( row_export_info->folder, row_export_info->table, row, i, start ); if (r != ERROR_SUCCESS) return r;
/* exporting a binary stream, repeat the "Name" field */ - r = msi_export_field( handle, row, start ); + r = export_field( handle, row, start ); if (r != ERROR_SUCCESS) return r; } @@ -1013,12 +1012,12 @@ static UINT msi_export_record( struct row_export_info *row_export_info, MSIRECOR return r; }
-static UINT msi_export_row( MSIRECORD *row, void *arg ) +static UINT export_row( MSIRECORD *row, void *arg ) { - return msi_export_record( arg, row, 1 ); + return export_record( arg, row, 1 ); }
-static UINT msi_export_forcecodepage( HANDLE handle, UINT codepage ) +static UINT export_forcecodepage( HANDLE handle, UINT codepage ) { static const char fmt[] = "\r\n\r\n%u\t_ForceCodepage\r\n"; char data[sizeof(fmt) + 10]; @@ -1030,7 +1029,7 @@ static UINT msi_export_forcecodepage( HANDLE handle, UINT codepage ) return ERROR_SUCCESS; }
-static UINT msi_export_summaryinformation( MSIDATABASE *db, HANDLE handle ) +static UINT export_summaryinformation( MSIDATABASE *db, HANDLE handle ) { static const char header[] = "PropertyId\tValue\r\n" "i2\tl255\r\n" @@ -1075,13 +1074,13 @@ static UINT MSI_DatabaseExport( MSIDATABASE *db, LPCWSTR table, LPCWSTR folder, if (!wcscmp( table, L"_ForceCodepage" )) { UINT codepage = msi_get_string_table_codepage( db->strings ); - r = msi_export_forcecodepage( handle, codepage ); + r = export_forcecodepage( handle, codepage ); goto done; }
if (!wcscmp( table, L"_SummaryInformation" )) { - r = msi_export_summaryinformation( db, handle ); + r = export_summaryinformation( db, handle ); goto done; }
@@ -1094,7 +1093,7 @@ static UINT MSI_DatabaseExport( MSIDATABASE *db, LPCWSTR table, LPCWSTR folder, r = MSI_ViewGetColumnInfo(view, MSICOLINFO_NAMES, &rec); if (r == ERROR_SUCCESS) { - msi_export_record( &row_export_info, rec, 1 ); + export_record( &row_export_info, rec, 1 ); msiobj_release( &rec->hdr ); }
@@ -1102,7 +1101,7 @@ static UINT MSI_DatabaseExport( MSIDATABASE *db, LPCWSTR table, LPCWSTR folder, r = MSI_ViewGetColumnInfo(view, MSICOLINFO_TYPES, &rec); if (r == ERROR_SUCCESS) { - msi_export_record( &row_export_info, rec, 1 ); + export_record( &row_export_info, rec, 1 ); msiobj_release( &rec->hdr ); }
@@ -1111,12 +1110,12 @@ static UINT MSI_DatabaseExport( MSIDATABASE *db, LPCWSTR table, LPCWSTR folder, if (r == ERROR_SUCCESS) { MSI_RecordSetStringW( rec, 0, table ); - msi_export_record( &row_export_info, rec, 0 ); + export_record( &row_export_info, rec, 0 ); msiobj_release( &rec->hdr ); }
/* write out row 4 onwards, the data */ - r = MSI_IterateRecords( view, 0, msi_export_row, &row_export_info ); + r = MSI_IterateRecords( view, 0, export_row, &row_export_info ); msiobj_release( &view->hdr ); }
@@ -1521,7 +1520,7 @@ done: return r; }
-static UINT msi_get_table_labels(MSIDATABASE *db, LPCWSTR table, LPWSTR **labels, DWORD *numlabels) +static UINT get_table_labels(MSIDATABASE *db, const WCHAR *table, WCHAR ***labels, DWORD *numlabels) { UINT r, i, count; MSIRECORD *prec = NULL; @@ -1550,7 +1549,7 @@ end: return r; }
-static UINT msi_get_query_columns(MSIQUERY *query, LPWSTR **columns, DWORD *numcolumns) +static UINT get_query_columns(MSIQUERY *query, WCHAR ***columns, DWORD *numcolumns) { UINT r, i, count; MSIRECORD *prec = NULL; @@ -1579,7 +1578,7 @@ end: return r; }
-static UINT msi_get_query_types(MSIQUERY *query, LPWSTR **types, DWORD *numtypes) +static UINT get_query_types(MSIQUERY *query, WCHAR ***types, DWORD *numtypes) { UINT r, i, count; MSIRECORD *prec = NULL; @@ -1655,7 +1654,7 @@ static void free_merge_table(MERGETABLE *table) free(table); }
-static UINT msi_get_merge_table (MSIDATABASE *db, LPCWSTR name, MERGETABLE **ptable) +static UINT get_merge_table(MSIDATABASE *db, const WCHAR *name, MERGETABLE **ptable) { UINT r; MERGETABLE *table; @@ -1668,7 +1667,7 @@ static UINT msi_get_merge_table (MSIDATABASE *db, LPCWSTR name, MERGETABLE **pta return ERROR_OUTOFMEMORY; }
- r = msi_get_table_labels(db, name, &table->labels, &table->numlabels); + r = get_table_labels(db, name, &table->labels, &table->numlabels); if (r != ERROR_SUCCESS) goto err;
@@ -1676,11 +1675,11 @@ static UINT msi_get_merge_table (MSIDATABASE *db, LPCWSTR name, MERGETABLE **pta if (r != ERROR_SUCCESS) goto err;
- r = msi_get_query_columns(mergeview, &table->columns, &table->numcolumns); + r = get_query_columns(mergeview, &table->columns, &table->numcolumns); if (r != ERROR_SUCCESS) goto err;
- r = msi_get_query_types(mergeview, &table->types, &table->numtypes); + r = get_query_types(mergeview, &table->types, &table->numtypes); if (r != ERROR_SUCCESS) goto err;
@@ -1730,7 +1729,7 @@ static UINT merge_diff_tables(MSIRECORD *rec, LPVOID param) goto done; }
- r = msi_get_merge_table(data->merge, name, &table); + r = get_merge_table(data->merge, name, &table); if (r != ERROR_SUCCESS) goto done;
@@ -1778,8 +1777,7 @@ static UINT merge_table(MSIDATABASE *db, MERGETABLE *table)
if (!TABLE_Exists(db, table->name)) { - r = msi_add_table_to_db(db, table->columns, table->types, - table->labels, table->numlabels, table->numcolumns); + r = add_table_to_db(db, table->columns, table->types, table->labels, table->numlabels, table->numcolumns); if (r != ERROR_SUCCESS) return ERROR_FUNCTION_FAILED; } diff --git a/dlls/msi/dialog.c b/dlls/msi/dialog.c index cfd39d4921c..d7c9b088c24 100644 --- a/dlls/msi/dialog.c +++ b/dlls/msi/dialog.c @@ -140,7 +140,7 @@ typedef struct static DWORD uiThreadId; static HWND hMsiHiddenWindow;
-static LPWSTR msi_get_window_text( HWND hwnd ) +static WCHAR *get_window_text( HWND hwnd ) { UINT sz, r; WCHAR *buf, *new_buf; @@ -162,12 +162,12 @@ static LPWSTR msi_get_window_text( HWND hwnd ) return buf; }
-static INT msi_dialog_scale_unit( msi_dialog *dialog, INT val ) +static INT dialog_scale_unit( msi_dialog *dialog, INT val ) { return MulDiv( val, dialog->scale, 12 ); }
-static msi_control *msi_dialog_find_control( msi_dialog *dialog, LPCWSTR name ) +static msi_control *dialog_find_control( msi_dialog *dialog, LPCWSTR name ) { msi_control *control;
@@ -181,7 +181,7 @@ static msi_control *msi_dialog_find_control( msi_dialog *dialog, LPCWSTR name ) return NULL; }
-static msi_control *msi_dialog_find_control_by_type( msi_dialog *dialog, LPCWSTR type ) +static msi_control *dialog_find_control_by_type( msi_dialog *dialog, LPCWSTR type ) { msi_control *control;
@@ -195,7 +195,7 @@ static msi_control *msi_dialog_find_control_by_type( msi_dialog *dialog, LPCWSTR return NULL; }
-static msi_control *msi_dialog_find_control_by_hwnd( msi_dialog *dialog, HWND hwnd ) +static msi_control *dialog_find_control_by_hwnd( msi_dialog *dialog, HWND hwnd ) { msi_control *control;
@@ -207,7 +207,7 @@ static msi_control *msi_dialog_find_control_by_hwnd( msi_dialog *dialog, HWND hw return NULL; }
-static LPWSTR msi_get_deformatted_field( MSIPACKAGE *package, MSIRECORD *rec, int field ) +static WCHAR *get_deformatted_field( MSIPACKAGE *package, MSIRECORD *rec, int field ) { LPCWSTR str = MSI_RecordGetString( rec, field ); LPWSTR ret = NULL; @@ -217,7 +217,7 @@ static LPWSTR msi_get_deformatted_field( MSIPACKAGE *package, MSIRECORD *rec, in return ret; }
-static LPWSTR msi_dialog_dup_property( msi_dialog *dialog, LPCWSTR property, BOOL indirect ) +static WCHAR *dialog_dup_property( msi_dialog *dialog, const WCHAR *property, BOOL indirect ) { LPWSTR prop = NULL;
@@ -234,12 +234,12 @@ static LPWSTR msi_dialog_dup_property( msi_dialog *dialog, LPCWSTR property, BOO }
/* - * msi_dialog_get_style + * dialog_get_style * * Extract the {\style} string from the front of the text to display and * update the pointer. Only the last style in a list is applied. */ -static LPWSTR msi_dialog_get_style( LPCWSTR p, LPCWSTR *rest ) +static WCHAR *dialog_get_style( const WCHAR *p, const WCHAR **rest ) { LPWSTR ret; LPCWSTR q, i, first; @@ -276,7 +276,7 @@ static LPWSTR msi_dialog_get_style( LPCWSTR p, LPCWSTR *rest ) return ret; }
-static UINT msi_dialog_add_font( MSIRECORD *rec, LPVOID param ) +static UINT dialog_add_font( MSIRECORD *rec, void *param ) { msi_dialog *dialog = param; msi_font *font; @@ -322,7 +322,7 @@ static UINT msi_dialog_add_font( MSIRECORD *rec, LPVOID param ) return ERROR_SUCCESS; }
-static msi_font *msi_dialog_find_font( msi_dialog *dialog, LPCWSTR name ) +static msi_font *dialog_find_font( msi_dialog *dialog, const WCHAR *name ) { msi_font *font = NULL;
@@ -333,11 +333,11 @@ static msi_font *msi_dialog_find_font( msi_dialog *dialog, LPCWSTR name ) return font; }
-static UINT msi_dialog_set_font( msi_dialog *dialog, HWND hwnd, LPCWSTR name ) +static UINT dialog_set_font( msi_dialog *dialog, HWND hwnd, const WCHAR *name ) { msi_font *font;
- font = msi_dialog_find_font( dialog, name ); + font = dialog_find_font( dialog, name ); if( font ) SendMessageW( hwnd, WM_SETFONT, (WPARAM) font->hfont, TRUE ); else @@ -345,7 +345,7 @@ static UINT msi_dialog_set_font( msi_dialog *dialog, HWND hwnd, LPCWSTR name ) return ERROR_SUCCESS; }
-static UINT msi_dialog_build_font_list( msi_dialog *dialog ) +static UINT dialog_build_font_list( msi_dialog *dialog ) { MSIQUERY *view; UINT r; @@ -356,12 +356,12 @@ static UINT msi_dialog_build_font_list( msi_dialog *dialog ) if( r != ERROR_SUCCESS ) return r;
- r = MSI_IterateRecords( view, NULL, msi_dialog_add_font, dialog ); + r = MSI_IterateRecords( view, NULL, dialog_add_font, dialog ); msiobj_release( &view->hdr ); return r; }
-static void msi_destroy_control( msi_control *t ) +static void destroy_control( msi_control *t ) { list_remove( &t->entry ); /* leave dialog->hwnd - destroying parent destroys child windows */ @@ -416,15 +416,15 @@ static msi_control *dialog_create_window( msi_dialog *dialog, MSIRECORD *rec, DW width = MSI_RecordGetInteger( rec, 6 ); height = MSI_RecordGetInteger( rec, 7 );
- x = msi_dialog_scale_unit( dialog, x ); - y = msi_dialog_scale_unit( dialog, y ); - width = msi_dialog_scale_unit( dialog, width ); - height = msi_dialog_scale_unit( dialog, height ); + x = dialog_scale_unit( dialog, x ); + y = dialog_scale_unit( dialog, y ); + width = dialog_scale_unit( dialog, width ); + height = dialog_scale_unit( dialog, height );
if( text ) { deformat_string( dialog->package, text, &title_font ); - font = msi_dialog_get_style( title_font, &title ); + font = dialog_get_style( title_font, &title ); }
control->hwnd = CreateWindowExW( exstyle, szCls, title, style, @@ -433,8 +433,7 @@ static msi_control *dialog_create_window( msi_dialog *dialog, MSIRECORD *rec, DW TRACE("Dialog %s control %s hwnd %p\n", debugstr_w(dialog->name), debugstr_w(text), control->hwnd );
- msi_dialog_set_font( dialog, control->hwnd, - font ? font : dialog->default_font ); + dialog_set_font( dialog, control->hwnd, font ? font : dialog->default_font );
free( title_font ); free( font ); @@ -442,7 +441,7 @@ static msi_control *dialog_create_window( msi_dialog *dialog, MSIRECORD *rec, DW return control; }
-static LPWSTR msi_dialog_get_uitext( msi_dialog *dialog, LPCWSTR key ) +static WCHAR *dialog_get_uitext( msi_dialog *dialog, const WCHAR *key ) { MSIRECORD *rec; LPWSTR text; @@ -454,8 +453,7 @@ static LPWSTR msi_dialog_get_uitext( msi_dialog *dialog, LPCWSTR key ) return text; }
-static HANDLE msi_load_image( MSIDATABASE *db, LPCWSTR name, UINT type, - UINT cx, UINT cy, UINT flags ) +static HANDLE load_image( MSIDATABASE *db, const WCHAR *name, UINT type, UINT cx, UINT cy, UINT flags ) { MSIRECORD *rec; HANDLE himage = NULL; @@ -482,7 +480,7 @@ static HANDLE msi_load_image( MSIDATABASE *db, LPCWSTR name, UINT type, return himage; }
-static HICON msi_load_icon( MSIDATABASE *db, LPCWSTR text, UINT attributes ) +static HICON load_icon( MSIDATABASE *db, const WCHAR *text, UINT attributes ) { DWORD cx = 0, cy = 0, flags;
@@ -502,10 +500,10 @@ static HICON msi_load_icon( MSIDATABASE *db, LPCWSTR text, UINT attributes ) } /* msidbControlAttributesIconSize48 handled by above logic */ } - return msi_load_image( db, text, IMAGE_ICON, cx, cy, flags ); + return load_image( db, text, IMAGE_ICON, cx, cy, flags ); }
-static void msi_dialog_update_controls( msi_dialog *dialog, LPCWSTR property ) +static void dialog_update_controls( msi_dialog *dialog, const WCHAR *property ) { msi_control *control;
@@ -516,7 +514,7 @@ static void msi_dialog_update_controls( msi_dialog *dialog, LPCWSTR property ) } }
-static void msi_dialog_update_all_controls( msi_dialog *dialog ) +static void dialog_update_all_controls( msi_dialog *dialog ) { msi_control *control;
@@ -527,14 +525,14 @@ static void msi_dialog_update_all_controls( msi_dialog *dialog ) } }
-static void msi_dialog_set_property( MSIPACKAGE *package, LPCWSTR property, LPCWSTR value ) +static void dialog_set_property( MSIPACKAGE *package, const WCHAR *property, const WCHAR *value ) { UINT r = msi_set_property( package->db, property, value, -1 ); if (r == ERROR_SUCCESS && !wcscmp( property, L"SourceDir" )) msi_reset_source_folders( package ); }
-static MSIFEATURE *msi_seltree_feature_from_item( HWND hwnd, HTREEITEM hItem ) +static MSIFEATURE *seltree_feature_from_item( HWND hwnd, HTREEITEM hItem ) { TVITEMW tvi;
@@ -554,18 +552,17 @@ struct msi_selection_tree_info HTREEITEM selected; };
-static MSIFEATURE *msi_seltree_get_selected_feature( msi_control *control ) +static MSIFEATURE *seltree_get_selected_feature( msi_control *control ) { struct msi_selection_tree_info *info = GetPropW( control->hwnd, L"MSIDATA" ); - return msi_seltree_feature_from_item( control->hwnd, info->selected ); + return seltree_feature_from_item( control->hwnd, info->selected ); }
-static void dialog_handle_event( msi_dialog *dialog, const WCHAR *control, - const WCHAR *attribute, MSIRECORD *rec ) +static void dialog_handle_event( msi_dialog *dialog, const WCHAR *control, const WCHAR *attribute, MSIRECORD *rec ) { msi_control* ctrl;
- ctrl = msi_dialog_find_control( dialog, control ); + ctrl = dialog_find_control( dialog, control ); if (!ctrl) return; if( !wcscmp( attribute, L"Text" ) ) @@ -574,7 +571,7 @@ static void dialog_handle_event( msi_dialog *dialog, const WCHAR *control, WCHAR *font, *text_fmt = NULL;
font_text = MSI_RecordGetString( rec , 1 ); - font = msi_dialog_get_style( font_text, &text ); + font = dialog_get_style( font_text, &text ); deformat_string( dialog->package, text, &text_fmt ); if (text_fmt) text = text_fmt; else text = L""; @@ -642,13 +639,13 @@ static void dialog_handle_event( msi_dialog *dialog, const WCHAR *control, } else if ( !wcscmp( attribute, L"Property" ) ) { - MSIFEATURE *feature = msi_seltree_get_selected_feature( ctrl ); - if (feature) msi_dialog_set_property( dialog->package, ctrl->property, feature->Directory ); + MSIFEATURE *feature = seltree_get_selected_feature( ctrl ); + if (feature) dialog_set_property( dialog->package, ctrl->property, feature->Directory ); } else if ( !wcscmp( attribute, L"SelectionPath" ) ) { BOOL indirect = ctrl->attributes & msidbControlAttributesIndirect; - LPWSTR path = msi_dialog_dup_property( dialog, ctrl->property, indirect ); + WCHAR *path = dialog_dup_property( dialog, ctrl->property, indirect ); if (!path) return; SetWindowTextW( ctrl->hwnd, path ); free( path ); @@ -721,8 +718,7 @@ static void dialog_map_events( msi_dialog *dialog, const WCHAR *control ) }
/* everything except radio buttons */ -static msi_control *msi_dialog_add_control( msi_dialog *dialog, - MSIRECORD *rec, LPCWSTR szCls, DWORD style ) +static msi_control *dialog_add_control( msi_dialog *dialog, MSIRECORD *rec, const WCHAR *szCls, DWORD style ) { DWORD attributes; const WCHAR *text = NULL, *name, *control_type; @@ -758,7 +754,7 @@ struct msi_text_info * we don't erase our own background, * so we have to make sure that the parent window redraws first */ -static void msi_text_on_settext( HWND hWnd ) +static void text_on_settext( HWND hWnd ) { HWND hParent; RECT rc; @@ -769,8 +765,7 @@ static void msi_text_on_settext( HWND hWnd ) InvalidateRect( hParent, &rc, TRUE ); }
-static LRESULT WINAPI -MSIText_WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) +static LRESULT WINAPI MSIText_WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) { struct msi_text_info *info; LRESULT r = 0; @@ -793,7 +788,7 @@ MSIText_WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) switch( msg ) { case WM_SETTEXT: - msi_text_on_settext( hWnd ); + text_on_settext( hWnd ); break; case WM_NCDESTROY: free( info ); @@ -804,7 +799,7 @@ MSIText_WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) return r; }
-static UINT msi_dialog_text_control( msi_dialog *dialog, MSIRECORD *rec ) +static UINT dialog_text_control( msi_dialog *dialog, MSIRECORD *rec ) { msi_control *control; struct msi_text_info *info; @@ -813,7 +808,7 @@ static UINT msi_dialog_text_control( msi_dialog *dialog, MSIRECORD *rec )
TRACE("%p %p\n", dialog, rec);
- control = msi_dialog_add_control( dialog, rec, L"Static", SS_LEFT | WS_GROUP ); + control = dialog_add_control( dialog, rec, L"Static", SS_LEFT | WS_GROUP ); if( !control ) return ERROR_FUNCTION_FAILED;
@@ -824,11 +819,11 @@ static UINT msi_dialog_text_control( msi_dialog *dialog, MSIRECORD *rec ) control_name = MSI_RecordGetString( rec, 2 ); control->attributes = MSI_RecordGetInteger( rec, 8 ); prop = MSI_RecordGetString( rec, 9 ); - control->property = msi_dialog_dup_property( dialog, prop, FALSE ); + control->property = dialog_dup_property( dialog, prop, FALSE );
text = MSI_RecordGetString( rec, 10 ); - font_name = msi_dialog_get_style( text, &ptr ); - info->font = ( font_name ) ? msi_dialog_find_font( dialog, font_name ) : NULL; + font_name = dialog_get_style( text, &ptr ); + info->font = ( font_name ) ? dialog_find_font( dialog, font_name ) : NULL; free( font_name );
info->attributes = MSI_RecordGetInteger( rec, 8 ); @@ -844,11 +839,11 @@ static UINT msi_dialog_text_control( msi_dialog *dialog, MSIRECORD *rec ) }
/* strip any leading text style label from text field */ -static WCHAR *msi_get_binary_name( MSIPACKAGE *package, MSIRECORD *rec ) +static WCHAR *get_binary_name( MSIPACKAGE *package, MSIRECORD *rec ) { WCHAR *p, *text;
- text = msi_get_deformatted_field( package, rec, 10 ); + text = get_deformatted_field( package, rec, 10 ); if (!text) return NULL;
@@ -864,7 +859,7 @@ static WCHAR *msi_get_binary_name( MSIPACKAGE *package, MSIRECORD *rec ) return p; }
-static UINT msi_dialog_set_property_event( msi_dialog *dialog, LPCWSTR event, LPCWSTR arg ) +static UINT dialog_set_property_event( msi_dialog *dialog, const WCHAR *event, const WCHAR *arg ) { LPWSTR p, prop, arg_fmt = NULL; UINT len; @@ -877,8 +872,8 @@ static UINT msi_dialog_set_property_event( msi_dialog *dialog, LPCWSTR event, LP { *p = 0; if (wcscmp( L"{}", arg )) deformat_string( dialog->package, arg, &arg_fmt ); - msi_dialog_set_property( dialog->package, prop, arg_fmt ); - msi_dialog_update_controls( dialog, prop ); + dialog_set_property( dialog->package, prop, arg_fmt ); + dialog_update_controls( dialog, prop ); free( arg_fmt ); } else ERR("Badly formatted property string - what happens?\n"); @@ -886,7 +881,7 @@ static UINT msi_dialog_set_property_event( msi_dialog *dialog, LPCWSTR event, LP return ERROR_SUCCESS; }
-static UINT msi_dialog_send_event( msi_dialog *dialog, LPCWSTR event, LPCWSTR arg ) +static UINT dialog_send_event( msi_dialog *dialog, const WCHAR *event, const WCHAR *arg ) { LPWSTR event_fmt = NULL, arg_fmt = NULL;
@@ -903,7 +898,7 @@ static UINT msi_dialog_send_event( msi_dialog *dialog, LPCWSTR event, LPCWSTR ar return ERROR_SUCCESS; }
-static UINT msi_dialog_control_event( MSIRECORD *rec, LPVOID param ) +static UINT dialog_control_event( MSIRECORD *rec, void *param ) { msi_dialog *dialog = param; LPCWSTR condition, event, arg; @@ -916,14 +911,14 @@ static UINT msi_dialog_control_event( MSIRECORD *rec, LPVOID param ) event = MSI_RecordGetString( rec, 3 ); arg = MSI_RecordGetString( rec, 4 ); if (event[0] == '[') - msi_dialog_set_property_event( dialog, event, arg ); + dialog_set_property_event( dialog, event, arg ); else - msi_dialog_send_event( dialog, event, arg ); + dialog_send_event( dialog, event, arg ); } return ERROR_SUCCESS; }
-static UINT msi_dialog_button_handler( msi_dialog *dialog, msi_control *control, WPARAM param ) +static UINT dialog_button_handler( msi_dialog *dialog, msi_control *control, WPARAM param ) { MSIQUERY *view; UINT r; @@ -939,7 +934,7 @@ static UINT msi_dialog_button_handler( msi_dialog *dialog, msi_control *control, ERR("query failed\n"); return ERROR_SUCCESS; } - r = MSI_IterateRecords( view, 0, msi_dialog_control_event, dialog ); + r = MSI_IterateRecords( view, 0, dialog_control_event, dialog ); msiobj_release( &view->hdr );
/* dialog control events must be processed last regardless of ordering */ @@ -954,7 +949,7 @@ static UINT msi_dialog_button_handler( msi_dialog *dialog, msi_control *control, return r; }
-static HBITMAP msi_load_picture( MSIDATABASE *db, const WCHAR *name, INT cx, INT cy, DWORD flags ) +static HBITMAP load_picture( MSIDATABASE *db, const WCHAR *name, INT cx, INT cy, DWORD flags ) { HBITMAP hOleBitmap = 0, hBitmap = 0, hOldSrcBitmap, hOldDestBitmap; MSIRECORD *rec = NULL; @@ -1018,7 +1013,7 @@ end: return hBitmap; }
-static UINT msi_dialog_button_control( msi_dialog *dialog, MSIRECORD *rec ) +static UINT dialog_button_control( msi_dialog *dialog, MSIRECORD *rec ) { msi_control *control; UINT attributes, style, cx = 0, cy = 0, flags = 0; @@ -1035,21 +1030,21 @@ static UINT msi_dialog_button_control( msi_dialog *dialog, MSIRECORD *rec ) if (attributes & msidbControlAttributesFixedSize) flags |= LR_DEFAULTSIZE; else { - cx = msi_dialog_scale_unit( dialog, MSI_RecordGetInteger(rec, 6) ); - cy = msi_dialog_scale_unit( dialog, MSI_RecordGetInteger(rec, 7) ); + cx = dialog_scale_unit( dialog, MSI_RecordGetInteger(rec, 6) ); + cy = dialog_scale_unit( dialog, MSI_RecordGetInteger(rec, 7) ); } }
- control = msi_dialog_add_control( dialog, rec, L"BUTTON", style ); + control = dialog_add_control( dialog, rec, L"BUTTON", style ); if (!control) return ERROR_FUNCTION_FAILED;
- control->handler = msi_dialog_button_handler; + control->handler = dialog_button_handler;
if (attributes & msidbControlAttributesIcon) { - name = msi_get_binary_name( dialog->package, rec ); - control->hIcon = msi_load_icon( dialog->package->db, name, attributes ); + name = get_binary_name( dialog->package, rec ); + control->hIcon = load_icon( dialog->package->db, name, attributes ); if (control->hIcon) { SendMessageW( control->hwnd, BM_SETIMAGE, IMAGE_ICON, (LPARAM) control->hIcon ); @@ -1058,8 +1053,8 @@ static UINT msi_dialog_button_control( msi_dialog *dialog, MSIRECORD *rec ) } else if (attributes & msidbControlAttributesBitmap) { - name = msi_get_binary_name( dialog->package, rec ); - control->hBitmap = msi_load_picture( dialog->package->db, name, cx, cy, flags ); + name = get_binary_name( dialog->package, rec ); + control->hBitmap = load_picture( dialog->package->db, name, cx, cy, flags ); if (control->hBitmap) { SendMessageW( control->hwnd, BM_SETIMAGE, IMAGE_BITMAP, (LPARAM) control->hBitmap ); @@ -1071,7 +1066,7 @@ static UINT msi_dialog_button_control( msi_dialog *dialog, MSIRECORD *rec ) return ERROR_SUCCESS; }
-static LPWSTR msi_get_checkbox_value( msi_dialog *dialog, LPCWSTR prop ) +static WCHAR *get_checkbox_value( msi_dialog *dialog, const WCHAR *prop ) { MSIRECORD *rec = NULL; LPWSTR ret = NULL; @@ -1081,7 +1076,7 @@ static LPWSTR msi_get_checkbox_value( msi_dialog *dialog, LPCWSTR prop ) if (!rec) return ret;
- ret = msi_get_deformatted_field( dialog->package, rec, 2 ); + ret = get_deformatted_field( dialog->package, rec, 2 ); if( ret && !ret[0] ) { free( ret ); @@ -1101,7 +1096,7 @@ static LPWSTR msi_get_checkbox_value( msi_dialog *dialog, LPCWSTR prop ) return ret; }
-static UINT msi_dialog_get_checkbox_state( msi_dialog *dialog, msi_control *control ) +static UINT dialog_get_checkbox_state( msi_dialog *dialog, msi_control *control ) { WCHAR state[2] = {0}; DWORD sz = 2; @@ -1110,14 +1105,14 @@ static UINT msi_dialog_get_checkbox_state( msi_dialog *dialog, msi_control *cont return state[0] ? 1 : 0; }
-static void msi_dialog_set_checkbox_state( msi_dialog *dialog, msi_control *control, UINT state ) +static void dialog_set_checkbox_state( msi_dialog *dialog, msi_control *control, UINT state ) { LPCWSTR val;
/* if uncheck then the property is set to NULL */ if (!state) { - msi_dialog_set_property( dialog->package, control->property, NULL ); + dialog_set_property( dialog->package, control->property, NULL ); return; }
@@ -1127,16 +1122,16 @@ static void msi_dialog_set_checkbox_state( msi_dialog *dialog, msi_control *cont else val = L"1";
- msi_dialog_set_property( dialog->package, control->property, val ); + dialog_set_property( dialog->package, control->property, val ); }
-static void msi_dialog_checkbox_sync_state( msi_dialog *dialog, msi_control *control ) +static void dialog_checkbox_sync_state( msi_dialog *dialog, msi_control *control ) { - UINT state = msi_dialog_get_checkbox_state( dialog, control ); + UINT state = dialog_get_checkbox_state( dialog, control ); SendMessageW( control->hwnd, BM_SETCHECK, state ? BST_CHECKED : BST_UNCHECKED, 0 ); }
-static UINT msi_dialog_checkbox_handler( msi_dialog *dialog, msi_control *control, WPARAM param ) +static UINT dialog_checkbox_handler( msi_dialog *dialog, msi_control *control, WPARAM param ) { UINT state;
@@ -1145,36 +1140,36 @@ static UINT msi_dialog_checkbox_handler( msi_dialog *dialog, msi_control *contro
TRACE("clicked checkbox %s, set %s\n", debugstr_w(control->name), debugstr_w(control->property));
- state = msi_dialog_get_checkbox_state( dialog, control ); + state = dialog_get_checkbox_state( dialog, control ); state = state ? 0 : 1; - msi_dialog_set_checkbox_state( dialog, control, state ); - msi_dialog_checkbox_sync_state( dialog, control ); + dialog_set_checkbox_state( dialog, control, state ); + dialog_checkbox_sync_state( dialog, control );
- return msi_dialog_button_handler( dialog, control, param ); + return dialog_button_handler( dialog, control, param ); }
-static UINT msi_dialog_checkbox_control( msi_dialog *dialog, MSIRECORD *rec ) +static UINT dialog_checkbox_control( msi_dialog *dialog, MSIRECORD *rec ) { msi_control *control; LPCWSTR prop;
TRACE("%p %p\n", dialog, rec);
- control = msi_dialog_add_control( dialog, rec, L"BUTTON", BS_CHECKBOX | BS_MULTILINE | WS_TABSTOP ); - control->handler = msi_dialog_checkbox_handler; - control->update = msi_dialog_checkbox_sync_state; + control = dialog_add_control( dialog, rec, L"BUTTON", BS_CHECKBOX | BS_MULTILINE | WS_TABSTOP ); + control->handler = dialog_checkbox_handler; + control->update = dialog_checkbox_sync_state; prop = MSI_RecordGetString( rec, 9 ); if (prop) { control->property = wcsdup( prop ); - control->value = msi_get_checkbox_value( dialog, prop ); + control->value = get_checkbox_value( dialog, prop ); TRACE("control %s value %s\n", debugstr_w(control->property), debugstr_w(control->value)); } - msi_dialog_checkbox_sync_state( dialog, control ); + dialog_checkbox_sync_state( dialog, control ); return ERROR_SUCCESS; }
-static UINT msi_dialog_line_control( msi_dialog *dialog, MSIRECORD *rec ) +static UINT dialog_line_control( msi_dialog *dialog, MSIRECORD *rec ) { DWORD attributes; LPCWSTR name; @@ -1220,9 +1215,9 @@ static UINT msi_dialog_line_control( msi_dialog *dialog, MSIRECORD *rec ) y = MSI_RecordGetInteger( rec, 5 ); width = MSI_RecordGetInteger( rec, 6 );
- x = msi_dialog_scale_unit( dialog, x ); - y = msi_dialog_scale_unit( dialog, y ); - width = msi_dialog_scale_unit( dialog, width ); + x = dialog_scale_unit( dialog, x ); + y = dialog_scale_unit( dialog, y ); + width = dialog_scale_unit( dialog, width ); height = 2; /* line is exactly 2 units in height */
control->hwnd = CreateWindowExW( exstyle, L"Static", NULL, style, @@ -1243,8 +1238,7 @@ struct msi_scrolltext_info WNDPROC oldproc; };
-static LRESULT WINAPI -MSIScrollText_WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) +static LRESULT WINAPI MSIScrollText_WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) { struct msi_scrolltext_info *info; HRESULT r; @@ -1265,7 +1259,7 @@ MSIScrollText_WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) break; case WM_PAINT: /* native MSI sets a wait cursor here */ - msi_dialog_button_handler( info->dialog, info->control, BN_CLICKED ); + dialog_button_handler( info->dialog, info->control, BN_CLICKED ); break; } return r; @@ -1278,8 +1272,7 @@ struct msi_streamin_info DWORD length; };
-static DWORD CALLBACK -msi_richedit_stream_in( DWORD_PTR arg, LPBYTE buffer, LONG count, LONG *pcb ) +static DWORD CALLBACK richedit_stream_in( DWORD_PTR arg, BYTE *buffer, LONG count, LONG *pcb ) { struct msi_streamin_info *info = (struct msi_streamin_info*) arg;
@@ -1294,7 +1287,7 @@ msi_richedit_stream_in( DWORD_PTR arg, LPBYTE buffer, LONG count, LONG *pcb ) return 0; }
-static void msi_scrolltext_add_text( msi_control *control, LPCWSTR text ) +static void scrolltext_add_text( msi_control *control, const WCHAR *text ) { struct msi_streamin_info info; EDITSTREAM es; @@ -1305,14 +1298,14 @@ static void msi_scrolltext_add_text( msi_control *control, LPCWSTR text )
es.dwCookie = (DWORD_PTR) &info; es.dwError = 0; - es.pfnCallback = msi_richedit_stream_in; + es.pfnCallback = richedit_stream_in;
SendMessageW( control->hwnd, EM_STREAMIN, SF_RTF, (LPARAM) &es );
free( info.string ); }
-static UINT msi_dialog_scrolltext_control( msi_dialog *dialog, MSIRECORD *rec ) +static UINT dialog_scrolltext_control( msi_dialog *dialog, MSIRECORD *rec ) { struct msi_scrolltext_info *info; msi_control *control; @@ -1328,7 +1321,7 @@ static UINT msi_dialog_scrolltext_control( msi_dialog *dialog, MSIRECORD *rec )
style = WS_BORDER | ES_MULTILINE | WS_VSCROLL | ES_READONLY | ES_AUTOVSCROLL | WS_TABSTOP; - control = msi_dialog_add_control( dialog, rec, L"RichEdit20W", style ); + control = dialog_add_control( dialog, rec, L"RichEdit20W", style ); if (!control) { FreeLibrary( hRichedit ); @@ -1349,13 +1342,13 @@ static UINT msi_dialog_scrolltext_control( msi_dialog *dialog, MSIRECORD *rec ) /* add the text into the richedit */ text = MSI_RecordGetString( rec, 10 ); if (text) - msi_scrolltext_add_text( control, text ); + scrolltext_add_text( control, text );
return ERROR_SUCCESS; }
-static UINT msi_dialog_bitmap_control( msi_dialog *dialog, MSIRECORD *rec ) +static UINT dialog_bitmap_control( msi_dialog *dialog, MSIRECORD *rec ) { UINT cx, cy, flags, style, attributes; msi_control *control; @@ -1371,14 +1364,14 @@ static UINT msi_dialog_bitmap_control( msi_dialog *dialog, MSIRECORD *rec ) style |= SS_CENTERIMAGE; }
- control = msi_dialog_add_control( dialog, rec, L"Static", style ); + control = dialog_add_control( dialog, rec, L"Static", style ); cx = MSI_RecordGetInteger( rec, 6 ); cy = MSI_RecordGetInteger( rec, 7 ); - cx = msi_dialog_scale_unit( dialog, cx ); - cy = msi_dialog_scale_unit( dialog, cy ); + cx = dialog_scale_unit( dialog, cx ); + cy = dialog_scale_unit( dialog, cy );
- name = msi_get_binary_name( dialog->package, rec ); - control->hBitmap = msi_load_picture( dialog->package->db, name, cx, cy, flags ); + name = get_binary_name( dialog->package, rec ); + control->hBitmap = load_picture( dialog->package->db, name, cx, cy, flags ); if( control->hBitmap ) SendMessageW( control->hwnd, STM_SETIMAGE, IMAGE_BITMAP, (LPARAM) control->hBitmap ); @@ -1390,7 +1383,7 @@ static UINT msi_dialog_bitmap_control( msi_dialog *dialog, MSIRECORD *rec ) return ERROR_SUCCESS; }
-static UINT msi_dialog_icon_control( msi_dialog *dialog, MSIRECORD *rec ) +static UINT dialog_icon_control( msi_dialog *dialog, MSIRECORD *rec ) { msi_control *control; DWORD attributes; @@ -1398,12 +1391,11 @@ static UINT msi_dialog_icon_control( msi_dialog *dialog, MSIRECORD *rec )
TRACE("\n");
- control = msi_dialog_add_control( dialog, rec, L"Static", - SS_ICON | SS_CENTERIMAGE | WS_GROUP ); + control = dialog_add_control( dialog, rec, L"Static", SS_ICON | SS_CENTERIMAGE | WS_GROUP );
attributes = MSI_RecordGetInteger( rec, 8 ); - name = msi_get_binary_name( dialog->package, rec ); - control->hIcon = msi_load_icon( dialog->package->db, name, attributes ); + name = get_binary_name( dialog->package, rec ); + control->hIcon = load_icon( dialog->package->db, name, attributes ); if( control->hIcon ) SendMessageW( control->hwnd, STM_SETICON, (WPARAM) control->hIcon, 0 ); else @@ -1452,7 +1444,7 @@ static LRESULT WINAPI MSIComboBox_WndProc(HWND hWnd, UINT msg, WPARAM wParam, LP return r; }
-static UINT msi_combobox_add_item( MSIRECORD *rec, LPVOID param ) +static UINT combobox_add_item( MSIRECORD *rec, void *param ) { struct msi_combobox_info *info = param; LPCWSTR value, text; @@ -1470,7 +1462,7 @@ static UINT msi_combobox_add_item( MSIRECORD *rec, LPVOID param ) return ERROR_SUCCESS; }
-static UINT msi_combobox_add_items( struct msi_combobox_info *info, LPCWSTR property ) +static UINT combobox_add_items( struct msi_combobox_info *info, const WCHAR *property ) { MSIQUERY *view; DWORD count; @@ -1492,12 +1484,12 @@ static UINT msi_combobox_add_items( struct msi_combobox_info *info, LPCWSTR prop info->num_items = count; info->items = malloc( sizeof(*info->items) * count );
- r = MSI_IterateRecords( view, NULL, msi_combobox_add_item, info ); + r = MSI_IterateRecords( view, NULL, combobox_add_item, info ); msiobj_release( &view->hdr ); return r; }
-static UINT msi_dialog_set_control_condition( MSIRECORD *rec, LPVOID param ) +static UINT dialog_set_control_condition( MSIRECORD *rec, void *param ) { msi_dialog *dialog = param; msi_control *control; @@ -1508,7 +1500,7 @@ static UINT msi_dialog_set_control_condition( MSIRECORD *rec, LPVOID param ) action = MSI_RecordGetString( rec, 3 ); condition = MSI_RecordGetString( rec, 4 ); r = MSI_EvaluateConditionW( dialog->package, condition ); - control = msi_dialog_find_control( dialog, name ); + control = dialog_find_control( dialog, name ); if (r == MSICONDITION_TRUE && control) { TRACE("%s control %s\n", debugstr_w(action), debugstr_w(name)); @@ -1530,7 +1522,7 @@ static UINT msi_dialog_set_control_condition( MSIRECORD *rec, LPVOID param ) return ERROR_SUCCESS; }
-static UINT msi_dialog_evaluate_control_conditions( msi_dialog *dialog ) +static UINT dialog_evaluate_control_conditions( msi_dialog *dialog ) { UINT r; MSIQUERY *view; @@ -1543,12 +1535,12 @@ static UINT msi_dialog_evaluate_control_conditions( msi_dialog *dialog ) if (r != ERROR_SUCCESS) return ERROR_SUCCESS;
- r = MSI_IterateRecords( view, 0, msi_dialog_set_control_condition, dialog ); + r = MSI_IterateRecords( view, 0, dialog_set_control_condition, dialog ); msiobj_release( &view->hdr ); return r; }
-static UINT msi_dialog_combobox_handler( msi_dialog *dialog, msi_control *control, WPARAM param ) +static UINT dialog_combobox_handler( msi_dialog *dialog, msi_control *control, WPARAM param ) { struct msi_combobox_info *info; int index; @@ -1560,12 +1552,12 @@ static UINT msi_dialog_combobox_handler( msi_dialog *dialog, msi_control *contro info = GetPropW( control->hwnd, L"MSIDATA" ); index = SendMessageW( control->hwnd, CB_GETCURSEL, 0, 0 ); if (index == CB_ERR) - value = msi_get_window_text( control->hwnd ); + value = get_window_text( control->hwnd ); else value = (LPWSTR) SendMessageW( control->hwnd, CB_GETITEMDATA, index, 0 );
- msi_dialog_set_property( info->dialog->package, control->property, value ); - msi_dialog_evaluate_control_conditions( info->dialog ); + dialog_set_property( info->dialog->package, control->property, value ); + dialog_evaluate_control_conditions( info->dialog );
if (index == CB_ERR) free( value ); @@ -1573,7 +1565,7 @@ static UINT msi_dialog_combobox_handler( msi_dialog *dialog, msi_control *contro return ERROR_SUCCESS; }
-static void msi_dialog_combobox_update( msi_dialog *dialog, msi_control *control ) +static void dialog_combobox_update( msi_dialog *dialog, msi_control *control ) { struct msi_combobox_info *info; LPWSTR value, tmp; @@ -1608,7 +1600,7 @@ static void msi_dialog_combobox_update( msi_dialog *dialog, msi_control *control free( value ); }
-static UINT msi_dialog_combo_control( msi_dialog *dialog, MSIRECORD *rec ) +static UINT dialog_combo_control( msi_dialog *dialog, MSIRECORD *rec ) { struct msi_combobox_info *info; msi_control *control; @@ -1628,18 +1620,18 @@ static UINT msi_dialog_combo_control( msi_dialog *dialog, MSIRECORD *rec ) else style |= CBS_DROPDOWN;
- control = msi_dialog_add_control( dialog, rec, WC_COMBOBOXW, style ); + control = dialog_add_control( dialog, rec, WC_COMBOBOXW, style ); if (!control) { free( info ); return ERROR_FUNCTION_FAILED; }
- control->handler = msi_dialog_combobox_handler; - control->update = msi_dialog_combobox_update; + control->handler = dialog_combobox_handler; + control->update = dialog_combobox_update;
prop = MSI_RecordGetString( rec, 9 ); - control->property = msi_dialog_dup_property( dialog, prop, FALSE ); + control->property = dialog_dup_property( dialog, prop, FALSE );
/* subclass */ info->dialog = dialog; @@ -1651,14 +1643,14 @@ static UINT msi_dialog_combo_control( msi_dialog *dialog, MSIRECORD *rec ) SetPropW( control->hwnd, L"MSIDATA", info );
if (control->property) - msi_combobox_add_items( info, control->property ); + combobox_add_items( info, control->property );
- msi_dialog_combobox_update( dialog, control ); + dialog_combobox_update( dialog, control );
return ERROR_SUCCESS; }
-static UINT msi_dialog_edit_handler( msi_dialog *dialog, msi_control *control, WPARAM param ) +static UINT dialog_edit_handler( msi_dialog *dialog, msi_control *control, WPARAM param ) { LPWSTR buf;
@@ -1667,8 +1659,8 @@ static UINT msi_dialog_edit_handler( msi_dialog *dialog, msi_control *control, W
TRACE("edit %s contents changed, set %s\n", debugstr_w(control->name), debugstr_w(control->property));
- buf = msi_get_window_text( control->hwnd ); - msi_dialog_set_property( dialog->package, control->property, buf ); + buf = get_window_text( control->hwnd ); + dialog_set_property( dialog->package, control->property, buf ); free( buf );
return ERROR_SUCCESS; @@ -1677,7 +1669,7 @@ static UINT msi_dialog_edit_handler( msi_dialog *dialog, msi_control *control, W /* length of 2^32 + 1 */ #define MAX_NUM_DIGITS 11
-static UINT msi_dialog_edit_control( msi_dialog *dialog, MSIRECORD *rec ) +static UINT dialog_edit_control( msi_dialog *dialog, MSIRECORD *rec ) { msi_control *control; LPCWSTR prop, text; @@ -1685,9 +1677,8 @@ static UINT msi_dialog_edit_control( msi_dialog *dialog, MSIRECORD *rec ) WCHAR num[MAX_NUM_DIGITS]; DWORD limit;
- control = msi_dialog_add_control( dialog, rec, L"Edit", - WS_BORDER | WS_TABSTOP | ES_AUTOHSCROLL ); - control->handler = msi_dialog_edit_handler; + control = dialog_add_control( dialog, rec, L"Edit", WS_BORDER | WS_TABSTOP | ES_AUTOHSCROLL ); + control->handler = dialog_edit_handler;
text = MSI_RecordGetString( rec, 10 ); if ( text ) @@ -1739,7 +1730,7 @@ struct msi_maskedit_info struct msi_mask_group group[MASK_MAX_GROUPS]; };
-static BOOL msi_mask_editable( WCHAR type ) +static BOOL mask_editable( WCHAR type ) { switch (type) { @@ -1754,7 +1745,7 @@ static BOOL msi_mask_editable( WCHAR type ) return FALSE; }
-static void msi_mask_control_change( struct msi_maskedit_info *info ) +static void mask_control_change( struct msi_maskedit_info *info ) { LPWSTR val; UINT i, n, r; @@ -1775,7 +1766,7 @@ static void msi_mask_control_change( struct msi_maskedit_info *info ) ERR("can't fit control %d text into template\n",i); break; } - if (!msi_mask_editable(info->group[i].type)) + if (!mask_editable(info->group[i].type)) { for(r=0; r<info->group[i].len; r++) val[n+r] = info->group[i].type; @@ -1796,14 +1787,14 @@ static void msi_mask_control_change( struct msi_maskedit_info *info ) if( i == info->num_groups ) { TRACE("Set property %s to %s\n", debugstr_w(info->prop), debugstr_w(val)); - msi_dialog_set_property( info->dialog->package, info->prop, val ); - msi_dialog_evaluate_control_conditions( info->dialog ); + dialog_set_property( info->dialog->package, info->prop, val ); + dialog_evaluate_control_conditions( info->dialog ); } free( val ); }
/* now move to the next control if necessary */ -static VOID msi_mask_next_control( struct msi_maskedit_info *info, HWND hWnd ) +static void mask_next_control( struct msi_maskedit_info *info, HWND hWnd ) { HWND hWndNext; UINT len, i; @@ -1824,8 +1815,7 @@ static VOID msi_mask_next_control( struct msi_maskedit_info *info, HWND hWnd ) SetFocus( hWndNext ); }
-static LRESULT WINAPI -MSIMaskedEdit_WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) +static LRESULT WINAPI MSIMaskedEdit_WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) { struct msi_maskedit_info *info; HRESULT r; @@ -1841,8 +1831,8 @@ MSIMaskedEdit_WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) case WM_COMMAND: if (HIWORD(wParam) == EN_CHANGE) { - msi_mask_control_change( info ); - msi_mask_next_control( info, (HWND) lParam ); + mask_control_change( info ); + mask_next_control( info, (HWND) lParam ); } break; case WM_NCDESTROY: @@ -1856,8 +1846,7 @@ MSIMaskedEdit_WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) }
/* fish the various bits of the property out and put them in the control */ -static void -msi_maskedit_set_text( struct msi_maskedit_info *info, LPCWSTR text ) +static void maskedit_set_text( struct msi_maskedit_info *info, const WCHAR *text ) { LPCWSTR p; UINT i; @@ -1881,7 +1870,7 @@ msi_maskedit_set_text( struct msi_maskedit_info *info, LPCWSTR text ) } }
-static struct msi_maskedit_info * msi_dialog_parse_groups( LPCWSTR mask ) +static struct msi_maskedit_info *dialog_parse_groups( const WCHAR *mask ) { struct msi_maskedit_info *info; int i = 0, n = 0, total = 0; @@ -1942,8 +1931,7 @@ static struct msi_maskedit_info * msi_dialog_parse_groups( LPCWSTR mask ) return info; }
-static void -msi_maskedit_create_children( struct msi_maskedit_info *info, LPCWSTR font ) +static void maskedit_create_children( struct msi_maskedit_info *info, const WCHAR *font ) { DWORD width, height, style, wx, ww; RECT rect; @@ -1959,7 +1947,7 @@ msi_maskedit_create_children( struct msi_maskedit_info *info, LPCWSTR font )
for( i = 0; i < info->num_groups; i++ ) { - if (!msi_mask_editable( info->group[i].type )) + if (!mask_editable( info->group[i].type )) continue; if (info->num_chars) { @@ -1981,8 +1969,7 @@ msi_maskedit_create_children( struct msi_maskedit_info *info, LPCWSTR font )
SendMessageW( hwnd, EM_LIMITTEXT, info->group[i].len, 0 );
- msi_dialog_set_font( info->dialog, hwnd, - font?font:info->dialog->default_font ); + dialog_set_font( info->dialog, hwnd, font?font:info->dialog->default_font ); info->group[i].hwnd = hwnd; } } @@ -1992,7 +1979,7 @@ msi_maskedit_create_children( struct msi_maskedit_info *info, LPCWSTR font ) * delphi 7 uses "<????-??????-??????-????>" and "<???-???>" * filemaker pro 7 uses "<^^^^=^^^^=^^^^=^^^^=^^^^=^^^^=^^^^^>" */ -static UINT msi_dialog_maskedit_control( msi_dialog *dialog, MSIRECORD *rec ) +static UINT dialog_maskedit_control( msi_dialog *dialog, MSIRECORD *rec ) { LPWSTR font_mask, val = NULL, font; struct msi_maskedit_info *info = NULL; @@ -2002,15 +1989,15 @@ static UINT msi_dialog_maskedit_control( msi_dialog *dialog, MSIRECORD *rec )
TRACE("\n");
- font_mask = msi_get_deformatted_field( dialog->package, rec, 10 ); - font = msi_dialog_get_style( font_mask, &mask ); + font_mask = get_deformatted_field( dialog->package, rec, 10 ); + font = dialog_get_style( font_mask, &mask ); if( !mask ) { WARN("mask template is empty\n"); goto end; }
- info = msi_dialog_parse_groups( mask ); + info = dialog_parse_groups( mask ); if( !info ) { ERR("template %s is invalid\n", debugstr_w(mask)); @@ -2019,8 +2006,7 @@ static UINT msi_dialog_maskedit_control( msi_dialog *dialog, MSIRECORD *rec )
info->dialog = dialog;
- control = msi_dialog_add_control( dialog, rec, L"Static", - SS_OWNERDRAW | WS_GROUP | WS_VISIBLE ); + control = dialog_add_control( dialog, rec, L"Static", SS_OWNERDRAW | WS_GROUP | WS_VISIBLE ); if( !control ) { ERR("Failed to create maskedit container\n"); @@ -2040,14 +2026,14 @@ static UINT msi_dialog_maskedit_control( msi_dialog *dialog, MSIRECORD *rec ) if( prop ) info->prop = wcsdup( prop );
- msi_maskedit_create_children( info, font ); + maskedit_create_children( info, font );
if( prop ) { val = msi_dup_property( dialog->package->db, prop ); if( val ) { - msi_maskedit_set_text( info, val ); + maskedit_set_text( info, val ); free( val ); } } @@ -2062,7 +2048,7 @@ end:
/******************** Progress Bar *****************************************/
-static UINT msi_dialog_progress_bar( msi_dialog *dialog, MSIRECORD *rec ) +static UINT dialog_progress_bar( msi_dialog *dialog, MSIRECORD *rec ) { msi_control *control; DWORD attributes, style; @@ -2072,7 +2058,7 @@ static UINT msi_dialog_progress_bar( msi_dialog *dialog, MSIRECORD *rec ) if( !(attributes & msidbControlAttributesProgress95) ) style |= PBS_SMOOTH;
- control = msi_dialog_add_control( dialog, rec, PROGRESS_CLASSW, style ); + control = dialog_add_control( dialog, rec, PROGRESS_CLASSW, style ); if( !control ) return ERROR_FUNCTION_FAILED;
@@ -2093,17 +2079,17 @@ static WCHAR *get_path_property( msi_dialog *dialog, msi_control *control ) { WCHAR *prop, *path; BOOL indirect = control->attributes & msidbControlAttributesIndirect; - if (!(prop = msi_dialog_dup_property( dialog, control->property, indirect ))) return NULL; - path = msi_dialog_dup_property( dialog, prop, TRUE ); + if (!(prop = dialog_dup_property( dialog, control->property, indirect ))) return NULL; + path = dialog_dup_property( dialog, prop, TRUE ); free( prop ); return path; }
-static void msi_dialog_update_pathedit( msi_dialog *dialog, msi_control *control ) +static void dialog_update_pathedit( msi_dialog *dialog, msi_control *control ) { WCHAR *path;
- if (!control && !(control = msi_dialog_find_control_by_type( dialog, L"PathEdit" ))) + if (!control && !(control = dialog_find_control_by_type( dialog, L"PathEdit" ))) return;
if (!(path = get_path_property( dialog, control ))) return; @@ -2113,7 +2099,7 @@ static void msi_dialog_update_pathedit( msi_dialog *dialog, msi_control *control }
/* FIXME: test when this should fail */ -static BOOL msi_dialog_verify_path( LPWSTR path ) +static BOOL dialog_verify_path( const WCHAR *path ) { if ( !path[0] ) return FALSE; @@ -2125,18 +2111,18 @@ static BOOL msi_dialog_verify_path( LPWSTR path ) }
/* returns TRUE if the path is valid, FALSE otherwise */ -static BOOL msi_dialog_onkillfocus( msi_dialog *dialog, msi_control *control ) +static BOOL dialog_onkillfocus( msi_dialog *dialog, msi_control *control ) { LPWSTR buf, prop; BOOL indirect; BOOL valid;
indirect = control->attributes & msidbControlAttributesIndirect; - prop = msi_dialog_dup_property( dialog, control->property, indirect ); + prop = dialog_dup_property( dialog, control->property, indirect );
- buf = msi_get_window_text( control->hwnd ); + buf = get_window_text( control->hwnd );
- if ( !msi_dialog_verify_path( buf ) ) + if ( !dialog_verify_path( buf ) ) { /* FIXME: display an error message box */ ERR("Invalid path %s\n", debugstr_w( buf )); @@ -2146,10 +2132,10 @@ static BOOL msi_dialog_onkillfocus( msi_dialog *dialog, msi_control *control ) else { valid = TRUE; - msi_dialog_set_property( dialog->package, prop, buf ); + dialog_set_property( dialog->package, prop, buf ); }
- msi_dialog_update_pathedit( dialog, control ); + dialog_update_pathedit( dialog, control );
TRACE("edit %s contents changed, set %s\n", debugstr_w(control->name), debugstr_w(prop)); @@ -2170,7 +2156,7 @@ static LRESULT WINAPI MSIPathEdit_WndProc(HWND hWnd, UINT msg, WPARAM wParam, LP if ( msg == WM_KILLFOCUS ) { /* if the path is invalid, don't handle this message */ - if ( !msi_dialog_onkillfocus( info->dialog, info->control ) ) + if ( !dialog_onkillfocus( info->dialog, info->control ) ) return 0; }
@@ -2185,7 +2171,7 @@ static LRESULT WINAPI MSIPathEdit_WndProc(HWND hWnd, UINT msg, WPARAM wParam, LP return r; }
-static UINT msi_dialog_pathedit_control( msi_dialog *dialog, MSIRECORD *rec ) +static UINT dialog_pathedit_control( msi_dialog *dialog, MSIRECORD *rec ) { struct msi_pathedit_info *info; msi_control *control; @@ -2195,12 +2181,11 @@ static UINT msi_dialog_pathedit_control( msi_dialog *dialog, MSIRECORD *rec ) if (!info) return ERROR_FUNCTION_FAILED;
- control = msi_dialog_add_control( dialog, rec, L"Edit", - WS_BORDER | WS_TABSTOP ); + control = dialog_add_control( dialog, rec, L"Edit", WS_BORDER | WS_TABSTOP ); control->attributes = MSI_RecordGetInteger( rec, 8 ); prop = MSI_RecordGetString( rec, 9 ); - control->property = msi_dialog_dup_property( dialog, prop, FALSE ); - control->update = msi_dialog_update_pathedit; + control->property = dialog_dup_property( dialog, prop, FALSE ); + control->update = dialog_update_pathedit;
info->dialog = dialog; info->control = control; @@ -2208,25 +2193,25 @@ static UINT msi_dialog_pathedit_control( msi_dialog *dialog, MSIRECORD *rec ) (LONG_PTR)MSIPathEdit_WndProc ); SetPropW( control->hwnd, L"MSIDATA", info );
- msi_dialog_update_pathedit( dialog, control ); + dialog_update_pathedit( dialog, control );
return ERROR_SUCCESS; }
-static UINT msi_dialog_radiogroup_handler( msi_dialog *dialog, msi_control *control, WPARAM param ) +static UINT dialog_radiogroup_handler( msi_dialog *dialog, msi_control *control, WPARAM param ) { if (HIWORD(param) != BN_CLICKED) return ERROR_SUCCESS;
TRACE("clicked radio button %s, set %s\n", debugstr_w(control->name), debugstr_w(control->property));
- msi_dialog_set_property( dialog->package, control->property, control->name ); + dialog_set_property( dialog->package, control->property, control->name );
- return msi_dialog_button_handler( dialog, control, param ); + return dialog_button_handler( dialog, control, param ); }
/* radio buttons are a bit different from normal controls */ -static UINT msi_dialog_create_radiobutton( MSIRECORD *rec, LPVOID param ) +static UINT dialog_create_radiobutton( MSIRECORD *rec, void *param ) { radio_button_group_descr *group = param; msi_dialog *dialog = group->dialog; @@ -2241,7 +2226,7 @@ static UINT msi_dialog_create_radiobutton( MSIRECORD *rec, LPVOID param ) group->parent->hwnd ); if (!control) return ERROR_FUNCTION_FAILED; - control->handler = msi_dialog_radiogroup_handler; + control->handler = dialog_radiogroup_handler;
if (group->propval && !wcscmp( control->name, group->propval )) SendMessageW(control->hwnd, BM_SETCHECK, BST_CHECKED, 0); @@ -2253,7 +2238,7 @@ static UINT msi_dialog_create_radiobutton( MSIRECORD *rec, LPVOID param ) return ERROR_SUCCESS; }
-static BOOL CALLBACK msi_radioground_child_enum( HWND hWnd, LPARAM lParam ) +static BOOL CALLBACK radioground_child_enum( HWND hWnd, LPARAM lParam ) { EnableWindow( hWnd, lParam ); return TRUE; @@ -2273,12 +2258,12 @@ static LRESULT WINAPI MSIRadioGroup_WndProc( HWND hWnd, UINT msg, WPARAM wParam,
/* make sure the radio buttons show as disabled if the parent is disabled */ if (msg == WM_ENABLE) - EnumChildWindows( hWnd, msi_radioground_child_enum, wParam ); + EnumChildWindows( hWnd, radioground_child_enum, wParam );
return r; }
-static UINT msi_dialog_radiogroup_control( msi_dialog *dialog, MSIRECORD *rec ) +static UINT dialog_radiogroup_control( msi_dialog *dialog, MSIRECORD *rec ) { UINT r; LPCWSTR prop; @@ -2304,7 +2289,7 @@ static UINT msi_dialog_radiogroup_control( msi_dialog *dialog, MSIRECORD *rec ) style |= BS_OWNERDRAW;
/* Create parent group box to hold radio buttons */ - control = msi_dialog_add_control( dialog, rec, L"BUTTON", style ); + control = dialog_add_control( dialog, rec, L"BUTTON", style ); if( !control ) return ERROR_FUNCTION_FAILED;
@@ -2329,14 +2314,13 @@ static UINT msi_dialog_radiogroup_control( msi_dialog *dialog, MSIRECORD *rec ) group.parent = control; group.propval = msi_dup_property( dialog->package->db, control->property );
- r = MSI_IterateRecords( view, 0, msi_dialog_create_radiobutton, &group ); + r = MSI_IterateRecords( view, 0, dialog_create_radiobutton, &group ); msiobj_release( &view->hdr ); free( group.propval ); return r; }
-static void -msi_seltree_sync_item_state( HWND hwnd, MSIFEATURE *feature, HTREEITEM hItem ) +static void seltree_sync_item_state( HWND hwnd, MSIFEATURE *feature, HTREEITEM hItem ) { TVITEMW tvi; DWORD index = feature->ActionRequest; @@ -2355,8 +2339,7 @@ msi_seltree_sync_item_state( HWND hwnd, MSIFEATURE *feature, HTREEITEM hItem ) SendMessageW( hwnd, TVM_SETITEMW, 0, (LPARAM) &tvi ); }
-static UINT -msi_seltree_popup_menu( HWND hwnd, INT x, INT y ) +static UINT seltree_popup_menu( HWND hwnd, INT x, INT y ) { HMENU hMenu; INT r; @@ -2375,18 +2358,16 @@ msi_seltree_popup_menu( HWND hwnd, INT x, INT y ) return r; }
-static void -msi_seltree_update_feature_installstate( HWND hwnd, HTREEITEM hItem, - MSIPACKAGE *package, MSIFEATURE *feature, INSTALLSTATE state ) +static void seltree_update_feature_installstate( HWND hwnd, HTREEITEM hItem, MSIPACKAGE *package, + MSIFEATURE *feature, INSTALLSTATE state ) { feature->ActionRequest = state; - msi_seltree_sync_item_state( hwnd, feature, hItem ); + seltree_sync_item_state( hwnd, feature, hItem ); ACTION_UpdateComponentStates( package, feature ); }
-static void -msi_seltree_update_siblings_and_children_installstate( HWND hwnd, HTREEITEM curr, - MSIPACKAGE *package, INSTALLSTATE state) +static void seltree_update_siblings_and_children_installstate( HWND hwnd, HTREEITEM curr, MSIPACKAGE *package, + INSTALLSTATE state ) { /* update all siblings */ do @@ -2394,20 +2375,18 @@ msi_seltree_update_siblings_and_children_installstate( HWND hwnd, HTREEITEM curr MSIFEATURE *feature; HTREEITEM child;
- feature = msi_seltree_feature_from_item( hwnd, curr ); - msi_seltree_update_feature_installstate( hwnd, curr, package, feature, state ); + feature = seltree_feature_from_item( hwnd, curr ); + seltree_update_feature_installstate( hwnd, curr, package, feature, state );
/* update this sibling's children */ child = (HTREEITEM)SendMessageW( hwnd, TVM_GETNEXTITEM, (WPARAM)TVGN_CHILD, (LPARAM)curr ); if (child) - msi_seltree_update_siblings_and_children_installstate( hwnd, child, - package, state ); + seltree_update_siblings_and_children_installstate( hwnd, child, package, state ); } while ((curr = (HTREEITEM)SendMessageW( hwnd, TVM_GETNEXTITEM, (WPARAM)TVGN_NEXT, (LPARAM)curr ))); }
-static LRESULT -msi_seltree_menu( HWND hwnd, HTREEITEM hItem ) +static LRESULT seltree_menu( HWND hwnd, HTREEITEM hItem ) { struct msi_selection_tree_info *info; MSIFEATURE *feature; @@ -2422,7 +2401,7 @@ msi_seltree_menu( HWND hwnd, HTREEITEM hItem ) info = GetPropW(hwnd, L"MSIDATA"); package = info->dialog->package;
- feature = msi_seltree_feature_from_item( hwnd, hItem ); + feature = seltree_feature_from_item( hwnd, hItem ); if (!feature) { ERR("item %p feature was NULL\n", hItem); @@ -2434,7 +2413,7 @@ msi_seltree_menu( HWND hwnd, HTREEITEM hItem ) SendMessageW( hwnd, TVM_GETITEMRECT, 0, (LPARAM) &u.rc ); MapWindowPoints( hwnd, NULL, u.pt, 2 );
- r = msi_seltree_popup_menu( hwnd, u.rc.left, u.rc.top ); + r = seltree_popup_menu( hwnd, u.rc.left, u.rc.top );
switch (r) { @@ -2447,19 +2426,18 @@ msi_seltree_menu( HWND hwnd, HTREEITEM hItem ) HTREEITEM child; child = (HTREEITEM)SendMessageW( hwnd, TVM_GETNEXTITEM, (WPARAM)TVGN_CHILD, (LPARAM)hItem ); if (child) - msi_seltree_update_siblings_and_children_installstate( hwnd, child, package, r ); + seltree_update_siblings_and_children_installstate( hwnd, child, package, r ); } /* fall-through */ case INSTALLSTATE_LOCAL: - msi_seltree_update_feature_installstate( hwnd, hItem, package, feature, r ); + seltree_update_feature_installstate( hwnd, hItem, package, feature, r ); break; }
return 0; }
-static LRESULT WINAPI -MSISelectionTree_WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) +static LRESULT WINAPI MSISelectionTree_WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) { struct msi_selection_tree_info *info; TVHITTESTINFO tvhti; @@ -2478,7 +2456,7 @@ MSISelectionTree_WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) tvhti.hItem = 0; CallWindowProcW(info->oldproc, hWnd, TVM_HITTEST, 0, (LPARAM) &tvhti ); if (tvhti.flags & TVHT_ONITEMSTATEICON) - return msi_seltree_menu( hWnd, tvhti.hItem ); + return seltree_menu( hWnd, tvhti.hItem ); break; } r = CallWindowProcW(info->oldproc, hWnd, msg, wParam, lParam); @@ -2493,9 +2471,7 @@ MSISelectionTree_WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) return r; }
-static void -msi_seltree_add_child_features( MSIPACKAGE *package, HWND hwnd, - LPCWSTR parent, HTREEITEM hParent ) +static void seltree_add_child_features( MSIPACKAGE *package, HWND hwnd, const WCHAR *parent, HTREEITEM hParent ) { struct msi_selection_tree_info *info = GetPropW( hwnd, L"MSIDATA" ); MSIFEATURE *feature; @@ -2531,8 +2507,8 @@ msi_seltree_add_child_features( MSIPACKAGE *package, HWND hwnd, if (!hfirst) hfirst = hitem;
- msi_seltree_sync_item_state( hwnd, feature, hitem ); - msi_seltree_add_child_features( package, hwnd, + seltree_sync_item_state( hwnd, feature, hitem ); + seltree_add_child_features( package, hwnd, feature->Feature, hitem );
/* the node is expanded if Display is odd */ @@ -2545,7 +2521,7 @@ msi_seltree_add_child_features( MSIPACKAGE *package, HWND hwnd, info->selected = hfirst; }
-static void msi_seltree_create_imagelist( HWND hwnd ) +static void seltree_create_imagelist( HWND hwnd ) { const int bm_width = 32, bm_height = 16, bm_count = 3; const int bm_resource = 0x1001; @@ -2582,8 +2558,7 @@ static void msi_seltree_create_imagelist( HWND hwnd ) SendMessageW( hwnd, TVM_SETIMAGELIST, TVSIL_STATE, (LPARAM)himl ); }
-static UINT msi_dialog_seltree_handler( msi_dialog *dialog, - msi_control *control, WPARAM param ) +static UINT dialog_seltree_handler( msi_dialog *dialog, msi_control *control, WPARAM param ) { struct msi_selection_tree_info *info = GetPropW( control->hwnd, L"MSIDATA" ); LPNMTREEVIEWW tv = (LPNMTREEVIEWW)param; @@ -2600,7 +2575,7 @@ static UINT msi_dialog_seltree_handler( msi_dialog *dialog,
if (!(tv->itemNew.mask & TVIF_TEXT)) { - feature = msi_seltree_feature_from_item( control->hwnd, tv->itemNew.hItem ); + feature = seltree_feature_from_item( control->hwnd, tv->itemNew.hItem ); if (feature) title = feature->Title; } @@ -2639,7 +2614,7 @@ done: return r; }
-static UINT msi_dialog_selection_tree( msi_dialog *dialog, MSIRECORD *rec ) +static UINT dialog_selection_tree( msi_dialog *dialog, MSIRECORD *rec ) { msi_control *control; LPCWSTR prop, control_name; @@ -2654,18 +2629,18 @@ static UINT msi_dialog_selection_tree( msi_dialog *dialog, MSIRECORD *rec ) /* create the treeview control */ style = TVS_HASLINES | TVS_HASBUTTONS | TVS_LINESATROOT; style |= WS_GROUP | WS_VSCROLL | WS_TABSTOP; - control = msi_dialog_add_control( dialog, rec, WC_TREEVIEWW, style ); + control = dialog_add_control( dialog, rec, WC_TREEVIEWW, style ); if (!control) { free(info); return ERROR_FUNCTION_FAILED; }
- control->handler = msi_dialog_seltree_handler; + control->handler = dialog_seltree_handler; control_name = MSI_RecordGetString( rec, 2 ); control->attributes = MSI_RecordGetInteger( rec, 8 ); prop = MSI_RecordGetString( rec, 9 ); - control->property = msi_dialog_dup_property( dialog, prop, FALSE ); + control->property = dialog_dup_property( dialog, prop, FALSE );
/* subclass */ info->dialog = dialog; @@ -2677,21 +2652,21 @@ static UINT msi_dialog_selection_tree( msi_dialog *dialog, MSIRECORD *rec ) event_subscribe( dialog, L"SelectionPath", control_name, L"Property" );
/* initialize it */ - msi_seltree_create_imagelist( control->hwnd ); - msi_seltree_add_child_features( package, control->hwnd, NULL, NULL ); + seltree_create_imagelist( control->hwnd ); + seltree_add_child_features( package, control->hwnd, NULL, NULL );
return ERROR_SUCCESS; }
/******************** Group Box ***************************************/
-static UINT msi_dialog_group_box( msi_dialog *dialog, MSIRECORD *rec ) +static UINT dialog_group_box( msi_dialog *dialog, MSIRECORD *rec ) { msi_control *control; DWORD style;
style = BS_GROUPBOX | WS_CHILD | WS_GROUP; - control = msi_dialog_add_control( dialog, rec, WC_BUTTONW, style ); + control = dialog_add_control( dialog, rec, WC_BUTTONW, style ); if (!control) return ERROR_FUNCTION_FAILED;
@@ -2738,7 +2713,7 @@ static LRESULT WINAPI MSIListBox_WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPA return r; }
-static UINT msi_listbox_add_item( MSIRECORD *rec, LPVOID param ) +static UINT listbox_add_item( MSIRECORD *rec, void *param ) { struct msi_listbox_info *info = param; LPCWSTR value, text; @@ -2755,7 +2730,7 @@ static UINT msi_listbox_add_item( MSIRECORD *rec, LPVOID param ) return ERROR_SUCCESS; }
-static UINT msi_listbox_add_items( struct msi_listbox_info *info, LPCWSTR property ) +static UINT listbox_add_items( struct msi_listbox_info *info, const WCHAR *property ) { MSIQUERY *view; DWORD count; @@ -2777,13 +2752,12 @@ static UINT msi_listbox_add_items( struct msi_listbox_info *info, LPCWSTR proper info->num_items = count; info->items = malloc( sizeof(*info->items) * count );
- r = MSI_IterateRecords( view, NULL, msi_listbox_add_item, info ); + r = MSI_IterateRecords( view, NULL, listbox_add_item, info ); msiobj_release( &view->hdr ); return r; }
-static UINT msi_dialog_listbox_handler( msi_dialog *dialog, - msi_control *control, WPARAM param ) +static UINT dialog_listbox_handler( msi_dialog *dialog, msi_control *control, WPARAM param ) { struct msi_listbox_info *info; int index; @@ -2796,13 +2770,13 @@ static UINT msi_dialog_listbox_handler( msi_dialog *dialog, index = SendMessageW( control->hwnd, LB_GETCURSEL, 0, 0 ); value = (LPCWSTR) SendMessageW( control->hwnd, LB_GETITEMDATA, index, 0 );
- msi_dialog_set_property( info->dialog->package, control->property, value ); - msi_dialog_evaluate_control_conditions( info->dialog ); + dialog_set_property( info->dialog->package, control->property, value ); + dialog_evaluate_control_conditions( info->dialog );
return ERROR_SUCCESS; }
-static UINT msi_dialog_list_box( msi_dialog *dialog, MSIRECORD *rec ) +static UINT dialog_list_box( msi_dialog *dialog, MSIRECORD *rec ) { struct msi_listbox_info *info; msi_control *control; @@ -2818,17 +2792,17 @@ static UINT msi_dialog_list_box( msi_dialog *dialog, MSIRECORD *rec ) if (~attributes & msidbControlAttributesSorted) style |= LBS_SORT;
- control = msi_dialog_add_control( dialog, rec, WC_LISTBOXW, style ); + control = dialog_add_control( dialog, rec, WC_LISTBOXW, style ); if (!control) { free(info); return ERROR_FUNCTION_FAILED; }
- control->handler = msi_dialog_listbox_handler; + control->handler = dialog_listbox_handler;
prop = MSI_RecordGetString( rec, 9 ); - control->property = msi_dialog_dup_property( dialog, prop, FALSE ); + control->property = dialog_dup_property( dialog, prop, FALSE );
/* subclass */ info->dialog = dialog; @@ -2840,18 +2814,18 @@ static UINT msi_dialog_list_box( msi_dialog *dialog, MSIRECORD *rec ) SetPropW( control->hwnd, L"MSIDATA", info );
if ( control->property ) - msi_listbox_add_items( info, control->property ); + listbox_add_items( info, control->property );
return ERROR_SUCCESS; }
/******************** Directory Combo ***************************************/
-static void msi_dialog_update_directory_combo( msi_dialog *dialog, msi_control *control ) +static void dialog_update_directory_combo( msi_dialog *dialog, msi_control *control ) { WCHAR *path;
- if (!control && !(control = msi_dialog_find_control_by_type( dialog, L"DirectoryCombo" ))) + if (!control && !(control = dialog_find_control_by_type( dialog, L"DirectoryCombo" ))) return;
if (!(path = get_path_property( dialog, control ))) return; @@ -2864,7 +2838,7 @@ static void msi_dialog_update_directory_combo( msi_dialog *dialog, msi_control * free( path ); }
-static UINT msi_dialog_directory_combo( msi_dialog *dialog, MSIRECORD *rec ) +static UINT dialog_directory_combo( msi_dialog *dialog, MSIRECORD *rec ) { msi_control *control; LPCWSTR prop; @@ -2873,29 +2847,29 @@ static UINT msi_dialog_directory_combo( msi_dialog *dialog, MSIRECORD *rec ) /* FIXME: use CBS_OWNERDRAWFIXED and add owner draw code */ style = CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_CHILD | WS_GROUP | WS_TABSTOP | WS_VSCROLL; - control = msi_dialog_add_control( dialog, rec, WC_COMBOBOXW, style ); + control = dialog_add_control( dialog, rec, WC_COMBOBOXW, style ); if (!control) return ERROR_FUNCTION_FAILED;
control->attributes = MSI_RecordGetInteger( rec, 8 ); prop = MSI_RecordGetString( rec, 9 ); - control->property = msi_dialog_dup_property( dialog, prop, FALSE ); + control->property = dialog_dup_property( dialog, prop, FALSE );
- msi_dialog_update_directory_combo( dialog, control ); + dialog_update_directory_combo( dialog, control );
return ERROR_SUCCESS; }
/******************** Directory List ***************************************/
-static void msi_dialog_update_directory_list( msi_dialog *dialog, msi_control *control ) +static void dialog_update_directory_list( msi_dialog *dialog, msi_control *control ) { WCHAR dir_spec[MAX_PATH], *path; WIN32_FIND_DATAW wfd; LVITEMW item; HANDLE file;
- if (!control && !(control = msi_dialog_find_control_by_type( dialog, L"DirectoryList" ))) + if (!control && !(control = dialog_find_control_by_type( dialog, L"DirectoryList" ))) return;
/* clear the list-view */ @@ -2933,27 +2907,27 @@ static void msi_dialog_update_directory_list( msi_dialog *dialog, msi_control *c FindClose( file ); }
-static UINT msi_dialog_directorylist_up( msi_dialog *dialog ) +static UINT dialog_directorylist_up( msi_dialog *dialog ) { msi_control *control; LPWSTR prop, path, ptr; BOOL indirect;
- control = msi_dialog_find_control_by_type( dialog, L"DirectoryList" ); + control = dialog_find_control_by_type( dialog, L"DirectoryList" ); indirect = control->attributes & msidbControlAttributesIndirect; - prop = msi_dialog_dup_property( dialog, control->property, indirect ); - path = msi_dialog_dup_property( dialog, prop, TRUE ); + prop = dialog_dup_property( dialog, control->property, indirect ); + path = dialog_dup_property( dialog, prop, TRUE );
/* strip off the last directory */ ptr = PathFindFileNameW( path ); if (ptr != path) *(ptr - 1) = '\0'; PathAddBackslashW( path );
- msi_dialog_set_property( dialog->package, prop, path ); + dialog_set_property( dialog->package, prop, path );
- msi_dialog_update_directory_list( dialog, NULL ); - msi_dialog_update_directory_combo( dialog, NULL ); - msi_dialog_update_pathedit( dialog, NULL ); + dialog_update_directory_list( dialog, NULL ); + dialog_update_directory_combo( dialog, NULL ); + dialog_update_pathedit( dialog, NULL );
free( path ); free( prop ); @@ -2989,14 +2963,14 @@ static WCHAR *get_unique_folder_name( const WCHAR *root, int *ret_len ) return path; }
-static UINT msi_dialog_directorylist_new( msi_dialog *dialog ) +static UINT dialog_directorylist_new( msi_dialog *dialog ) { msi_control *control; WCHAR *path; LVITEMW item; int index;
- control = msi_dialog_find_control_by_type( dialog, L"DirectoryList" ); + control = dialog_find_control_by_type( dialog, L"DirectoryList" );
if (!(path = get_path_property( dialog, control ))) return ERROR_OUTOFMEMORY;
@@ -3014,7 +2988,7 @@ static UINT msi_dialog_directorylist_new( msi_dialog *dialog ) return ERROR_SUCCESS; }
-static UINT msi_dialog_dirlist_handler( msi_dialog *dialog, msi_control *control, WPARAM param ) +static UINT dialog_dirlist_handler( msi_dialog *dialog, msi_control *control, WPARAM param ) { NMHDR *nmhdr = (NMHDR *)param; WCHAR text[MAX_PATH], *new_path, *path, *prop; @@ -3052,8 +3026,8 @@ static UINT msi_dialog_dirlist_handler( msi_dialog *dialog, msi_control *control }
indirect = control->attributes & msidbControlAttributesIndirect; - prop = msi_dialog_dup_property( dialog, control->property, indirect ); - path = msi_dialog_dup_property( dialog, prop, TRUE ); + prop = dialog_dup_property( dialog, control->property, indirect ); + path = dialog_dup_property( dialog, prop, TRUE );
if (!(new_path = malloc( (wcslen(path) + wcslen(text) + 2) * sizeof(WCHAR) ))) { @@ -3066,11 +3040,11 @@ static UINT msi_dialog_dirlist_handler( msi_dialog *dialog, msi_control *control if (nmhdr->code == LVN_ENDLABELEDITW) CreateDirectoryW( new_path, NULL ); lstrcatW( new_path, L"\" );
- msi_dialog_set_property( dialog->package, prop, new_path ); + dialog_set_property( dialog->package, prop, new_path );
- msi_dialog_update_directory_list( dialog, NULL ); - msi_dialog_update_directory_combo( dialog, NULL ); - msi_dialog_update_pathedit( dialog, NULL ); + dialog_update_directory_list( dialog, NULL ); + dialog_update_directory_combo( dialog, NULL ); + dialog_update_pathedit( dialog, NULL );
free( prop ); free( path ); @@ -3079,7 +3053,7 @@ static UINT msi_dialog_dirlist_handler( msi_dialog *dialog, msi_control *control return ERROR_SUCCESS; }
-static UINT msi_dialog_directory_list( msi_dialog *dialog, MSIRECORD *rec ) +static UINT dialog_directory_list( msi_dialog *dialog, MSIRECORD *rec ) { msi_control *control; LPCWSTR prop; @@ -3088,20 +3062,20 @@ static UINT msi_dialog_directory_list( msi_dialog *dialog, MSIRECORD *rec ) style = LVS_LIST | WS_VSCROLL | LVS_SHAREIMAGELISTS | LVS_EDITLABELS | LVS_AUTOARRANGE | LVS_SINGLESEL | WS_BORDER | LVS_SORTASCENDING | WS_CHILD | WS_GROUP | WS_TABSTOP; - control = msi_dialog_add_control( dialog, rec, WC_LISTVIEWW, style ); + control = dialog_add_control( dialog, rec, WC_LISTVIEWW, style ); if (!control) return ERROR_FUNCTION_FAILED;
control->attributes = MSI_RecordGetInteger( rec, 8 ); - control->handler = msi_dialog_dirlist_handler; + control->handler = dialog_dirlist_handler; prop = MSI_RecordGetString( rec, 9 ); - control->property = msi_dialog_dup_property( dialog, prop, FALSE ); + control->property = dialog_dup_property( dialog, prop, FALSE );
/* double click to activate an item in the list */ SendMessageW( control->hwnd, LVM_SETEXTENDEDLISTVIEWSTYLE, 0, LVS_EX_TWOCLICKACTIVATE );
- msi_dialog_update_directory_list( dialog, control ); + dialog_update_directory_list( dialog, control );
return ERROR_SUCCESS; } @@ -3128,7 +3102,7 @@ static const WCHAR column_keys[][80] = L"VolumeCostDifference", };
-static void msi_dialog_vcl_add_columns( msi_dialog *dialog, msi_control *control, MSIRECORD *rec ) +static void dialog_vcl_add_columns( msi_dialog *dialog, msi_control *control, MSIRECORD *rec ) { LPCWSTR text = MSI_RecordGetString( rec, 10 ); LPCWSTR begin = text, end; @@ -3169,7 +3143,7 @@ static void msi_dialog_vcl_add_columns( msi_dialog *dialog, msi_control *control ZeroMemory( &lvc, sizeof(lvc) ); lvc.mask = LVCF_TEXT | LVCF_WIDTH | LVCF_SUBITEM; lvc.cx = wcstol( num, NULL, 10 ); - lvc.pszText = msi_dialog_get_uitext( dialog, column_keys[count] ); + lvc.pszText = dialog_get_uitext( dialog, column_keys[count] );
SendMessageW( control->hwnd, LVM_INSERTCOLUMNW, count++, (LPARAM)&lvc ); free( lvc.pszText ); @@ -3177,7 +3151,7 @@ static void msi_dialog_vcl_add_columns( msi_dialog *dialog, msi_control *control } }
-static LONGLONG msi_vcl_get_cost( msi_dialog *dialog ) +static LONGLONG vcl_get_cost( msi_dialog *dialog ) { MSIFEATURE *feature; INT each_cost; @@ -3201,7 +3175,7 @@ static LONGLONG msi_vcl_get_cost( msi_dialog *dialog ) return total_cost; }
-static void msi_dialog_vcl_add_drives( msi_dialog *dialog, msi_control *control ) +static void dialog_vcl_add_drives( msi_dialog *dialog, msi_control *control ) { ULARGE_INTEGER total, unused; LONGLONG difference, cost; @@ -3212,7 +3186,7 @@ static void msi_dialog_vcl_add_drives( msi_dialog *dialog, msi_control *control DWORD size, flags; int i = 0;
- cost = msi_vcl_get_cost(dialog); + cost = vcl_get_cost(dialog); StrFormatByteSizeW(cost, cost_text, MAX_PATH);
size = GetLogicalDriveStringsW( 0, NULL ); @@ -3273,7 +3247,7 @@ static void msi_dialog_vcl_add_drives( msi_dialog *dialog, msi_control *control free( drives ); }
-static UINT msi_dialog_volumecost_list( msi_dialog *dialog, MSIRECORD *rec ) +static UINT dialog_volumecost_list( msi_dialog *dialog, MSIRECORD *rec ) { msi_control *control; DWORD style; @@ -3281,20 +3255,19 @@ static UINT msi_dialog_volumecost_list( msi_dialog *dialog, MSIRECORD *rec ) style = LVS_REPORT | WS_VSCROLL | WS_HSCROLL | LVS_SHAREIMAGELISTS | LVS_AUTOARRANGE | LVS_SINGLESEL | WS_BORDER | WS_CHILD | WS_TABSTOP | WS_GROUP; - control = msi_dialog_add_control( dialog, rec, WC_LISTVIEWW, style ); + control = dialog_add_control( dialog, rec, WC_LISTVIEWW, style ); if (!control) return ERROR_FUNCTION_FAILED;
- msi_dialog_vcl_add_columns( dialog, control, rec ); - msi_dialog_vcl_add_drives( dialog, control ); + dialog_vcl_add_columns( dialog, control, rec ); + dialog_vcl_add_drives( dialog, control );
return ERROR_SUCCESS; }
/******************** VolumeSelect Combo ***************************************/
-static UINT msi_dialog_volsel_handler( msi_dialog *dialog, - msi_control *control, WPARAM param ) +static UINT dialog_volsel_handler( msi_dialog *dialog, msi_control *control, WPARAM param ) { WCHAR text[MAX_PATH]; LPWSTR prop; @@ -3314,15 +3287,15 @@ static UINT msi_dialog_volsel_handler( msi_dialog *dialog, SendMessageW( control->hwnd, CB_GETLBTEXT, index, (LPARAM)text );
indirect = control->attributes & msidbControlAttributesIndirect; - prop = msi_dialog_dup_property( dialog, control->property, indirect ); + prop = dialog_dup_property( dialog, control->property, indirect );
- msi_dialog_set_property( dialog->package, prop, text ); + dialog_set_property( dialog->package, prop, text );
free( prop ); return ERROR_SUCCESS; }
-static void msi_dialog_vsc_add_drives( msi_dialog *dialog, msi_control *control ) +static void dialog_vsc_add_drives( msi_dialog *dialog, msi_control *control ) { LPWSTR drives, ptr; DWORD size; @@ -3345,7 +3318,7 @@ static void msi_dialog_vsc_add_drives( msi_dialog *dialog, msi_control *control free( drives ); }
-static UINT msi_dialog_volumeselect_combo( msi_dialog *dialog, MSIRECORD *rec ) +static UINT dialog_volumeselect_combo( msi_dialog *dialog, MSIRECORD *rec ) { msi_control *control; LPCWSTR prop; @@ -3355,21 +3328,21 @@ static UINT msi_dialog_volumeselect_combo( msi_dialog *dialog, MSIRECORD *rec ) style = WS_CHILD | WS_VISIBLE | WS_GROUP | WS_TABSTOP | CBS_DROPDOWNLIST | CBS_SORT | CBS_HASSTRINGS | WS_EX_LEFT | WS_EX_LTRREADING | WS_EX_RIGHTSCROLLBAR; - control = msi_dialog_add_control( dialog, rec, WC_COMBOBOXW, style ); + control = dialog_add_control( dialog, rec, WC_COMBOBOXW, style ); if (!control) return ERROR_FUNCTION_FAILED;
control->attributes = MSI_RecordGetInteger( rec, 8 ); - control->handler = msi_dialog_volsel_handler; + control->handler = dialog_volsel_handler; prop = MSI_RecordGetString( rec, 9 ); - control->property = msi_dialog_dup_property( dialog, prop, FALSE ); + control->property = dialog_dup_property( dialog, prop, FALSE );
- msi_dialog_vsc_add_drives( dialog, control ); + dialog_vsc_add_drives( dialog, control );
return ERROR_SUCCESS; }
-static UINT msi_dialog_hyperlink_handler( msi_dialog *dialog, msi_control *control, WPARAM param ) +static UINT dialog_hyperlink_handler( msi_dialog *dialog, msi_control *control, WPARAM param ) { int len, len_href = ARRAY_SIZE( L"href" ) - 1; const WCHAR *p, *q; @@ -3414,7 +3387,7 @@ static UINT msi_dialog_hyperlink_handler( msi_dialog *dialog, msi_control *contr return ERROR_SUCCESS; }
-static UINT msi_dialog_hyperlink( msi_dialog *dialog, MSIRECORD *rec ) +static UINT dialog_hyperlink( msi_dialog *dialog, MSIRECORD *rec ) { msi_control *control; DWORD style = WS_CHILD | WS_TABSTOP | WS_GROUP; @@ -3422,12 +3395,12 @@ static UINT msi_dialog_hyperlink( msi_dialog *dialog, MSIRECORD *rec ) int len = lstrlenW( text ); LITEM item;
- control = msi_dialog_add_control( dialog, rec, WC_LINK, style ); + control = dialog_add_control( dialog, rec, WC_LINK, style ); if (!control) return ERROR_FUNCTION_FAILED;
control->attributes = MSI_RecordGetInteger( rec, 8 ); - control->handler = msi_dialog_hyperlink_handler; + control->handler = dialog_hyperlink_handler;
item.mask = LIF_ITEMINDEX | LIF_STATE | LIF_URL; item.iLink = 0; @@ -3449,7 +3422,7 @@ struct listview_param msi_control *control; };
-static UINT msi_dialog_listview_handler( msi_dialog *dialog, msi_control *control, WPARAM param ) +static UINT dialog_listview_handler( msi_dialog *dialog, msi_control *control, WPARAM param ) { NMHDR *nmhdr = (NMHDR *)param;
@@ -3458,7 +3431,7 @@ static UINT msi_dialog_listview_handler( msi_dialog *dialog, msi_control *contro return ERROR_SUCCESS; }
-static UINT msi_listview_add_item( MSIRECORD *rec, LPVOID param ) +static UINT listview_add_item( MSIRECORD *rec, void *param ) { struct listview_param *lv_param = (struct listview_param *)param; LPCWSTR text, binary; @@ -3467,7 +3440,7 @@ static UINT msi_listview_add_item( MSIRECORD *rec, LPVOID param )
text = MSI_RecordGetString( rec, 4 ); binary = MSI_RecordGetString( rec, 5 ); - hIcon = msi_load_icon( lv_param->dialog->package->db, binary, 0 ); + hIcon = load_icon( lv_param->dialog->package->db, binary, 0 );
TRACE("Adding: text %s, binary %s, icon %p\n", debugstr_w(text), debugstr_w(binary), hIcon);
@@ -3483,7 +3456,7 @@ static UINT msi_listview_add_item( MSIRECORD *rec, LPVOID param ) return ERROR_SUCCESS; }
-static UINT msi_listview_add_items( msi_dialog *dialog, msi_control *control ) +static UINT listview_add_items( msi_dialog *dialog, msi_control *control ) { MSIQUERY *view; struct listview_param lv_param = { dialog, control }; @@ -3491,14 +3464,14 @@ static UINT msi_listview_add_items( msi_dialog *dialog, msi_control *control ) if (MSI_OpenQuery( dialog->package->db, &view, L"SELECT * FROM `ListView` WHERE `Property` = '%s' ORDER BY `Order`", control->property ) == ERROR_SUCCESS) { - MSI_IterateRecords( view, NULL, msi_listview_add_item, &lv_param ); + MSI_IterateRecords( view, NULL, listview_add_item, &lv_param ); msiobj_release( &view->hdr ); }
return ERROR_SUCCESS; }
-static UINT msi_dialog_listview( msi_dialog *dialog, MSIRECORD *rec ) +static UINT dialog_listview( msi_dialog *dialog, MSIRECORD *rec ) { msi_control *control; LPCWSTR prop; @@ -3511,12 +3484,12 @@ static UINT msi_dialog_listview( msi_dialog *dialog, MSIRECORD *rec ) attributes = MSI_RecordGetInteger( rec, 8 ); if ( ~attributes & msidbControlAttributesSorted ) style |= LVS_SORTASCENDING; - control = msi_dialog_add_control( dialog, rec, WC_LISTVIEWW, style ); + control = dialog_add_control( dialog, rec, WC_LISTVIEWW, style ); if (!control) return ERROR_FUNCTION_FAILED;
prop = MSI_RecordGetString( rec, 9 ); - control->property = msi_dialog_dup_property( dialog, prop, FALSE ); + control->property = dialog_dup_property( dialog, prop, FALSE );
control->hImageList = ImageList_Create( 16, 16, ILC_COLOR32, 0, 1); SendMessageW( control->hwnd, LVM_SETIMAGELIST, LVSIL_SMALL, (LPARAM)control->hImageList ); @@ -3531,40 +3504,40 @@ static UINT msi_dialog_listview( msi_dialog *dialog, MSIRECORD *rec ) SendMessageW( control->hwnd, LVM_INSERTCOLUMNW, 0, (LPARAM)&col );
if (control->property) - msi_listview_add_items( dialog, control ); + listview_add_items( dialog, control );
- control->handler = msi_dialog_listview_handler; + control->handler = dialog_listview_handler;
return ERROR_SUCCESS; }
static const struct control_handler msi_dialog_handler[] = { - { L"Text", msi_dialog_text_control }, - { L"PushButton", msi_dialog_button_control }, - { L"Line", msi_dialog_line_control }, - { L"Bitmap", msi_dialog_bitmap_control }, - { L"CheckBox", msi_dialog_checkbox_control }, - { L"ScrollableText", msi_dialog_scrolltext_control }, - { L"ComboBox", msi_dialog_combo_control }, - { L"Edit", msi_dialog_edit_control }, - { L"MaskedEdit", msi_dialog_maskedit_control }, - { L"PathEdit", msi_dialog_pathedit_control }, - { L"ProgressBar", msi_dialog_progress_bar }, - { L"RadioButtonGroup", msi_dialog_radiogroup_control }, - { L"Icon", msi_dialog_icon_control }, - { L"SelectionTree", msi_dialog_selection_tree }, - { L"GroupBox", msi_dialog_group_box }, - { L"ListBox", msi_dialog_list_box }, - { L"DirectoryCombo", msi_dialog_directory_combo }, - { L"DirectoryList", msi_dialog_directory_list }, - { L"VolumeCostList", msi_dialog_volumecost_list }, - { L"VolumeSelectCombo", msi_dialog_volumeselect_combo }, - { L"HyperLink", msi_dialog_hyperlink }, - { L"ListView", msi_dialog_listview } + { L"Text", dialog_text_control }, + { L"PushButton", dialog_button_control }, + { L"Line", dialog_line_control }, + { L"Bitmap", dialog_bitmap_control }, + { L"CheckBox", dialog_checkbox_control }, + { L"ScrollableText", dialog_scrolltext_control }, + { L"ComboBox", dialog_combo_control }, + { L"Edit", dialog_edit_control }, + { L"MaskedEdit", dialog_maskedit_control }, + { L"PathEdit", dialog_pathedit_control }, + { L"ProgressBar", dialog_progress_bar }, + { L"RadioButtonGroup", dialog_radiogroup_control }, + { L"Icon", dialog_icon_control }, + { L"SelectionTree", dialog_selection_tree }, + { L"GroupBox", dialog_group_box }, + { L"ListBox", dialog_list_box }, + { L"DirectoryCombo", dialog_directory_combo }, + { L"DirectoryList", dialog_directory_list }, + { L"VolumeCostList", dialog_volumecost_list }, + { L"VolumeSelectCombo", dialog_volumeselect_combo }, + { L"HyperLink", dialog_hyperlink }, + { L"ListView", dialog_listview } };
-static UINT msi_dialog_create_controls( MSIRECORD *rec, LPVOID param ) +static UINT dialog_create_controls( MSIRECORD *rec, void *param ) { msi_dialog *dialog = param; LPCWSTR control_type; @@ -3583,7 +3556,7 @@ static UINT msi_dialog_create_controls( MSIRECORD *rec, LPVOID param ) return ERROR_SUCCESS; }
-static UINT msi_dialog_fill_controls( msi_dialog *dialog ) +static UINT dialog_fill_controls( msi_dialog *dialog ) { UINT r; MSIQUERY *view; @@ -3599,19 +3572,19 @@ static UINT msi_dialog_fill_controls( msi_dialog *dialog ) return ERROR_INVALID_PARAMETER; }
- r = MSI_IterateRecords( view, 0, msi_dialog_create_controls, dialog ); + r = MSI_IterateRecords( view, 0, dialog_create_controls, dialog ); msiobj_release( &view->hdr ); return r; }
-static UINT msi_dialog_reset( msi_dialog *dialog ) +static UINT dialog_reset( msi_dialog *dialog ) { /* FIXME: should restore the original values of any properties we changed */ - return msi_dialog_evaluate_control_conditions( dialog ); + return dialog_evaluate_control_conditions( dialog ); }
/* figure out the height of 10 point MS Sans Serif */ -static INT msi_dialog_get_sans_serif_height( HWND hwnd ) +static INT dialog_get_sans_serif_height( HWND hwnd ) { LOGFONTW lf; TEXTMETRICW tm; @@ -3642,7 +3615,7 @@ static INT msi_dialog_get_sans_serif_height( HWND hwnd ) }
/* fetch the associated record from the Dialog table */ -static MSIRECORD *msi_get_dialog_record( msi_dialog *dialog ) +static MSIRECORD *get_dialog_record( msi_dialog *dialog ) { MSIPACKAGE *package = dialog->package; MSIRECORD *rec = NULL; @@ -3656,7 +3629,7 @@ static MSIRECORD *msi_get_dialog_record( msi_dialog *dialog ) return rec; }
-static void msi_dialog_adjust_dialog_pos( msi_dialog *dialog, MSIRECORD *rec, LPRECT pos ) +static void dialog_adjust_dialog_pos( msi_dialog *dialog, MSIRECORD *rec, RECT *pos ) { UINT xres, yres; POINT center; @@ -3669,8 +3642,8 @@ static void msi_dialog_adjust_dialog_pos( msi_dialog *dialog, MSIRECORD *rec, LP sz.cx = MSI_RecordGetInteger( rec, 4 ); sz.cy = MSI_RecordGetInteger( rec, 5 );
- sz.cx = msi_dialog_scale_unit( dialog, sz.cx ); - sz.cy = msi_dialog_scale_unit( dialog, sz.cy ); + sz.cx = dialog_scale_unit( dialog, sz.cx ); + sz.cy = dialog_scale_unit( dialog, sz.cy );
xres = msi_get_property_int( dialog->package->db, L"ScreenX", 0 ); yres = msi_get_property_int( dialog->package->db, L"ScreenY", 0 ); @@ -3707,14 +3680,14 @@ static void msi_dialog_adjust_dialog_pos( msi_dialog *dialog, MSIRECORD *rec, LP AdjustWindowRect( pos, style, FALSE ); }
-static void msi_dialog_set_tab_order( msi_dialog *dialog, LPCWSTR first ) +static void dialog_set_tab_order( msi_dialog *dialog, const WCHAR *first ) { struct list tab_chain; msi_control *control; HWND prev = HWND_TOP;
list_init( &tab_chain ); - if (!(control = msi_dialog_find_control( dialog, first ))) return; + if (!(control = dialog_find_control( dialog, first ))) return;
dialog->hWndFocus = control->hwnd; while (control) @@ -3722,7 +3695,7 @@ static void msi_dialog_set_tab_order( msi_dialog *dialog, LPCWSTR first ) list_remove( &control->entry ); list_add_tail( &tab_chain, &control->entry ); if (!control->tabnext) break; - control = msi_dialog_find_control( dialog, control->tabnext ); + control = dialog_find_control( dialog, control->tabnext ); }
LIST_FOR_EACH_ENTRY( control, &tab_chain, msi_control, entry ) @@ -3737,7 +3710,7 @@ static void msi_dialog_set_tab_order( msi_dialog *dialog, LPCWSTR first ) list_move_head( &dialog->controls, &tab_chain ); }
-static LRESULT msi_dialog_oncreate( HWND hwnd, LPCREATESTRUCTW cs ) +static LRESULT dialog_oncreate( HWND hwnd, CREATESTRUCTW *cs ) { msi_dialog *dialog = cs->lpCreateParams; MSIRECORD *rec = NULL; @@ -3749,16 +3722,16 @@ static LRESULT msi_dialog_oncreate( HWND hwnd, LPCREATESTRUCTW cs ) dialog->hwnd = hwnd; SetWindowLongPtrW( hwnd, GWLP_USERDATA, (LONG_PTR) dialog );
- rec = msi_get_dialog_record( dialog ); + rec = get_dialog_record( dialog ); if( !rec ) { TRACE("No record found for dialog %s\n", debugstr_w(dialog->name)); return -1; }
- dialog->scale = msi_dialog_get_sans_serif_height(dialog->hwnd); + dialog->scale = dialog_get_sans_serif_height(dialog->hwnd);
- msi_dialog_adjust_dialog_pos( dialog, rec, &pos ); + dialog_adjust_dialog_pos( dialog, rec, &pos );
dialog->attributes = MSI_RecordGetInteger( rec, 6 );
@@ -3773,7 +3746,7 @@ static LRESULT msi_dialog_oncreate( HWND hwnd, LPCREATESTRUCTW cs ) } }
- title = msi_get_deformatted_field( dialog->package, rec, 7 ); + title = get_deformatted_field( dialog->package, rec, 7 ); SetWindowTextW( hwnd, title ); free( title );
@@ -3781,16 +3754,16 @@ static LRESULT msi_dialog_oncreate( HWND hwnd, LPCREATESTRUCTW cs ) pos.right - pos.left, pos.bottom - pos.top, SWP_NOACTIVATE | SWP_NOZORDER | SWP_NOREDRAW );
- msi_dialog_build_font_list( dialog ); - msi_dialog_fill_controls( dialog ); - msi_dialog_evaluate_control_conditions( dialog ); - msi_dialog_set_tab_order( dialog, MSI_RecordGetString( rec, 8 ) ); + dialog_build_font_list( dialog ); + dialog_fill_controls( dialog ); + dialog_evaluate_control_conditions( dialog ); + dialog_set_tab_order( dialog, MSI_RecordGetString( rec, 8 ) ); msiobj_release( &rec->hdr );
return 0; }
-static LRESULT msi_dialog_oncommand( msi_dialog *dialog, WPARAM param, HWND hwnd ) +static LRESULT dialog_oncommand( msi_dialog *dialog, WPARAM param, HWND hwnd ) { msi_control *control = NULL;
@@ -3799,13 +3772,13 @@ static LRESULT msi_dialog_oncommand( msi_dialog *dialog, WPARAM param, HWND hwnd switch (param) { case 1: /* enter */ - control = msi_dialog_find_control( dialog, dialog->control_default ); + control = dialog_find_control( dialog, dialog->control_default ); break; case 2: /* escape */ - control = msi_dialog_find_control( dialog, dialog->control_cancel ); + control = dialog_find_control( dialog, dialog->control_cancel ); break; default: - control = msi_dialog_find_control_by_hwnd( dialog, hwnd ); + control = dialog_find_control_by_hwnd( dialog, hwnd ); }
if( control ) @@ -3813,17 +3786,17 @@ static LRESULT msi_dialog_oncommand( msi_dialog *dialog, WPARAM param, HWND hwnd if( control->handler ) { control->handler( dialog, control, param ); - msi_dialog_evaluate_control_conditions( dialog ); + dialog_evaluate_control_conditions( dialog ); } }
return 0; }
-static LRESULT msi_dialog_onnotify( msi_dialog *dialog, LPARAM param ) +static LRESULT dialog_onnotify( msi_dialog *dialog, LPARAM param ) { LPNMHDR nmhdr = (LPNMHDR) param; - msi_control *control = msi_dialog_find_control_by_hwnd( dialog, nmhdr->hwndFrom ); + msi_control *control = dialog_find_control_by_hwnd( dialog, nmhdr->hwndFrom );
TRACE("%p %p\n", dialog, nmhdr->hwndFrom);
@@ -3858,14 +3831,14 @@ static LRESULT WINAPI MSIDialog_WndProc( HWND hwnd, UINT msg, break;
case WM_CREATE: - return msi_dialog_oncreate( hwnd, (LPCREATESTRUCTW)lParam ); + return dialog_oncreate( hwnd, (LPCREATESTRUCTW)lParam );
case WM_COMMAND: - return msi_dialog_oncommand( dialog, wParam, (HWND)lParam ); + return dialog_oncommand( dialog, wParam, (HWND)lParam );
case WM_CLOSE: /* Simulate escape press */ - return msi_dialog_oncommand(dialog, 2, NULL); + return dialog_oncommand(dialog, 2, NULL);
case WM_ACTIVATE: if( LOWORD(wParam) == WA_INACTIVE ) @@ -3886,7 +3859,7 @@ static LRESULT WINAPI MSIDialog_WndProc( HWND hwnd, UINT msg, dialog->hwnd = NULL; return 0; case WM_NOTIFY: - return msi_dialog_onnotify( dialog, lParam ); + return dialog_onnotify( dialog, lParam ); } return DefWindowProcW(hwnd, msg, wParam, lParam); } @@ -3947,8 +3920,7 @@ static UINT dialog_run_message_loop( msi_dialog *dialog ) return ERROR_SUCCESS; }
-static LRESULT WINAPI MSIHiddenWindowProc( HWND hwnd, UINT msg, - WPARAM wParam, LPARAM lParam ) +static LRESULT WINAPI MSIHiddenWindowProc( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam ) { msi_dialog *dialog = (msi_dialog*) lParam;
@@ -4020,7 +3992,7 @@ static msi_dialog *dialog_create( MSIPACKAGE *package, const WCHAR *name, msi_di list_init( &dialog->fonts );
/* verify that the dialog exists */ - rec = msi_get_dialog_record( dialog ); + rec = get_dialog_record( dialog ); if( !rec ) { free( dialog ); @@ -4045,7 +4017,7 @@ static msi_dialog *dialog_create( MSIPACKAGE *package, const WCHAR *name, msi_di return dialog; }
-static void msi_dialog_end_dialog( msi_dialog *dialog ) +static void dialog_end_dialog( msi_dialog *dialog ) { TRACE("%p\n", dialog); dialog->finished = 1; @@ -4146,7 +4118,7 @@ void msi_dialog_destroy( msi_dialog *dialog )
t = LIST_ENTRY( list_head( &dialog->controls ), msi_control, entry ); - msi_destroy_control( t ); + destroy_control( t ); }
/* destroy the list of fonts */ @@ -4367,7 +4339,7 @@ static UINT event_end_dialog( msi_dialog *dialog, const WCHAR *argument ) dialog->retval = IDABORT; } event_cleanup_subscriptions( dialog->package, dialog->name ); - msi_dialog_end_dialog( dialog ); + dialog_end_dialog( dialog ); return ERROR_SUCCESS; }
@@ -4385,7 +4357,7 @@ static UINT event_new_dialog( msi_dialog *dialog, const WCHAR *argument ) /* store the name of the next dialog, and signal this one to end */ dialog->package->next_dialog = wcsdup( argument ); msi_event_cleanup_all_subscriptions( dialog->package ); - msi_dialog_end_dialog( dialog ); + dialog_end_dialog( dialog ); return ERROR_SUCCESS; }
@@ -4406,10 +4378,10 @@ static UINT event_spawn_dialog( msi_dialog *dialog, const WCHAR *argument ) if (r != 0) { dialog->retval = r; - msi_dialog_end_dialog( dialog ); + dialog_end_dialog( dialog ); } else - msi_dialog_update_all_controls(dialog); + dialog_update_all_controls(dialog);
return ERROR_SUCCESS; } @@ -4516,7 +4488,7 @@ static UINT event_set_target_path( msi_dialog *dialog, const WCHAR *argument )
static UINT event_reset( msi_dialog *dialog, const WCHAR *argument ) { - msi_dialog_reset( dialog ); + dialog_reset( dialog ); return ERROR_SUCCESS; }
@@ -4582,12 +4554,12 @@ static UINT event_set_install_level( msi_dialog *dialog, const WCHAR *argument )
static UINT event_directory_list_up( msi_dialog *dialog, const WCHAR *argument ) { - return msi_dialog_directorylist_up( dialog ); + return dialog_directorylist_up( dialog ); }
static UINT event_directory_list_new( msi_dialog *dialog, const WCHAR *argument ) { - return msi_dialog_directorylist_new( dialog ); + return dialog_directorylist_new( dialog ); }
static UINT event_reinstall_mode( msi_dialog *dialog, const WCHAR *argument ) diff --git a/dlls/msi/files.c b/dlls/msi/files.c index 8267691a94d..b325d1c4085 100644 --- a/dlls/msi/files.c +++ b/dlls/msi/files.c @@ -67,7 +67,7 @@ HANDLE msi_create_file( MSIPACKAGE *package, const WCHAR *filename, DWORD access return handle; }
-static BOOL msi_copy_file( MSIPACKAGE *package, const WCHAR *src, const WCHAR *dst, BOOL fail_if_exists ) +static BOOL copy_file( MSIPACKAGE *package, const WCHAR *src, const WCHAR *dst, BOOL fail_if_exists ) { BOOL ret; msi_disable_fs_redirection( package ); @@ -85,7 +85,7 @@ BOOL msi_delete_file( MSIPACKAGE *package, const WCHAR *filename ) return ret; }
-static BOOL msi_create_directory( MSIPACKAGE *package, const WCHAR *path ) +static BOOL create_directory( MSIPACKAGE *package, const WCHAR *path ) { BOOL ret; msi_disable_fs_redirection( package ); @@ -148,7 +148,7 @@ BOOL msi_move_file( MSIPACKAGE *package, const WCHAR *from, const WCHAR *to, DWO return ret; }
-static BOOL msi_apply_filepatch( MSIPACKAGE *package, const WCHAR *patch, const WCHAR *old, const WCHAR *new ) +static BOOL apply_filepatch( MSIPACKAGE *package, const WCHAR *patch, const WCHAR *old, const WCHAR *new ) { BOOL ret; msi_disable_fs_redirection( package ); @@ -220,7 +220,7 @@ BOOL msi_create_full_path( MSIPACKAGE *package, const WCHAR *path ) while ((len = lstrlenW( new_path )) && new_path[len - 1] == '\') new_path[len - 1] = 0;
- while (!msi_create_directory( package, new_path )) + while (!create_directory( package, new_path )) { WCHAR *slash; DWORD last_error = GetLastError(); @@ -248,7 +248,7 @@ BOOL msi_create_full_path( MSIPACKAGE *package, const WCHAR *path ) return ret; }
-static void msi_file_update_ui( MSIPACKAGE *package, MSIFILE *f, const WCHAR *action ) +static void file_update_ui( MSIPACKAGE *package, MSIFILE *f, const WCHAR *action ) { MSIRECORD *uirow;
@@ -401,11 +401,11 @@ static void schedule_install_files(MSIPACKAGE *package) } }
-static UINT copy_file( MSIPACKAGE *package, MSIFILE *file, WCHAR *source ) +static UINT copy_file_attributes( MSIPACKAGE *package, MSIFILE *file, WCHAR *source ) { BOOL ret;
- ret = msi_copy_file( package, source, file->TargetPath, FALSE ); + ret = copy_file( package, source, file->TargetPath, FALSE ); if (!ret) return GetLastError();
@@ -419,7 +419,7 @@ static UINT copy_install_file(MSIPACKAGE *package, MSIFILE *file, LPWSTR source)
TRACE("Copying %s to %s\n", debugstr_w(source), debugstr_w(file->TargetPath));
- gle = copy_file( package, file, source ); + gle = copy_file_attributes( package, file, source ); if (gle == ERROR_SUCCESS) return gle;
@@ -432,7 +432,7 @@ static UINT copy_install_file(MSIPACKAGE *package, MSIFILE *file, LPWSTR source) { msi_set_file_attributes( package, file->TargetPath, FILE_ATTRIBUTE_NORMAL );
- gle = copy_file( package, file, source ); + gle = copy_file_attributes( package, file, source ); TRACE("Overwriting existing file: %d\n", gle); } if (gle == ERROR_SHARING_VIOLATION || gle == ERROR_USER_MAPPED_FILE) @@ -453,7 +453,7 @@ static UINT copy_install_file(MSIPACKAGE *package, MSIFILE *file, LPWSTR source) if (!GetTempFileNameW( pathW, L"msi", 0, tmpfileW )) tmpfileW[0] = 0; free( pathW );
- if (msi_copy_file( package, source, tmpfileW, FALSE ) && + if (copy_file( package, source, tmpfileW, FALSE ) && msi_move_file( package, file->TargetPath, NULL, MOVEFILE_DELAY_UNTIL_REBOOT ) && msi_move_file( package, tmpfileW, file->TargetPath, MOVEFILE_DELAY_UNTIL_REBOOT )) { @@ -472,7 +472,7 @@ static UINT copy_install_file(MSIPACKAGE *package, MSIFILE *file, LPWSTR source) return gle; }
-static UINT create_directory( MSIPACKAGE *package, const WCHAR *dir ) +static UINT create_folder( MSIPACKAGE *package, const WCHAR *dir ) { MSIFOLDER *folder; const WCHAR *install_path; @@ -519,7 +519,7 @@ static BOOL installfiles_cb(MSIPACKAGE *package, LPCWSTR filename, DWORD action,
if (!msi_is_global_assembly( file->Component )) { - create_directory( package, file->Component->Directory ); + create_folder( package, file->Component->Directory ); } *path = wcsdup( file->TargetPath ); *attrs = file->Attributes; @@ -579,7 +579,7 @@ UINT ACTION_InstallFiles(MSIPACKAGE *package) { BOOL is_global_assembly = msi_is_global_assembly( file->Component );
- msi_file_update_ui( package, file, L"InstallFiles" ); + file_update_ui( package, file, L"InstallFiles" );
rc = msi_load_media_info( package, file->Sequence, mi ); if (rc != ERROR_SUCCESS) @@ -628,7 +628,7 @@ UINT ACTION_InstallFiles(MSIPACKAGE *package)
if (!is_global_assembly) { - create_directory(package, file->Component->Directory); + create_folder(package, file->Component->Directory); } rc = copy_install_file(package, file, source); if (rc != ERROR_SUCCESS) @@ -707,7 +707,7 @@ static UINT patch_file( MSIPACKAGE *package, MSIFILEPATCH *patch ) WCHAR *tmpfile = msi_create_temp_file( package->db );
if (!tmpfile) return ERROR_INSTALL_FAILURE; - if (msi_apply_filepatch( package, patch->path, patch->File->TargetPath, tmpfile )) + if (apply_filepatch( package, patch->path, patch->File->TargetPath, tmpfile )) { msi_delete_file( package, patch->File->TargetPath ); msi_move_file( package, tmpfile, patch->File->TargetPath, 0 ); @@ -751,7 +751,7 @@ UINT msi_patch_assembly( MSIPACKAGE *package, MSIASSEMBLY *assembly, MSIFILEPATC
if ((path = msi_get_assembly_path( package, displayname ))) { - if (!msi_copy_file( package, path, patch->File->TargetPath, FALSE )) + if (!copy_file( package, path, patch->File->TargetPath, FALSE )) { ERR( "failed to copy file %s -> %s (%lu)\n", debugstr_w(path), debugstr_w(patch->File->TargetPath), GetLastError() ); @@ -884,10 +884,10 @@ static BOOL move_file( MSIPACKAGE *package, const WCHAR *source, const WCHAR *de else { TRACE("copying %s -> %s\n", debugstr_w(source), debugstr_w(dest)); - ret = msi_copy_file( package, source, dest, FALSE ); + ret = copy_file( package, source, dest, FALSE ); if (!ret) { - WARN( "msi_copy_file failed: %lu\n", GetLastError() ); + WARN( "copy_file failed: %lu\n", GetLastError() ); return FALSE; } } @@ -1294,7 +1294,7 @@ static UINT ITERATE_DuplicateFiles(MSIRECORD *row, LPVOID param) }
TRACE("Duplicating file %s to %s\n", debugstr_w(file->TargetPath), debugstr_w(dest)); - if (!msi_copy_file( package, file->TargetPath, dest, TRUE )) + if (!copy_file( package, file->TargetPath, dest, TRUE )) { WARN( "failed to copy file %s -> %s (%lu)\n", debugstr_w(file->TargetPath), debugstr_w(dest), GetLastError() ); @@ -1550,7 +1550,7 @@ UINT ACTION_RemoveFiles( MSIPACKAGE *package ) VS_FIXEDFILEINFO *ver;
comp = file->Component; - msi_file_update_ui( package, file, L"RemoveFiles" ); + file_update_ui( package, file, L"RemoveFiles" );
comp->Action = msi_get_component_action( package, comp ); if (comp->Action != INSTALLSTATE_ABSENT || comp->Installed == INSTALLSTATE_SOURCE) diff --git a/dlls/msi/handle.c b/dlls/msi/handle.c index 6ebe1796d3a..4093878431c 100644 --- a/dlls/msi/handle.c +++ b/dlls/msi/handle.c @@ -35,27 +35,27 @@
WINE_DEFAULT_DEBUG_CHANNEL(msi);
-static CRITICAL_SECTION MSI_handle_cs; -static CRITICAL_SECTION_DEBUG MSI_handle_cs_debug = +static CRITICAL_SECTION handle_cs; +static CRITICAL_SECTION_DEBUG handle_cs_debug = { - 0, 0, &MSI_handle_cs, - { &MSI_handle_cs_debug.ProcessLocksList, - &MSI_handle_cs_debug.ProcessLocksList }, - 0, 0, { (DWORD_PTR)(__FILE__ ": MSI_handle_cs") } + 0, 0, &handle_cs, + { &handle_cs_debug.ProcessLocksList, + &handle_cs_debug.ProcessLocksList }, + 0, 0, { (DWORD_PTR)(__FILE__ ": handle_cs") } }; -static CRITICAL_SECTION MSI_handle_cs = { &MSI_handle_cs_debug, -1, 0, 0, 0, 0 }; +static CRITICAL_SECTION handle_cs = { &handle_cs_debug, -1, 0, 0, 0, 0 };
-static CRITICAL_SECTION MSI_object_cs; -static CRITICAL_SECTION_DEBUG MSI_object_cs_debug = +static CRITICAL_SECTION object_cs; +static CRITICAL_SECTION_DEBUG object_cs_debug = { - 0, 0, &MSI_object_cs, - { &MSI_object_cs_debug.ProcessLocksList, - &MSI_object_cs_debug.ProcessLocksList }, - 0, 0, { (DWORD_PTR)(__FILE__ ": MSI_object_cs") } + 0, 0, &object_cs, + { &object_cs_debug.ProcessLocksList, + &object_cs_debug.ProcessLocksList }, + 0, 0, { (DWORD_PTR)(__FILE__ ": object_cs") } }; -static CRITICAL_SECTION MSI_object_cs = { &MSI_object_cs_debug, -1, 0, 0, 0, 0 }; +static CRITICAL_SECTION object_cs = { &object_cs_debug, -1, 0, 0, 0, 0 };
-typedef struct msi_handle_info_t +struct handle_info { BOOL remote; union { @@ -63,18 +63,18 @@ typedef struct msi_handle_info_t MSIHANDLE rem; } u; DWORD dwThreadId; -} msi_handle_info; +};
-static msi_handle_info *msihandletable = NULL; -static unsigned int msihandletable_size = 0; +static struct handle_info *handle_table = NULL; +static unsigned int handle_table_size = 0;
void msi_free_handle_table(void) { - free( msihandletable ); - msihandletable = NULL; - msihandletable_size = 0; - DeleteCriticalSection(&MSI_handle_cs); - DeleteCriticalSection(&MSI_object_cs); + free( handle_table ); + handle_table = NULL; + handle_table_size = 0; + DeleteCriticalSection(&handle_cs); + DeleteCriticalSection(&object_cs); }
static MSIHANDLE alloc_handle_table_entry(void) @@ -82,50 +82,50 @@ static MSIHANDLE alloc_handle_table_entry(void) UINT i;
/* find a slot */ - for(i=0; i<msihandletable_size; i++) - if( !msihandletable[i].u.obj && !msihandletable[i].u.rem ) + for(i = 0; i < handle_table_size; i++) + if (!handle_table[i].u.obj && !handle_table[i].u.rem) break; - if( i==msihandletable_size ) + if (i == handle_table_size) { - msi_handle_info *p; + struct handle_info *p; int newsize; - if (msihandletable_size == 0) + if (!handle_table_size) { newsize = 256; p = calloc(newsize, sizeof(*p)); } else { - newsize = msihandletable_size * 2; - p = realloc(msihandletable, newsize * sizeof(*p)); - if (p) memset(p + msihandletable_size, 0, (newsize - msihandletable_size) * sizeof(*p)); + newsize = handle_table_size * 2; + p = realloc(handle_table, newsize * sizeof(*p)); + if (p) memset(p + handle_table_size, 0, (newsize - handle_table_size) * sizeof(*p)); } if (!p) return 0; - msihandletable = p; - msihandletable_size = newsize; + handle_table = p; + handle_table_size = newsize; } return i + 1; }
MSIHANDLE alloc_msihandle( MSIOBJECTHDR *obj ) { - msi_handle_info *entry; + struct handle_info *entry; MSIHANDLE ret;
- EnterCriticalSection( &MSI_handle_cs ); + EnterCriticalSection( &handle_cs );
ret = alloc_handle_table_entry(); if (ret) { - entry = &msihandletable[ ret - 1 ]; + entry = &handle_table[ ret - 1 ]; msiobj_addref( obj ); entry->u.obj = obj; entry->dwThreadId = GetCurrentThreadId(); entry->remote = FALSE; }
- LeaveCriticalSection( &MSI_handle_cs ); + LeaveCriticalSection( &handle_cs );
TRACE( "%p -> %lu\n", obj, ret );
@@ -134,21 +134,21 @@ MSIHANDLE alloc_msihandle( MSIOBJECTHDR *obj )
MSIHANDLE alloc_msi_remote_handle(MSIHANDLE remote) { - msi_handle_info *entry; + struct handle_info *entry; MSIHANDLE ret;
- EnterCriticalSection( &MSI_handle_cs ); + EnterCriticalSection( &handle_cs );
ret = alloc_handle_table_entry(); if (ret) { - entry = &msihandletable[ ret - 1 ]; + entry = &handle_table[ ret - 1 ]; entry->u.rem = remote; entry->dwThreadId = GetCurrentThreadId(); entry->remote = TRUE; }
- LeaveCriticalSection( &MSI_handle_cs ); + LeaveCriticalSection( &handle_cs );
TRACE( "%lu -> %lu\n", remote, ret );
@@ -159,23 +159,23 @@ void *msihandle2msiinfo(MSIHANDLE handle, UINT type) { MSIOBJECTHDR *ret = NULL;
- EnterCriticalSection( &MSI_handle_cs ); + EnterCriticalSection( &handle_cs ); handle--; - if( handle >= msihandletable_size ) + if (handle >= handle_table_size) goto out; - if( msihandletable[handle].remote) + if (handle_table[handle].remote) goto out; - if( !msihandletable[handle].u.obj ) + if (!handle_table[handle].u.obj) goto out; - if( msihandletable[handle].u.obj->magic != MSIHANDLE_MAGIC ) + if (handle_table[handle].u.obj->magic != MSIHANDLE_MAGIC) goto out; - if( type && (msihandletable[handle].u.obj->type != type) ) + if (type && (handle_table[handle].u.obj->type != type)) goto out; - ret = msihandletable[handle].u.obj; + ret = handle_table[handle].u.obj; msiobj_addref( ret );
out: - LeaveCriticalSection( &MSI_handle_cs ); + LeaveCriticalSection( &handle_cs );
return ret; } @@ -184,16 +184,16 @@ MSIHANDLE msi_get_remote( MSIHANDLE handle ) { MSIHANDLE ret = 0;
- EnterCriticalSection( &MSI_handle_cs ); + EnterCriticalSection( &handle_cs ); handle--; - if( handle>=msihandletable_size ) + if (handle >= handle_table_size) goto out; - if( !msihandletable[handle].remote) + if (!handle_table[handle].remote) goto out; - ret = msihandletable[handle].u.rem; + ret = handle_table[handle].u.rem;
out: - LeaveCriticalSection( &MSI_handle_cs ); + LeaveCriticalSection( &handle_cs );
return ret; } @@ -230,12 +230,12 @@ void msiobj_addref( MSIOBJECTHDR *info )
void msiobj_lock( MSIOBJECTHDR *info ) { - EnterCriticalSection( &MSI_object_cs ); + EnterCriticalSection( &object_cs ); }
void msiobj_unlock( MSIOBJECTHDR *info ) { - LeaveCriticalSection( &MSI_object_cs ); + LeaveCriticalSection( &object_cs ); }
int msiobj_release( MSIOBJECTHDR *info ) @@ -276,19 +276,19 @@ UINT WINAPI MsiCloseHandle(MSIHANDLE handle) if (!handle) return ERROR_SUCCESS;
- EnterCriticalSection( &MSI_handle_cs ); + EnterCriticalSection( &handle_cs );
handle--; - if (handle >= msihandletable_size) + if (handle >= handle_table_size) goto out;
- if (msihandletable[handle].remote) + if (handle_table[handle].remote) { - remote_CloseHandle( msihandletable[handle].u.rem ); + remote_CloseHandle( handle_table[handle].u.rem ); } else { - info = msihandletable[handle].u.obj; + info = handle_table[handle].u.obj; if( !info ) goto out;
@@ -299,15 +299,15 @@ UINT WINAPI MsiCloseHandle(MSIHANDLE handle) } }
- msihandletable[handle].u.obj = NULL; - msihandletable[handle].remote = 0; - msihandletable[handle].dwThreadId = 0; + handle_table[handle].u.obj = NULL; + handle_table[handle].remote = 0; + handle_table[handle].dwThreadId = 0;
ret = ERROR_SUCCESS;
TRACE( "handle %lu destroyed\n", handle + 1 ); out: - LeaveCriticalSection( &MSI_handle_cs ); + LeaveCriticalSection( &handle_cs ); if( info ) msiobj_release( info );
@@ -328,18 +328,18 @@ UINT WINAPI MsiCloseAllHandles(void)
TRACE("\n");
- EnterCriticalSection( &MSI_handle_cs ); - for(i=0; i<msihandletable_size; i++) + EnterCriticalSection( &handle_cs ); + for (i = 0; i < handle_table_size; i++) { - if(msihandletable[i].dwThreadId == GetCurrentThreadId()) + if (handle_table[i].dwThreadId == GetCurrentThreadId()) { - LeaveCriticalSection( &MSI_handle_cs ); - MsiCloseHandle( i+1 ); - EnterCriticalSection( &MSI_handle_cs ); + LeaveCriticalSection( &handle_cs ); + MsiCloseHandle( i + 1 ); + EnterCriticalSection( &handle_cs ); n++; } } - LeaveCriticalSection( &MSI_handle_cs ); + LeaveCriticalSection( &handle_cs );
return n; } diff --git a/dlls/msi/insert.c b/dlls/msi/insert.c index 1859b31438f..d14300a0b7a 100644 --- a/dlls/msi/insert.c +++ b/dlls/msi/insert.c @@ -106,7 +106,7 @@ err: /* checks to see if the column order specified in the INSERT query * matches the column order of the table */ -static BOOL msi_columns_in_order(MSIINSERTVIEW *iv, UINT col_count) +static BOOL columns_in_order(MSIINSERTVIEW *iv, UINT col_count) { LPCWSTR a, b; UINT i; @@ -124,7 +124,7 @@ static BOOL msi_columns_in_order(MSIINSERTVIEW *iv, UINT col_count) /* 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 */ -static UINT msi_arrange_record(MSIINSERTVIEW *iv, MSIRECORD **values) +static UINT arrange_record(MSIINSERTVIEW *iv, MSIRECORD **values) { MSIRECORD *padded; UINT col_count, val_count; @@ -140,7 +140,7 @@ static UINT msi_arrange_record(MSIINSERTVIEW *iv, MSIRECORD **values) /* check to see if the columns are arranged already * to avoid unnecessary copying */ - if (col_count == val_count && msi_columns_in_order(iv, col_count)) + if (col_count == val_count && columns_in_order(iv, col_count)) return ERROR_SUCCESS;
padded = MSI_CreateRecord(col_count); @@ -231,7 +231,7 @@ static UINT INSERT_execute( struct tagMSIVIEW *view, MSIRECORD *record ) if( !values ) goto err;
- r = msi_arrange_record( iv, &values ); + r = arrange_record( iv, &values ); if( r != ERROR_SUCCESS ) goto err;
diff --git a/dlls/msi/media.c b/dlls/msi/media.c index 97c59b4e543..513e04b1b7e 100644 --- a/dlls/msi/media.c +++ b/dlls/msi/media.c @@ -60,7 +60,7 @@ static BOOL source_matches_volume(MSIMEDIAINFO *mi, LPCWSTR source_root) return !wcsicmp( mi->volume_label, p ); }
-static UINT msi_change_media(MSIPACKAGE *package, MSIMEDIAINFO *mi) +static UINT change_media(MSIPACKAGE *package, MSIMEDIAINFO *mi) { MSIRECORD *record; LPWSTR source_dir; @@ -83,7 +83,7 @@ static UINT msi_change_media(MSIPACKAGE *package, MSIMEDIAINFO *mi) return r == IDRETRY ? ERROR_SUCCESS : ERROR_INSTALL_SOURCE_ABSENT; }
-static MSICABINETSTREAM *msi_get_cabinet_stream( MSIPACKAGE *package, UINT disk_id ) +static MSICABINETSTREAM *get_cabinet_stream( MSIPACKAGE *package, UINT disk_id ) { MSICABINETSTREAM *cab;
@@ -183,7 +183,7 @@ static INT_PTR CDECL cabinet_open_stream( char *pszFile, int oflag, int pmode ) MSICABINETSTREAM *cab; IStream *stream;
- if (!(cab = msi_get_cabinet_stream( package_disk.package, package_disk.id ))) + if (!(cab = get_cabinet_stream( package_disk.package, package_disk.id ))) { WARN("failed to get cabinet stream\n"); return -1; @@ -255,7 +255,7 @@ static LONG CDECL cabinet_seek_stream( INT_PTR hf, LONG dist, int seektype ) return -1; }
-static UINT msi_media_get_disk_info(MSIPACKAGE *package, MSIMEDIAINFO *mi) +static UINT media_get_disk_info(MSIPACKAGE *package, MSIMEDIAINFO *mi) { MSIRECORD *row;
@@ -313,7 +313,7 @@ static INT_PTR cabinet_next_cabinet(FDINOTIFICATIONTYPE fdint, mi->disk_id++; mi->is_continuous = TRUE;
- rc = msi_media_get_disk_info(data->package, mi); + rc = media_get_disk_info(data->package, mi); if (rc != ERROR_SUCCESS) { ERR("Failed to get next cabinet information: %d\n", rc); @@ -355,7 +355,7 @@ static INT_PTR cabinet_next_cabinet(FDINOTIFICATIONTYPE fdint, res = 0; if (GetFileAttributesW(cabinet_file) == INVALID_FILE_ATTRIBUTES) { - if (msi_change_media(data->package, mi) != ERROR_SUCCESS) + if (change_media(data->package, mi) != ERROR_SUCCESS) res = -1; }
@@ -382,7 +382,7 @@ static INT_PTR cabinet_next_cabinet_stream( FDINOTIFICATIONTYPE fdint, mi->disk_id++; mi->is_continuous = TRUE;
- rc = msi_media_get_disk_info( data->package, mi ); + rc = media_get_disk_info( data->package, mi ); if (rc != ERROR_SUCCESS) { ERR("Failed to get next cabinet information: %u\n", rc); @@ -889,7 +889,7 @@ UINT ready_media( MSIPACKAGE *package, BOOL compressed, MSIMEDIAINFO *mi )
if (!match && (mi->type == DRIVE_CDROM || mi->type == DRIVE_REMOVABLE)) { - if ((rc = msi_change_media( package, mi )) != ERROR_SUCCESS) + if ((rc = change_media( package, mi )) != ERROR_SUCCESS) { free( cabinet_file ); return rc; diff --git a/dlls/msi/msi.c b/dlls/msi/msi.c index 3ebfd94a9f0..2fcda9144d9 100644 --- a/dlls/msi/msi.c +++ b/dlls/msi/msi.c @@ -1365,7 +1365,7 @@ done: return r; }
-static UINT msi_copy_outval(LPWSTR val, LPWSTR out, LPDWORD size) +static UINT copy_outval(const WCHAR *val, WCHAR *out, DWORD *size) { UINT r = ERROR_SUCCESS;
@@ -1490,7 +1490,7 @@ UINT WINAPI MsiGetProductInfoExW(LPCWSTR szProductCode, LPCWSTR szUserSid, if (!val) val = wcsdup(L"");
- r = msi_copy_outval(val, szValue, pcchValue); + r = copy_outval(val, szValue, pcchValue); } else if (!wcscmp( szProperty, INSTALLPROPERTY_TRANSFORMSW ) || !wcscmp( szProperty, INSTALLPROPERTY_LANGUAGEW ) || @@ -1515,7 +1515,7 @@ UINT WINAPI MsiGetProductInfoExW(LPCWSTR szProductCode, LPCWSTR szUserSid, if (!val) val = wcsdup(L"");
- r = msi_copy_outval(val, szValue, pcchValue); + r = copy_outval(val, szValue, pcchValue); } else if (!wcscmp( szProperty, INSTALLPROPERTY_PRODUCTSTATEW )) { @@ -1533,14 +1533,14 @@ UINT WINAPI MsiGetProductInfoExW(LPCWSTR szProductCode, LPCWSTR szUserSid, else val = wcsdup(L"1");
- r = msi_copy_outval(val, szValue, pcchValue); + r = copy_outval(val, szValue, pcchValue); goto done; } else if (props && (val = reg_get_value(props, package, &type))) { free(val); val = wcsdup(L"5"); - r = msi_copy_outval(val, szValue, pcchValue); + r = copy_outval(val, szValue, pcchValue); goto done; }
@@ -1549,7 +1549,7 @@ UINT WINAPI MsiGetProductInfoExW(LPCWSTR szProductCode, LPCWSTR szUserSid, else goto done;
- r = msi_copy_outval(val, szValue, pcchValue); + r = copy_outval(val, szValue, pcchValue); } else if (!wcscmp( szProperty, INSTALLPROPERTY_ASSIGNMENTTYPEW )) { @@ -1558,7 +1558,7 @@ UINT WINAPI MsiGetProductInfoExW(LPCWSTR szProductCode, LPCWSTR szUserSid,
/* FIXME */ val = wcsdup(L""); - r = msi_copy_outval(val, szValue, pcchValue); + r = copy_outval(val, szValue, pcchValue); } else r = ERROR_UNKNOWN_PROPERTY; @@ -2082,7 +2082,7 @@ UINT WINAPI MsiQueryComponentStateA(LPCSTR szProductCode, return r; }
-static BOOL msi_comp_find_prod_key(LPCWSTR prodcode, MSIINSTALLCONTEXT context) +static BOOL comp_find_prod_key(const WCHAR *prodcode, MSIINSTALLCONTEXT context) { UINT r; HKEY hkey = NULL; @@ -2092,7 +2092,7 @@ static BOOL msi_comp_find_prod_key(LPCWSTR prodcode, MSIINSTALLCONTEXT context) return (r == ERROR_SUCCESS); }
-static BOOL msi_comp_find_package(LPCWSTR prodcode, MSIINSTALLCONTEXT context) +static BOOL comp_find_package(const WCHAR *prodcode, MSIINSTALLCONTEXT context) { LPCWSTR package; HKEY hkey; @@ -2116,9 +2116,8 @@ static BOOL msi_comp_find_package(LPCWSTR prodcode, MSIINSTALLCONTEXT context) return (res == ERROR_SUCCESS); }
-static UINT msi_comp_find_prodcode(WCHAR *squashed_pc, - MSIINSTALLCONTEXT context, - LPCWSTR comp, LPWSTR val, DWORD *sz) +static UINT comp_find_prodcode(const WCHAR *squashed_pc, MSIINSTALLCONTEXT context, const WCHAR *comp, WCHAR *val, + DWORD *sz) { HKEY hkey; LONG res; @@ -2160,9 +2159,9 @@ UINT WINAPI MsiQueryComponentStateW(LPCWSTR szProductCode, if (!squash_guid( szProductCode, squashed_pc )) return ERROR_INVALID_PARAMETER;
- found = msi_comp_find_prod_key(szProductCode, dwContext); + found = comp_find_prod_key(szProductCode, dwContext);
- if (!msi_comp_find_package(szProductCode, dwContext)) + if (!comp_find_package(szProductCode, dwContext)) { if (found) { @@ -2176,7 +2175,7 @@ UINT WINAPI MsiQueryComponentStateW(LPCWSTR szProductCode, *pdwState = INSTALLSTATE_UNKNOWN;
sz = 0; - if (msi_comp_find_prodcode( squashed_pc, dwContext, szComponent, NULL, &sz )) + if (comp_find_prodcode( squashed_pc, dwContext, szComponent, NULL, &sz )) return ERROR_UNKNOWN_COMPONENT;
if (sz == 0) @@ -2187,7 +2186,7 @@ UINT WINAPI MsiQueryComponentStateW(LPCWSTR szProductCode, UINT r;
if (!(val = malloc( sz ))) return ERROR_OUTOFMEMORY; - if ((r = msi_comp_find_prodcode( squashed_pc, dwContext, szComponent, val, &sz ))) + if ((r = comp_find_prodcode( squashed_pc, dwContext, szComponent, val, &sz ))) { free(val); return r; diff --git a/dlls/msi/msiquery.c b/dlls/msi/msiquery.c index b4fbf279700..e16719f53d9 100644 --- a/dlls/msi/msiquery.c +++ b/dlls/msi/msiquery.c @@ -564,8 +564,7 @@ UINT WINAPI MsiViewExecute( MSIHANDLE hView, MSIHANDLE hRec ) return ret; }
-static UINT msi_set_record_type_string( MSIRECORD *rec, UINT field, - UINT type, BOOL temporary ) +static UINT set_record_type_string( MSIRECORD *rec, UINT field, UINT type, BOOL temporary ) { WCHAR szType[0x10];
@@ -633,7 +632,7 @@ UINT MSI_ViewGetColumnInfo( MSIQUERY *query, MSICOLINFO info, MSIRECORD **prec ) if (info == MSICOLINFO_NAMES) MSI_RecordSetStringW( rec, i+1, name ); else - msi_set_record_type_string( rec, i+1, type, temporary ); + set_record_type_string( rec, i+1, type, temporary ); } *prec = rec; return ERROR_SUCCESS; @@ -1009,15 +1008,15 @@ UINT WINAPI MsiDatabaseCommit( MSIHANDLE hdb ) return r; }
-struct msi_primary_key_record_info +struct primary_key_record_info { DWORD n; MSIRECORD *rec; };
-static UINT msi_primary_key_iterator( MSIRECORD *rec, LPVOID param ) +static UINT primary_key_iterator( MSIRECORD *rec, void *param ) { - struct msi_primary_key_record_info *info = param; + struct primary_key_record_info *info = param; LPCWSTR name, table; DWORD type;
@@ -1041,10 +1040,9 @@ static UINT msi_primary_key_iterator( MSIRECORD *rec, LPVOID param ) return ERROR_SUCCESS; }
-UINT MSI_DatabaseGetPrimaryKeys( MSIDATABASE *db, - LPCWSTR table, MSIRECORD **prec ) +UINT MSI_DatabaseGetPrimaryKeys( MSIDATABASE *db, const WCHAR *table, MSIRECORD **prec ) { - struct msi_primary_key_record_info info; + struct primary_key_record_info info; MSIQUERY *query = NULL; UINT r;
@@ -1058,7 +1056,7 @@ UINT MSI_DatabaseGetPrimaryKeys( MSIDATABASE *db, /* count the number of primary key records */ info.n = 0; info.rec = 0; - r = MSI_IterateRecords( query, 0, msi_primary_key_iterator, &info ); + r = MSI_IterateRecords( query, 0, primary_key_iterator, &info ); if( r == ERROR_SUCCESS ) { TRACE( "found %lu primary keys\n", info.n ); @@ -1066,7 +1064,7 @@ UINT MSI_DatabaseGetPrimaryKeys( MSIDATABASE *db, /* allocate a record and fill in the names of the tables */ info.rec = MSI_CreateRecord( info.n ); info.n = 0; - r = MSI_IterateRecords( query, 0, msi_primary_key_iterator, &info ); + r = MSI_IterateRecords( query, 0, primary_key_iterator, &info ); if( r == ERROR_SUCCESS ) *prec = info.rec; else diff --git a/dlls/msi/package.c b/dlls/msi/package.c index f09d0c6fc92..4331f8365ee 100644 --- a/dlls/msi/package.c +++ b/dlls/msi/package.c @@ -940,7 +940,7 @@ static MSIPACKAGE *alloc_package( void ) return package; }
-static UINT msi_load_admin_properties(MSIPACKAGE *package) +static UINT load_admin_properties(MSIPACKAGE *package) { BYTE *data; UINT r, sz; @@ -1009,7 +1009,7 @@ MSIPACKAGE *MSI_CreatePackage( MSIDATABASE *db ) }
if (package->WordCount & msidbSumInfoSourceTypeAdminImage) - msi_load_admin_properties( package ); + load_admin_properties( package );
package->log_file = INVALID_HANDLE_VALUE; package->script = SCRIPT_NONE; @@ -2110,7 +2110,7 @@ UINT WINAPI MsiSetPropertyW( MSIHANDLE hInstall, LPCWSTR szName, LPCWSTR szValue return ret; }
-static MSIRECORD *msi_get_property_row( MSIDATABASE *db, LPCWSTR name ) +static MSIRECORD *get_property_row( MSIDATABASE *db, const WCHAR *name ) { MSIRECORD *rec, *row = NULL; MSIQUERY *view; @@ -2185,7 +2185,7 @@ UINT msi_get_property( MSIDATABASE *db, LPCWSTR szName,
TRACE("%p %s %p %p\n", db, debugstr_w(szName), szValueBuf, pchValueBuf);
- row = msi_get_property_row( db, szName ); + row = get_property_row( db, szName );
if (*pchValueBuf > 0) szValueBuf[0] = 0; @@ -2300,7 +2300,7 @@ UINT WINAPI MsiGetPropertyA(MSIHANDLE hinst, const char *name, char *buf, DWORD return r; }
- row = msi_get_property_row(package->db, nameW); + row = get_property_row(package->db, nameW); if (row) value = msi_record_get_string(row, 1, &len);
@@ -2363,7 +2363,7 @@ UINT WINAPI MsiGetPropertyW(MSIHANDLE hinst, const WCHAR *name, WCHAR *buf, DWOR return r; }
- row = msi_get_property_row(package->db, name); + row = get_property_row(package->db, name); if (row) value = msi_record_get_string(row, 1, &len);
diff --git a/dlls/msi/patch.c b/dlls/msi/patch.c index 8acc741e0c7..3b8a4eef033 100644 --- a/dlls/msi/patch.c +++ b/dlls/msi/patch.c @@ -315,7 +315,7 @@ UINT msi_check_patch_applicable( MSIPACKAGE *package, MSISUMMARYINFO *si ) return ret; }
-static UINT msi_parse_patch_summary( MSISUMMARYINFO *si, MSIPATCHINFO **patch ) +static UINT parse_patch_summary( MSISUMMARYINFO *si, MSIPATCHINFO **patch ) { MSIPATCHINFO *pi; UINT r = ERROR_SUCCESS; @@ -831,7 +831,7 @@ static DWORD is_uninstallable( MSIDATABASE *db ) return ret; }
-static UINT msi_apply_patch_db( MSIPACKAGE *package, MSIDATABASE *patch_db, MSIPATCHINFO *patch ) +static UINT apply_patch_db( MSIPACKAGE *package, MSIDATABASE *patch_db, MSIPATCHINFO *patch ) { UINT i, r = ERROR_SUCCESS; WCHAR **substorage; @@ -872,7 +872,7 @@ void msi_free_patchinfo( MSIPATCHINFO *patch ) free( patch ); }
-static UINT msi_apply_patch_package( MSIPACKAGE *package, const WCHAR *file ) +static UINT apply_patch_package( MSIPACKAGE *package, const WCHAR *file ) { MSIDATABASE *patch_db = NULL; WCHAR localfile[MAX_PATH]; @@ -901,7 +901,7 @@ static UINT msi_apply_patch_package( MSIPACKAGE *package, const WCHAR *file ) r = ERROR_SUCCESS; goto done; } - r = msi_parse_patch_summary( si, &patch ); + r = parse_patch_summary( si, &patch ); if ( r != ERROR_SUCCESS ) goto done;
@@ -914,7 +914,7 @@ static UINT msi_apply_patch_package( MSIPACKAGE *package, const WCHAR *file ) if (!(patch->filename = wcsdup( file ))) goto done; if (!(patch->localfile = wcsdup( localfile ))) goto done;
- r = msi_apply_patch_db( package, patch_db, patch ); + r = apply_patch_db( package, patch_db, patch ); if (r != ERROR_SUCCESS) WARN("patch failed to apply %u\n", r);
done: @@ -940,7 +940,7 @@ UINT msi_apply_patches( MSIPACKAGE *package )
patches = msi_split_string( patch_list, ';' ); for (i = 0; patches && patches[i] && r == ERROR_SUCCESS; i++) - r = msi_apply_patch_package( package, patches[i] ); + r = apply_patch_package( package, patches[i] );
free( patches ); free( patch_list ); @@ -1018,7 +1018,7 @@ UINT msi_apply_registered_patch( MSIPACKAGE *package, LPCWSTR patch_code ) msiobj_release( &patch_db->hdr ); return r; } - r = msi_parse_patch_summary( si, &patch_info ); + r = parse_patch_summary( si, &patch_info ); msiobj_release( &si->hdr ); if (r != ERROR_SUCCESS) { @@ -1034,7 +1034,7 @@ UINT msi_apply_registered_patch( MSIPACKAGE *package, LPCWSTR patch_code ) msi_free_patchinfo( patch_info ); return ERROR_OUTOFMEMORY; } - r = msi_apply_patch_db( package, patch_db, patch_info ); + r = apply_patch_db( package, patch_db, patch_info ); msiobj_release( &patch_db->hdr ); if (r != ERROR_SUCCESS) { diff --git a/dlls/msi/record.c b/dlls/msi/record.c index 4e7430774d6..3671133ac4c 100644 --- a/dlls/msi/record.c +++ b/dlls/msi/record.c @@ -497,7 +497,7 @@ UINT WINAPI MsiRecordGetStringW( MSIHANDLE handle, UINT iField, WCHAR *szValue, return ret; }
-static UINT msi_get_stream_size( IStream *stm ) +static UINT get_stream_size( IStream *stm ) { STATSTG stat; HRESULT r; @@ -524,7 +524,7 @@ static UINT MSI_RecordDataSize(MSIRECORD *rec, UINT iField) case MSIFIELD_NULL: break; case MSIFIELD_STREAM: - return msi_get_stream_size( rec->fields[iField].u.stream ); + return get_stream_size( rec->fields[iField].u.stream ); } return 0; } @@ -865,7 +865,7 @@ UINT MSI_RecordGetIStream( MSIRECORD *rec, UINT iField, IStream **pstm) return ERROR_SUCCESS; }
-static UINT msi_dump_stream_to_file( IStream *stm, LPCWSTR name ) +static UINT dump_stream_to_file( IStream *stm, const WCHAR *name ) { ULARGE_INTEGER size; LARGE_INTEGER pos; @@ -909,7 +909,7 @@ UINT MSI_RecordStreamToFile( MSIRECORD *rec, UINT iField, LPCWSTR name ) r = MSI_RecordGetIStream( rec, iField, &stm ); if( r == ERROR_SUCCESS ) { - r = msi_dump_stream_to_file( stm, name ); + r = dump_stream_to_file( stm, name ); IStream_Release( stm ); }
diff --git a/dlls/msi/registry.c b/dlls/msi/registry.c index 4120800db1e..149f9cf9945 100644 --- a/dlls/msi/registry.c +++ b/dlls/msi/registry.c @@ -1687,9 +1687,8 @@ done: return r; }
-static UINT msi_get_patch_state(LPCWSTR prodcode, LPCWSTR usersid, - MSIINSTALLCONTEXT context, - LPWSTR patch, MSIPATCHSTATE *state) +static UINT get_patch_state(const WCHAR *prodcode, const WCHAR *usersid, MSIINSTALLCONTEXT context, + WCHAR *patch, MSIPATCHSTATE *state) { DWORD type, val, size; HKEY prod, hkey = 0; @@ -1732,10 +1731,9 @@ done: return r; }
-static UINT msi_check_product_patches(LPCWSTR prodcode, LPCWSTR usersid, - MSIINSTALLCONTEXT context, DWORD filter, DWORD index, DWORD *idx, - LPWSTR patch, LPWSTR targetprod, MSIINSTALLCONTEXT *targetctx, - LPWSTR targetsid, DWORD *sidsize, LPWSTR *transforms) +static UINT check_product_patches(const WCHAR *prodcode, const WCHAR *usersid, MSIINSTALLCONTEXT context, + DWORD filter, DWORD index, DWORD *idx, WCHAR *patch, WCHAR *targetprod, + MSIINSTALLCONTEXT *targetctx, WCHAR *targetsid, DWORD *sidsize, WCHAR **transforms) { MSIPATCHSTATE state = MSIPATCHSTATE_INVALID; LPWSTR ptr, patches = NULL; @@ -1806,8 +1804,7 @@ static UINT msi_check_product_patches(LPCWSTR prodcode, LPCWSTR usersid, { if (!(filter & MSIPATCHSTATE_APPLIED)) { - temp = msi_get_patch_state(prodcode, usersid, context, - ptr, &state); + temp = get_patch_state(prodcode, usersid, context, ptr, &state); if (temp == ERROR_BAD_CONFIGURATION) { r = ERROR_BAD_CONFIGURATION; @@ -1822,8 +1819,7 @@ static UINT msi_check_product_patches(LPCWSTR prodcode, LPCWSTR usersid, { if (!(filter & MSIPATCHSTATE_APPLIED)) { - temp = msi_get_patch_state(prodcode, usersid, context, - ptr, &state); + temp = get_patch_state(prodcode, usersid, context, ptr, &state); if (temp == ERROR_BAD_CONFIGURATION) { r = ERROR_BAD_CONFIGURATION; @@ -1901,11 +1897,10 @@ done: return r; }
-static UINT msi_enum_patches(LPCWSTR szProductCode, LPCWSTR szUserSid, - DWORD dwContext, DWORD dwFilter, DWORD dwIndex, DWORD *idx, - LPWSTR szPatchCode, LPWSTR szTargetProductCode, - MSIINSTALLCONTEXT *pdwTargetProductContext, LPWSTR szTargetUserSid, - LPDWORD pcchTargetUserSid, LPWSTR *szTransforms) +static UINT enum_patches(const WCHAR *szProductCode, const WCHAR *szUserSid, DWORD dwContext, DWORD dwFilter, + DWORD dwIndex, DWORD *idx, WCHAR *szPatchCode, WCHAR *szTargetProductCode, + MSIINSTALLCONTEXT *pdwTargetProductContext, WCHAR *szTargetUserSid, DWORD *pcchTargetUserSid, + WCHAR **szTransforms) { LPWSTR usersid = NULL; UINT r = ERROR_INVALID_PARAMETER; @@ -1918,36 +1913,27 @@ static UINT msi_enum_patches(LPCWSTR szProductCode, LPCWSTR szUserSid,
if (dwContext & MSIINSTALLCONTEXT_USERMANAGED) { - r = msi_check_product_patches(szProductCode, szUserSid, - MSIINSTALLCONTEXT_USERMANAGED, dwFilter, - dwIndex, idx, szPatchCode, - szTargetProductCode, - pdwTargetProductContext, szTargetUserSid, - pcchTargetUserSid, szTransforms); + r = check_product_patches(szProductCode, szUserSid, MSIINSTALLCONTEXT_USERMANAGED, dwFilter, dwIndex, idx, + szPatchCode, szTargetProductCode, pdwTargetProductContext, szTargetUserSid, + pcchTargetUserSid, szTransforms); if (r != ERROR_NO_MORE_ITEMS) goto done; }
if (dwContext & MSIINSTALLCONTEXT_USERUNMANAGED) { - r = msi_check_product_patches(szProductCode, szUserSid, - MSIINSTALLCONTEXT_USERUNMANAGED, dwFilter, - dwIndex, idx, szPatchCode, - szTargetProductCode, - pdwTargetProductContext, szTargetUserSid, - pcchTargetUserSid, szTransforms); + r = check_product_patches(szProductCode, szUserSid, MSIINSTALLCONTEXT_USERUNMANAGED, dwFilter, dwIndex, idx, + szPatchCode, szTargetProductCode, pdwTargetProductContext, szTargetUserSid, + pcchTargetUserSid, szTransforms); if (r != ERROR_NO_MORE_ITEMS) goto done; }
if (dwContext & MSIINSTALLCONTEXT_MACHINE) { - r = msi_check_product_patches(szProductCode, szUserSid, - MSIINSTALLCONTEXT_MACHINE, dwFilter, - dwIndex, idx, szPatchCode, - szTargetProductCode, - pdwTargetProductContext, szTargetUserSid, - pcchTargetUserSid, szTransforms); + r = check_product_patches(szProductCode, szUserSid, MSIINSTALLCONTEXT_MACHINE, dwFilter, dwIndex, idx, + szPatchCode, szTargetProductCode, pdwTargetProductContext, szTargetUserSid, + pcchTargetUserSid, szTransforms); if (r != ERROR_NO_MORE_ITEMS) goto done; } @@ -1997,10 +1983,8 @@ UINT WINAPI MsiEnumPatchesExW( const WCHAR *szProductCode, const WCHAR *szUserSi if (dwIndex == 0) last_index = 0;
- r = msi_enum_patches(szProductCode, szUserSid, dwContext, dwFilter, - dwIndex, &idx, szPatchCode, szTargetProductCode, - pdwTargetProductContext, szTargetUserSid, - pcchTargetUserSid, NULL); + r = enum_patches(szProductCode, szUserSid, dwContext, dwFilter, dwIndex, &idx, szPatchCode, szTargetProductCode, + pdwTargetProductContext, szTargetUserSid, pcchTargetUserSid, NULL);
if (r == ERROR_SUCCESS) last_index = dwIndex; @@ -2094,9 +2078,8 @@ UINT WINAPI MsiEnumPatchesW( const WCHAR *szProduct, DWORD iPatchIndex, WCHAR *l
RegCloseKey(prod);
- r = msi_enum_patches(szProduct, NULL, MSIINSTALLCONTEXT_ALL, - MSIPATCHSTATE_ALL, iPatchIndex, &idx, lpPatchBuf, - NULL, NULL, NULL, NULL, &transforms); + r = enum_patches(szProduct, NULL, MSIINSTALLCONTEXT_ALL, MSIPATCHSTATE_ALL, iPatchIndex, &idx, lpPatchBuf, NULL, + NULL, NULL, NULL, &transforms); if (r != ERROR_SUCCESS) goto done;
diff --git a/dlls/msi/suminfo.c b/dlls/msi/suminfo.c index de2dda8bf2b..57ebca1807a 100644 --- a/dlls/msi/suminfo.c +++ b/dlls/msi/suminfo.c @@ -875,8 +875,8 @@ static UINT set_prop( MSISUMMARYINFO *si, UINT uiProperty, UINT type, return ERROR_SUCCESS; }
-static UINT msi_set_prop( MSISUMMARYINFO *si, UINT uiProperty, UINT uiDataType, - INT iValue, FILETIME *pftValue, awcstring *str ) +static UINT suminfo_set_prop( MSISUMMARYINFO *si, UINT uiProperty, UINT uiDataType, INT iValue, FILETIME *pftValue, + awcstring *str ) { UINT type = get_type( uiProperty ); if( type == VT_EMPTY || type != uiDataType ) @@ -916,7 +916,7 @@ UINT WINAPI MsiSummaryInfoSetPropertyW( MSIHANDLE handle, UINT uiProperty, UINT str.unicode = TRUE; str.str.w = szValue;
- ret = msi_set_prop( si, uiProperty, uiDataType, iValue, pftValue, &str ); + ret = suminfo_set_prop( si, uiProperty, uiDataType, iValue, pftValue, &str ); msiobj_release( &si->hdr ); return ret; } @@ -946,7 +946,7 @@ UINT WINAPI MsiSummaryInfoSetPropertyA( MSIHANDLE handle, UINT uiProperty, UINT str.unicode = FALSE; str.str.a = szValue;
- ret = msi_set_prop( si, uiProperty, uiDataType, iValue, pftValue, &str ); + ret = suminfo_set_prop( si, uiProperty, uiDataType, iValue, pftValue, &str ); msiobj_release( &si->hdr ); return ret; } diff --git a/dlls/msi/table.c b/dlls/msi/table.c index 5fe803cee3c..5484f4da794 100644 --- a/dlls/msi/table.c +++ b/dlls/msi/table.c @@ -371,7 +371,7 @@ static void free_table( MSITABLE *table ) free( table ); }
-static UINT msi_table_get_row_size( MSIDATABASE *db, const MSICOLUMNINFO *cols, UINT count, UINT bytes_per_strref ) +static UINT table_get_row_size( MSIDATABASE *db, const MSICOLUMNINFO *cols, UINT count, UINT bytes_per_strref ) { const MSICOLUMNINFO *last_col;
@@ -396,8 +396,8 @@ static UINT read_table_from_storage( MSIDATABASE *db, MSITABLE *t, IStorage *stg
TRACE("%s\n",debugstr_w(t->name));
- row_size = msi_table_get_row_size( db, t->colinfo, t->col_count, db->bytes_per_strref ); - row_size_mem = msi_table_get_row_size( db, t->colinfo, t->col_count, LONG_STR_BYTES ); + row_size = table_get_row_size( db, t->colinfo, t->col_count, db->bytes_per_strref ); + row_size_mem = table_get_row_size( db, t->colinfo, t->col_count, LONG_STR_BYTES );
/* if we can't read the table, just assume that it's empty */ read_stream_data( stg, t->name, TRUE, &rawdata, &rawsize ); @@ -867,7 +867,7 @@ static UINT save_table( MSIDATABASE *db, const MSITABLE *t, UINT bytes_per_strre
TRACE("Saving %s\n", debugstr_w( t->name ) );
- row_size = msi_table_get_row_size( db, t->colinfo, t->col_count, bytes_per_strref ); + row_size = table_get_row_size( db, t->colinfo, t->col_count, bytes_per_strref ); row_count = t->row_count; for (i = 0; i < t->row_count; i++) { @@ -930,7 +930,7 @@ err: return r; }
-static void msi_update_table_columns( MSIDATABASE *db, LPCWSTR name ) +static void update_table_columns( MSIDATABASE *db, const WCHAR *name ) { MSITABLE *table; UINT size, offset, old_count; @@ -945,7 +945,7 @@ static void msi_update_table_columns( MSIDATABASE *db, LPCWSTR name ) table_get_column_info( db, name, &table->colinfo, &table->col_count ); if (!table->col_count) return;
- size = msi_table_get_row_size( db, table->colinfo, table->col_count, LONG_STR_BYTES ); + size = table_get_row_size( db, table->colinfo, table->col_count, LONG_STR_BYTES ); offset = table->colinfo[table->col_count - 1].offset;
for ( n = 0; n < table->row_count; n++ ) @@ -1599,7 +1599,7 @@ static UINT TABLE_get_column_info( struct tagMSIVIEW *view, return ERROR_SUCCESS; }
-static UINT msi_table_find_row( MSITABLEVIEW *tv, MSIRECORD *rec, UINT *row, UINT *column ); +static UINT table_find_row( MSITABLEVIEW *, MSIRECORD *, UINT *, UINT * );
static UINT table_validate_new( MSITABLEVIEW *tv, MSIRECORD *rec, UINT *column ) { @@ -1638,7 +1638,7 @@ static UINT table_validate_new( MSITABLEVIEW *tv, MSIRECORD *rec, UINT *column ) }
/* check there are no duplicate keys */ - r = msi_table_find_row( tv, rec, &row, column ); + r = table_find_row( tv, rec, &row, column ); if (r == ERROR_SUCCESS) return ERROR_FUNCTION_FAILED;
@@ -1774,7 +1774,7 @@ static UINT TABLE_delete_row( struct tagMSIVIEW *view, UINT row ) return ERROR_SUCCESS; }
-static UINT msi_table_update(struct tagMSIVIEW *view, MSIRECORD *rec, UINT row) +static UINT table_update(struct tagMSIVIEW *view, MSIRECORD *rec, UINT row) { MSITABLEVIEW *tv = (MSITABLEVIEW *)view; UINT r, new_row; @@ -1786,7 +1786,7 @@ static UINT msi_table_update(struct tagMSIVIEW *view, MSIRECORD *rec, UINT row) if (!tv->table) return ERROR_INVALID_PARAMETER;
- r = msi_table_find_row(tv, rec, &new_row, NULL); + r = table_find_row(tv, rec, &new_row, NULL); if (r != ERROR_SUCCESS) { ERR("can't find row to modify\n"); @@ -1800,7 +1800,7 @@ static UINT msi_table_update(struct tagMSIVIEW *view, MSIRECORD *rec, UINT row) return TABLE_set_row(view, new_row, rec, (1 << tv->num_cols) - 1); }
-static UINT msi_table_assign(struct tagMSIVIEW *view, MSIRECORD *rec) +static UINT table_assign(struct tagMSIVIEW *view, MSIRECORD *rec) { MSITABLEVIEW *tv = (MSITABLEVIEW *)view; UINT r, row; @@ -1808,14 +1808,14 @@ static UINT msi_table_assign(struct tagMSIVIEW *view, MSIRECORD *rec) if (!tv->table) return ERROR_INVALID_PARAMETER;
- r = msi_table_find_row(tv, rec, &row, NULL); + r = table_find_row(tv, rec, &row, NULL); if (r == ERROR_SUCCESS) return TABLE_set_row(view, row, rec, (1 << tv->num_cols) - 1); else return TABLE_insert_row( view, rec, -1, FALSE ); }
-static UINT msi_refresh_record( struct tagMSIVIEW *view, MSIRECORD *rec, UINT row ) +static UINT refresh_record( struct tagMSIVIEW *view, MSIRECORD *rec, UINT row ) { MSIRECORD *curr; UINT r, i, count; @@ -1873,20 +1873,20 @@ static UINT TABLE_modify( struct tagMSIVIEW *view, MSIMODIFY eModifyMode, break;
case MSIMODIFY_REFRESH: - r = msi_refresh_record( view, rec, row ); + r = refresh_record( view, rec, row ); break;
case MSIMODIFY_UPDATE: - r = msi_table_update( view, rec, row ); + r = table_update( view, rec, row ); break;
case MSIMODIFY_ASSIGN: - r = msi_table_assign( view, rec ); + r = table_assign( view, rec ); break;
case MSIMODIFY_MERGE: /* check row that matches this record */ - r = msi_table_find_row( tv, rec, &frow, &column ); + r = table_find_row( tv, rec, &frow, &column ); if (r != ERROR_SUCCESS) { r = table_validate_new( tv, rec, NULL ); @@ -1967,7 +1967,7 @@ static UINT TABLE_remove_column(struct tagMSIVIEW *view, UINT number) return r; }
- r = msi_table_find_row((MSITABLEVIEW *)columns, rec, &row, NULL); + r = table_find_row((MSITABLEVIEW *)columns, rec, &row, NULL); if (r != ERROR_SUCCESS) goto done;
@@ -1975,7 +1975,7 @@ static UINT TABLE_remove_column(struct tagMSIVIEW *view, UINT number) if (r != ERROR_SUCCESS) goto done;
- msi_update_table_columns(tv->db, tv->name); + update_table_columns(tv->db, tv->name);
done: msiobj_release(&rec->hdr); @@ -2061,7 +2061,7 @@ static UINT TABLE_add_column(struct tagMSIVIEW *view, LPCWSTR column,
table_calc_column_offsets( tv->db, tv->table->colinfo, tv->table->col_count);
- size = msi_table_get_row_size( tv->db, tv->table->colinfo, tv->table->col_count, LONG_STR_BYTES ); + size = table_get_row_size( tv->db, tv->table->colinfo, tv->table->col_count, LONG_STR_BYTES ); offset = tv->table->colinfo[tv->table->col_count - 1].offset; for (i = 0; i < tv->table->row_count; i++) { @@ -2145,7 +2145,7 @@ static UINT TABLE_drop(struct tagMSIVIEW *view) return r; }
- r = msi_table_find_row((MSITABLEVIEW *)tables, rec, &row, NULL); + r = table_find_row((MSITABLEVIEW *)tables, rec, &row, NULL); if (r != ERROR_SUCCESS) goto done;
@@ -2218,7 +2218,7 @@ UINT TABLE_CreateView( MSIDATABASE *db, LPCWSTR name, MSIVIEW **view ) tv->db = db; tv->columns = tv->table->colinfo; tv->num_cols = tv->table->col_count; - tv->row_size = msi_table_get_row_size( db, tv->table->colinfo, tv->table->col_count, LONG_STR_BYTES ); + tv->row_size = table_get_row_size( db, tv->table->colinfo, tv->table->col_count, LONG_STR_BYTES );
TRACE("%s one row is %d bytes\n", debugstr_w(name), tv->row_size );
@@ -2260,7 +2260,7 @@ static WCHAR* create_key_string(MSITABLEVIEW *tv, MSIRECORD *rec) return key; }
-static UINT msi_record_stream_name( const MSITABLEVIEW *tv, MSIRECORD *rec, LPWSTR name, DWORD *len ) +static UINT record_stream_name( const MSITABLEVIEW *tv, MSIRECORD *rec, WCHAR *name, DWORD *len ) { UINT p = 0, i, r; DWORD l; @@ -2362,7 +2362,7 @@ static UINT TransformView_set_row( MSIVIEW *view, UINT row, MSIRECORD *rec, UINT qlen += wcslen( tv->columns[i].colname ) + 3; qlen += wcslen( key ) + 3; if (MSITYPE_IS_BINARY( tv->columns[i].type )) - r = msi_record_stream_name( tv, rec, NULL, &len ); + r = record_stream_name( tv, rec, NULL, &len ); else r = MSI_RecordGetStringW( rec, i + 1, NULL, &len ); if (r != ERROR_SUCCESS) @@ -2418,7 +2418,7 @@ static UINT TransformView_set_row( MSIVIEW *view, UINT row, MSIRECORD *rec, UINT query[p++] = '''; len = qlen - p; if (MSITYPE_IS_BINARY( tv->columns[i].type )) - msi_record_stream_name( tv, rec, query + p, &len ); + record_stream_name( tv, rec, query + p, &len ); else MSI_RecordGetStringW( rec, i + 1, query + p, &len ); p += len; @@ -2946,7 +2946,7 @@ static UINT read_raw_int(const BYTE *data, UINT col, UINT bytes) return ret; }
-static UINT msi_record_encoded_stream_name( const MSITABLEVIEW *tv, MSIRECORD *rec, LPWSTR *pstname ) +static UINT record_encoded_stream_name( const MSITABLEVIEW *tv, MSIRECORD *rec, WCHAR **pstname ) { UINT r; DWORD len; @@ -2954,7 +2954,7 @@ static UINT msi_record_encoded_stream_name( const MSITABLEVIEW *tv, MSIRECORD *r
TRACE("%p %p\n", tv, rec);
- r = msi_record_stream_name( tv, rec, NULL, &len ); + r = record_stream_name( tv, rec, NULL, &len ); if (r != ERROR_SUCCESS) return r; len++; @@ -2963,7 +2963,7 @@ static UINT msi_record_encoded_stream_name( const MSITABLEVIEW *tv, MSIRECORD *r if (!name) return ERROR_OUTOFMEMORY;
- r = msi_record_stream_name( tv, rec, name, &len ); + r = record_stream_name( tv, rec, name, &len ); if (r != ERROR_SUCCESS) { free( name ); @@ -2975,8 +2975,8 @@ static UINT msi_record_encoded_stream_name( const MSITABLEVIEW *tv, MSIRECORD *r return ERROR_SUCCESS; }
-static MSIRECORD *msi_get_transform_record( const MSITABLEVIEW *tv, const string_table *st, - IStorage *stg, const BYTE *rawdata, UINT bytes_per_strref ) +static MSIRECORD *get_transform_record( const MSITABLEVIEW *tv, const string_table *st, IStorage *stg, + const BYTE *rawdata, UINT bytes_per_strref ) { UINT i, val, ofs = 0; USHORT mask; @@ -3007,7 +3007,7 @@ static MSIRECORD *msi_get_transform_record( const MSITABLEVIEW *tv, const string
ofs += bytes_per_column( tv->db, &columns[i], bytes_per_strref );
- r = msi_record_encoded_stream_name( tv, rec, &encname ); + r = record_encoded_stream_name( tv, rec, &encname ); if ( r != ERROR_SUCCESS ) { msiobj_release( &rec->hdr ); @@ -3074,7 +3074,7 @@ static void dump_table( const string_table *st, const USHORT *rawdata, UINT raws } }
-static UINT* msi_record_to_row( const MSITABLEVIEW *tv, MSIRECORD *rec ) +static UINT *record_to_row( const MSITABLEVIEW *tv, MSIRECORD *rec ) { UINT i, r, *data;
@@ -3118,7 +3118,7 @@ static UINT* msi_record_to_row( const MSITABLEVIEW *tv, MSIRECORD *rec ) return data; }
-static UINT msi_row_matches( MSITABLEVIEW *tv, UINT row, const UINT *data, UINT *column ) +static UINT row_matches( MSITABLEVIEW *tv, UINT row, const UINT *data, UINT *column ) { UINT i, r, x, ret = ERROR_FUNCTION_FAILED;
@@ -3147,16 +3147,16 @@ static UINT msi_row_matches( MSITABLEVIEW *tv, UINT row, const UINT *data, UINT return ret; }
-static UINT msi_table_find_row( MSITABLEVIEW *tv, MSIRECORD *rec, UINT *row, UINT *column ) +static UINT table_find_row( MSITABLEVIEW *tv, MSIRECORD *rec, UINT *row, UINT *column ) { UINT i, r = ERROR_FUNCTION_FAILED, *data;
- data = msi_record_to_row( tv, rec ); + data = record_to_row( tv, rec ); if( !data ) return r; for( i = 0; i < tv->table->row_count; i++ ) { - r = msi_row_matches( tv, i, data, column ); + r = row_matches( tv, i, data, column ); if( r == ERROR_SUCCESS ) { *row = i; @@ -3173,9 +3173,8 @@ typedef struct LPWSTR name; } TRANSFORMDATA;
-static UINT msi_table_load_transform( MSIDATABASE *db, IStorage *stg, - string_table *st, TRANSFORMDATA *transform, - UINT bytes_per_strref, int err_cond ) +static UINT table_load_transform( MSIDATABASE *db, IStorage *stg, string_table *st, TRANSFORMDATA *transform, + UINT bytes_per_strref, int err_cond ) { BYTE *rawdata = NULL; MSITABLEVIEW *tv = NULL; @@ -3275,7 +3274,7 @@ static UINT msi_table_load_transform( MSIDATABASE *db, IStorage *stg, break; }
- rec = msi_get_transform_record( tv, st, stg, &rawdata[n], bytes_per_strref ); + rec = get_transform_record( tv, st, stg, &rawdata[n], bytes_per_strref ); if (rec) { WCHAR table[32]; @@ -3309,7 +3308,7 @@ static UINT msi_table_load_transform( MSIDATABASE *db, IStorage *stg, if (TRACE_ON(msidb)) dump_record( rec );
if (tv->table) - r = msi_table_find_row( tv, rec, &row, NULL ); + r = table_find_row( tv, rec, &row, NULL ); else r = ERROR_FUNCTION_FAILED; if (r == ERROR_SUCCESS) @@ -3344,9 +3343,8 @@ static UINT msi_table_load_transform( MSIDATABASE *db, IStorage *stg, WARN("failed to insert row %u\n", r); }
- if (!(err_cond & MSITRANSFORM_ERROR_VIEWTRANSFORM) && - !wcscmp( name, L"_Columns" )) - msi_update_table_columns( db, table ); + if (!(err_cond & MSITRANSFORM_ERROR_VIEWTRANSFORM) && !wcscmp( name, L"_Columns" )) + update_table_columns( db, table );
msiobj_release( &rec->hdr ); } @@ -3480,11 +3478,11 @@ UINT msi_table_apply_transform( MSIDATABASE *db, IStorage *stg, int err_cond ) * Apply _Tables and _Columns transforms first so that * the table metadata is correct, and empty tables exist. */ - ret = msi_table_load_transform( db, stg, strings, tables, bytes_per_strref, err_cond ); + ret = table_load_transform( db, stg, strings, tables, bytes_per_strref, err_cond ); if (ret != ERROR_SUCCESS && ret != ERROR_INVALID_TABLE) goto end;
- ret = msi_table_load_transform( db, stg, strings, columns, bytes_per_strref, err_cond ); + ret = table_load_transform( db, stg, strings, columns, bytes_per_strref, err_cond ); if (ret != ERROR_SUCCESS && ret != ERROR_INVALID_TABLE) goto end;
@@ -3498,7 +3496,7 @@ UINT msi_table_apply_transform( MSIDATABASE *db, IStorage *stg, int err_cond ) wcscmp( transform->name, L"_Tables" ) && ret == ERROR_SUCCESS ) { - ret = msi_table_load_transform( db, stg, strings, transform, bytes_per_strref, err_cond ); + ret = table_load_transform( db, stg, strings, transform, bytes_per_strref, err_cond ); }
list_remove( &transform->entry );
From: Hans Leidekker hans@codeweavers.com
--- dlls/msi/action.c | 38 +++---- dlls/msi/alter.c | 22 ++-- dlls/msi/appsearch.c | 38 +++---- dlls/msi/automation.c | 194 ++++++++++++++++++------------------ dlls/msi/create.c | 20 ++-- dlls/msi/custom.c | 10 +- dlls/msi/database.c | 52 +++++----- dlls/msi/delete.c | 22 ++-- dlls/msi/dialog.c | 227 ++++++++++++++++++++---------------------- dlls/msi/distinct.c | 40 ++++---- dlls/msi/drop.c | 14 +-- dlls/msi/files.c | 24 ++--- dlls/msi/font.c | 39 ++++---- dlls/msi/format.c | 94 ++++++++--------- dlls/msi/insert.c | 26 ++--- dlls/msi/msi.c | 12 +-- dlls/msi/msi_main.c | 17 ++-- dlls/msi/package.c | 6 +- dlls/msi/query.h | 3 +- dlls/msi/script.c | 39 ++++---- dlls/msi/select.c | 35 ++++--- dlls/msi/source.c | 23 ++--- dlls/msi/storages.c | 36 +++---- dlls/msi/streams.c | 32 +++--- dlls/msi/suminfo.c | 53 +++++----- dlls/msi/table.c | 186 +++++++++++++++++----------------- dlls/msi/tokenize.c | 12 +-- dlls/msi/update.c | 20 ++-- dlls/msi/where.c | 83 ++++++++------- 29 files changed, 709 insertions(+), 708 deletions(-)
diff --git a/dlls/msi/action.c b/dlls/msi/action.c index fa15a5d24cf..b6f22308e3a 100644 --- a/dlls/msi/action.c +++ b/dlls/msi/action.c @@ -69,8 +69,7 @@ static INT ui_actionstart(MSIPACKAGE *package, LPCWSTR action, LPCWSTR descripti return rc; }
-static void ui_actioninfo(MSIPACKAGE *package, LPCWSTR action, BOOL start, - INT rc) +static void ui_actioninfo(MSIPACKAGE *package, const WCHAR *action, BOOL start, INT rc) { MSIRECORD *row; WCHAR *template; @@ -815,11 +814,6 @@ UINT msi_load_all_components( MSIPACKAGE *package ) return r; }
-typedef struct { - MSIPACKAGE *package; - MSIFEATURE *feature; -} _ilfs; - static UINT add_feature_component( MSIFEATURE *feature, MSICOMPONENT *comp ) { ComponentList *cl; @@ -846,22 +840,28 @@ static UINT add_feature_child( MSIFEATURE *parent, MSIFEATURE *child ) return ERROR_SUCCESS; }
+struct package_feature +{ + MSIPACKAGE *package; + MSIFEATURE *feature; +}; + static UINT iterate_load_featurecomponents(MSIRECORD *row, LPVOID param) { - _ilfs* ilfs = param; + struct package_feature *package_feature = param; LPCWSTR component; MSICOMPONENT *comp;
component = MSI_RecordGetString(row,1);
/* 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) { WARN("ignoring unknown component %s\n", debugstr_w(component)); return ERROR_SUCCESS; } - add_feature_component( ilfs->feature, comp ); + add_feature_component( package_feature->feature, comp ); comp->Enabled = TRUE;
return ERROR_SUCCESS; @@ -872,7 +872,7 @@ static UINT load_feature(MSIRECORD *row, LPVOID param) MSIPACKAGE *package = param; MSIFEATURE *feature; MSIQUERY *view; - _ilfs ilfs; + struct package_feature package_feature; UINT rc;
/* fill in the data */ @@ -912,10 +912,10 @@ static UINT load_feature(MSIRECORD *row, LPVOID param) if (rc != ERROR_SUCCESS) return ERROR_SUCCESS;
- ilfs.package = package; - ilfs.feature = feature; + package_feature.package = package; + 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); return rc; } @@ -3418,19 +3418,19 @@ static UINT ACTION_ProcessComponents(MSIPACKAGE *package) return ERROR_SUCCESS; }
-typedef struct { +struct typelib +{ CLSID clsid; LPWSTR source; - LPWSTR path; ITypeLib *ptLib; -} typelib_struct; +};
static BOOL CALLBACK Typelib_EnumResNameProc( HMODULE hModule, LPCWSTR lpszType, LPWSTR lpszName, LONG_PTR lParam) { TLIBATTR *attr; - typelib_struct *tl_struct = (typelib_struct*) lParam; + struct typelib *tl_struct = (struct typelib *)lParam; int sz; HRESULT res;
@@ -3500,7 +3500,7 @@ static UINT ITERATE_RegisterTypeLibraries(MSIRECORD *row, LPVOID param) LPCWSTR component; MSICOMPONENT *comp; MSIFILE *file; - typelib_struct tl_struct; + struct typelib tl_struct; ITypeLib *tlib; HMODULE module; HRESULT hr; diff --git a/dlls/msi/alter.c b/dlls/msi/alter.c index 00ba4fce590..0b2b3cf5bc9 100644 --- a/dlls/msi/alter.c +++ b/dlls/msi/alter.c @@ -34,18 +34,18 @@
WINE_DEFAULT_DEBUG_CHANNEL(msidb);
-typedef struct tagMSIALTERVIEW +struct alter_view { MSIVIEW view; MSIDATABASE *db; MSIVIEW *table; column_info *colinfo; INT hold; -} MSIALTERVIEW; +};
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 );
@@ -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) { - MSIALTERVIEW *av = (MSIALTERVIEW*)view; + struct alter_view *av = (struct alter_view *)view;
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
static UINT ALTER_execute( struct tagMSIVIEW *view, MSIRECORD *record ) { - MSIALTERVIEW *av = (MSIALTERVIEW*)view; + struct alter_view *av = (struct alter_view *)view; UINT ref;
TRACE("%p %p\n", av, record); @@ -86,7 +86,7 @@ static UINT ALTER_execute( struct tagMSIVIEW *view, MSIRECORD *record )
static UINT ALTER_close( struct tagMSIVIEW *view ) { - MSIALTERVIEW *av = (MSIALTERVIEW*)view; + struct alter_view *av = (struct alter_view *)view;
TRACE("%p\n", av );
@@ -95,7 +95,7 @@ static UINT ALTER_close( struct tagMSIVIEW *view )
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 );
@@ -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, 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 );
@@ -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, MSIRECORD *rec, UINT row ) { - MSIALTERVIEW *av = (MSIALTERVIEW*)view; + struct alter_view *av = (struct alter_view *)view;
TRACE("%p %d %p\n", av, eModifyMode, rec );
@@ -124,7 +124,7 @@ static UINT ALTER_modify( struct tagMSIVIEW *view, MSIMODIFY eModifyMode,
static UINT ALTER_delete( struct tagMSIVIEW *view ) { - MSIALTERVIEW *av = (MSIALTERVIEW*)view; + struct alter_view *av = (struct alter_view *)view;
TRACE("%p\n", av ); if (av->table) @@ -159,7 +159,7 @@ static const MSIVIEWOPS alter_ops =
UINT ALTER_CreateView( MSIDATABASE *db, MSIVIEW **view, LPCWSTR name, column_info *colinfo, int hold ) { - MSIALTERVIEW *av; + struct alter_view *av; UINT r;
TRACE("%p %p %s %d\n", view, colinfo, debugstr_w(name), hold ); diff --git a/dlls/msi/appsearch.c b/dlls/msi/appsearch.c index 95c3312b3df..381e74317fe 100644 --- a/dlls/msi/appsearch.c +++ b/dlls/msi/appsearch.c @@ -34,7 +34,7 @@
WINE_DEFAULT_DEBUG_CHANNEL(msi);
-typedef struct tagMSISIGNATURE +struct signature { LPCWSTR Name; /* NOT owned by this structure */ LPWSTR File; @@ -47,7 +47,7 @@ typedef struct tagMSISIGNATURE FILETIME MinTime; FILETIME MaxTime; LPWSTR Languages; -}MSISIGNATURE; +};
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 * 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; MSIRECORD *row; @@ -148,13 +148,13 @@ static UINT get_signature( MSIPACKAGE *package, MSISIGNATURE *sig, const WCHAR * }
/* Frees any memory allocated in sig */ -static void free_signature( MSISIGNATURE *sig ) +static void free_signature( struct signature *sig ) { free(sig->File); 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; DWORD attr; @@ -220,7 +220,7 @@ done: 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; LPCWSTR signature, guid; @@ -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; WCHAR *deformatted = NULL, *ptr = NULL, *end; @@ -494,7 +494,7 @@ static LPWSTR get_ini_field(LPWSTR buf, int field) 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; LPWSTR fileName, section, key; @@ -652,7 +652,7 @@ done: * Return ERROR_SUCCESS in case of success (whether or not the file matches), * 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 ) { UINT len; @@ -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), * 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 ) { UINT rc = ERROR_SUCCESS; @@ -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), * 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 ) { HANDLE hFind; @@ -871,7 +871,7 @@ static BOOL is_full_path( const WCHAR *path ) 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; DWORD attr; @@ -940,9 +940,9 @@ static UINT search_directory( MSIPACKAGE *package, MSISIGNATURE *sig, const WCHA 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; LPCWSTR parentName; @@ -968,7 +968,7 @@ static UINT search_dr( MSIPACKAGE *package, WCHAR **appValue, MSISIGNATURE *sig parentName = MSI_RecordGetString(row, 2); if (parentName) { - MSISIGNATURE parentSig; + struct signature parentSig;
search_sig_name( package, parentName, &parentSig, &parent ); free_signature( &parentSig ); @@ -1017,7 +1017,7 @@ static UINT search_dr( MSIPACKAGE *package, WCHAR **appValue, MSISIGNATURE *sig 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;
@@ -1045,7 +1045,7 @@ static UINT ITERATE_AppSearch(MSIRECORD *row, LPVOID param) MSIPACKAGE *package = param; LPCWSTR propName, sigName; LPWSTR value = NULL; - MSISIGNATURE sig; + struct signature sig; MSIRECORD *uirow; UINT r;
@@ -1102,7 +1102,7 @@ static UINT ITERATE_CCPSearch(MSIRECORD *row, LPVOID param) MSIPACKAGE *package = param; LPCWSTR signature; LPWSTR value = NULL; - MSISIGNATURE sig; + struct signature sig; UINT r = ERROR_SUCCESS;
signature = MSI_RecordGetString(row, 1); diff --git a/dlls/msi/automation.c b/dlls/msi/automation.c index 99852938b0e..36891cc62da 100644 --- a/dlls/msi/automation.c +++ b/dlls/msi/automation.c @@ -41,33 +41,30 @@ WINE_DEFAULT_DEBUG_CHANNEL(msi); #define REG_INDEX_CLASSES_ROOT 0 #define REG_INDEX_DYN_DATA 6
-typedef struct AutomationObject AutomationObject; +struct automation_object;
-/* function that is called from AutomationObject::Invoke, specific to this type of object */ -typedef HRESULT (*auto_invoke_func)(AutomationObject* This, - DISPID dispIdMember, REFIID riid, LCID lcid, WORD flags, DISPPARAMS* pDispParams, - VARIANT* result, EXCEPINFO* ei, UINT* arg_err); -/* function that is called from AutomationObject::Release when the object is being freed - to free any private data structures (or NULL) */ -typedef void (*auto_free_func)(AutomationObject* This); - -typedef struct { +struct tid_id +{ REFIID riid; - auto_invoke_func fn_invoke; - auto_free_func fn_free; -} tid_id_t; - + /* function that is called from AutomationObject::Invoke, specific to this type of object */ + HRESULT (*fn_invoke)(struct automation_object *, DISPID, REFIID, LCID, WORD, DISPPARAMS *, VARIANT *, + EXCEPINFO *, UINT *); + /* function that is called from AutomationObject::Release when the object is being freed + to free any private data structures (or NULL) */ + void (*fn_free)(struct automation_object *); +};
-static HRESULT database_invoke(AutomationObject*,DISPID,REFIID,LCID,WORD,DISPPARAMS*,VARIANT*,EXCEPINFO*,UINT*); -static HRESULT installer_invoke(AutomationObject*,DISPID,REFIID,LCID,WORD,DISPPARAMS*,VARIANT*,EXCEPINFO*,UINT*); -static HRESULT record_invoke(AutomationObject*,DISPID,REFIID,LCID,WORD,DISPPARAMS*,VARIANT*,EXCEPINFO*,UINT*); -static HRESULT session_invoke(AutomationObject*,DISPID,REFIID,LCID,WORD,DISPPARAMS*,VARIANT*,EXCEPINFO*,UINT*); -static HRESULT list_invoke(AutomationObject*,DISPID,REFIID,LCID,WORD,DISPPARAMS*,VARIANT*,EXCEPINFO*,UINT*); -static void list_free(AutomationObject*); -static HRESULT summaryinfo_invoke(AutomationObject*,DISPID,REFIID,LCID,WORD,DISPPARAMS*,VARIANT*,EXCEPINFO*,UINT*); -static HRESULT view_invoke(AutomationObject*,DISPID,REFIID,LCID,WORD,DISPPARAMS*,VARIANT*,EXCEPINFO*,UINT*); +static HRESULT database_invoke(struct automation_object*,DISPID,REFIID,LCID,WORD,DISPPARAMS*,VARIANT*,EXCEPINFO*,UINT*); +static HRESULT installer_invoke(struct automation_object*,DISPID,REFIID,LCID,WORD,DISPPARAMS*,VARIANT*,EXCEPINFO*,UINT*); +static HRESULT record_invoke(struct automation_object*,DISPID,REFIID,LCID,WORD,DISPPARAMS*,VARIANT*,EXCEPINFO*,UINT*); +static HRESULT session_invoke(struct automation_object*,DISPID,REFIID,LCID,WORD,DISPPARAMS*,VARIANT*,EXCEPINFO*,UINT*); +static HRESULT list_invoke(struct automation_object*,DISPID,REFIID,LCID,WORD,DISPPARAMS*,VARIANT*,EXCEPINFO*,UINT*); +static void list_free(struct automation_object*); +static HRESULT summaryinfo_invoke(struct automation_object*,DISPID,REFIID,LCID,WORD,DISPPARAMS*,VARIANT*,EXCEPINFO*,UINT*); +static HRESULT view_invoke(struct automation_object*,DISPID,REFIID,LCID,WORD,DISPPARAMS*,VARIANT*,EXCEPINFO*,UINT*);
-static tid_id_t tid_ids[] = { +static struct tid_id tid_ids[] = +{ { &DIID_Database, database_invoke }, { &DIID_Installer, installer_invoke }, { &DIID_Record, record_invoke }, @@ -137,10 +134,11 @@ void release_typelib(void) }
/* - * AutomationObject - "base" class for all automation objects. For each interface, we implement Invoke function - * called from AutomationObject::Invoke. + * struct automation_object - "base" class for all automation objects. For each interface, we implement Invoke + * function called from AutomationObject::Invoke. */ -struct AutomationObject { +struct automation_object +{ IDispatch IDispatch_iface; IProvideMultipleClassInfo IProvideMultipleClassInfo_iface; LONG ref; @@ -152,46 +150,49 @@ struct AutomationObject { MSIHANDLE msiHandle; };
-typedef struct { - AutomationObject autoobj; +struct list_object +{ + struct automation_object autoobj; int count; VARIANT *data; -} ListObject; +};
static HRESULT create_database(MSIHANDLE, IDispatch**); -static HRESULT create_list_enumerator(ListObject*, void**); +static HRESULT create_list_enumerator(struct list_object *, void **); static HRESULT create_summaryinfo(MSIHANDLE, IDispatch**); static HRESULT create_view(MSIHANDLE, IDispatch**);
-/* ListEnumerator - IEnumVARIANT implementation for MSI automation lists */ -typedef struct { +/* struct list_enumerator - IEnumVARIANT implementation for MSI automation lists */ +struct list_enumerator +{ IEnumVARIANT IEnumVARIANT_iface; LONG ref;
- /* Current position and pointer to AutomationObject that stores actual data */ + /* Current position and pointer to struct automation_object that stores actual data */ ULONG pos; - ListObject *list; -} ListEnumerator; + struct list_object *list; +};
-typedef struct { - AutomationObject autoobj; +struct session_object +{ + struct automation_object autoobj; IDispatch *installer; -} SessionObject; +};
-static inline AutomationObject *impl_from_IProvideMultipleClassInfo( IProvideMultipleClassInfo *iface ) +static inline struct automation_object *impl_from_IProvideMultipleClassInfo( IProvideMultipleClassInfo *iface ) { - return CONTAINING_RECORD(iface, AutomationObject, IProvideMultipleClassInfo_iface); + return CONTAINING_RECORD(iface, struct automation_object, IProvideMultipleClassInfo_iface); }
-static inline AutomationObject *impl_from_IDispatch( IDispatch *iface ) +static inline struct automation_object *impl_from_IDispatch( IDispatch *iface ) { - return CONTAINING_RECORD(iface, AutomationObject, IDispatch_iface); + return CONTAINING_RECORD(iface, struct automation_object, IDispatch_iface); }
/* AutomationObject methods */ static HRESULT WINAPI AutomationObject_QueryInterface(IDispatch* iface, REFIID riid, void** ppvObject) { - AutomationObject *This = impl_from_IDispatch(iface); + struct automation_object *This = impl_from_IDispatch(iface);
TRACE("(%p/%p)->(%s,%p)\n", iface, This, debugstr_guid(riid), ppvObject);
@@ -221,7 +222,7 @@ static HRESULT WINAPI AutomationObject_QueryInterface(IDispatch* iface, REFIID r
static ULONG WINAPI AutomationObject_AddRef(IDispatch* iface) { - AutomationObject *This = impl_from_IDispatch(iface); + struct automation_object *This = impl_from_IDispatch(iface);
TRACE("(%p/%p)\n", iface, This);
@@ -230,7 +231,7 @@ static ULONG WINAPI AutomationObject_AddRef(IDispatch* iface)
static ULONG WINAPI AutomationObject_Release(IDispatch* iface) { - AutomationObject *This = impl_from_IDispatch(iface); + struct automation_object *This = impl_from_IDispatch(iface); ULONG ref = InterlockedDecrement(&This->ref);
TRACE("(%p/%p)\n", iface, This); @@ -249,7 +250,7 @@ static HRESULT WINAPI AutomationObject_GetTypeInfoCount( IDispatch* iface, UINT* pctinfo) { - AutomationObject *This = impl_from_IDispatch(iface); + struct automation_object *This = impl_from_IDispatch(iface);
TRACE("(%p/%p)->(%p)\n", iface, This, pctinfo); *pctinfo = 1; @@ -262,7 +263,7 @@ static HRESULT WINAPI AutomationObject_GetTypeInfo( LCID lcid, ITypeInfo** ppTInfo) { - AutomationObject *This = impl_from_IDispatch(iface); + struct automation_object *This = impl_from_IDispatch(iface); HRESULT hr;
TRACE( "(%p/%p)->(%u, %ld, %p)\n", iface, This, iTInfo, lcid, ppTInfo ); @@ -283,7 +284,7 @@ static HRESULT WINAPI AutomationObject_GetIDsOfNames( LCID lcid, DISPID* rgDispId) { - AutomationObject *This = impl_from_IDispatch(iface); + struct automation_object *This = impl_from_IDispatch(iface); ITypeInfo *ti; HRESULT hr;
@@ -324,7 +325,7 @@ static HRESULT WINAPI AutomationObject_Invoke( EXCEPINFO* pExcepInfo, UINT* puArgErr) { - AutomationObject *This = impl_from_IDispatch(iface); + struct automation_object *This = impl_from_IDispatch(iface); HRESULT hr; unsigned int uArgErr; VARIANT varResultDummy; @@ -437,25 +438,25 @@ static HRESULT WINAPI ProvideMultipleClassInfo_QueryInterface( REFIID riid, VOID** ppvoid) { - AutomationObject *This = impl_from_IProvideMultipleClassInfo(iface); + struct automation_object *This = impl_from_IProvideMultipleClassInfo(iface); return IDispatch_QueryInterface(&This->IDispatch_iface, riid, ppvoid); }
static ULONG WINAPI ProvideMultipleClassInfo_AddRef(IProvideMultipleClassInfo* iface) { - AutomationObject *This = impl_from_IProvideMultipleClassInfo(iface); + struct automation_object *This = impl_from_IProvideMultipleClassInfo(iface); return IDispatch_AddRef(&This->IDispatch_iface); }
static ULONG WINAPI ProvideMultipleClassInfo_Release(IProvideMultipleClassInfo* iface) { - AutomationObject *This = impl_from_IProvideMultipleClassInfo(iface); + struct automation_object *This = impl_from_IProvideMultipleClassInfo(iface); return IDispatch_Release(&This->IDispatch_iface); }
static HRESULT WINAPI ProvideMultipleClassInfo_GetClassInfo(IProvideMultipleClassInfo* iface, ITypeInfo** ppTI) { - AutomationObject *This = impl_from_IProvideMultipleClassInfo(iface); + struct automation_object *This = impl_from_IProvideMultipleClassInfo(iface); HRESULT hr;
TRACE("(%p/%p)->(%p)\n", iface, This, ppTI); @@ -469,7 +470,7 @@ static HRESULT WINAPI ProvideMultipleClassInfo_GetClassInfo(IProvideMultipleClas
static HRESULT WINAPI ProvideMultipleClassInfo_GetGUID(IProvideMultipleClassInfo* iface, DWORD dwGuidKind, GUID* pGUID) { - AutomationObject *This = impl_from_IProvideMultipleClassInfo(iface); + struct automation_object *This = impl_from_IProvideMultipleClassInfo(iface); TRACE("(%p/%p)->(%lu, %s)\n", iface, This, dwGuidKind, debugstr_guid(pGUID));
if (dwGuidKind != GUIDKIND_DEFAULT_SOURCE_DISP_IID) @@ -482,7 +483,7 @@ static HRESULT WINAPI ProvideMultipleClassInfo_GetGUID(IProvideMultipleClassInfo
static HRESULT WINAPI ProvideMultipleClassInfo_GetMultiTypeInfoCount(IProvideMultipleClassInfo* iface, ULONG* pcti) { - AutomationObject *This = impl_from_IProvideMultipleClassInfo(iface); + struct automation_object *This = impl_from_IProvideMultipleClassInfo(iface);
TRACE("(%p/%p)->(%p)\n", iface, This, pcti); *pcti = 1; @@ -498,7 +499,7 @@ static HRESULT WINAPI ProvideMultipleClassInfo_GetInfoOfIndex(IProvideMultipleCl IID* piidPrimary, IID* piidSource) { - AutomationObject *This = impl_from_IProvideMultipleClassInfo(iface); + struct automation_object *This = impl_from_IProvideMultipleClassInfo(iface);
TRACE("(%p/%p)->(%lu, %#lx, %p, %p, %p, %p, %p)\n", iface, This, iti, dwFlags, ti, pdwTIFlags, pcdispidReserved, piidPrimary, piidSource); @@ -541,7 +542,7 @@ static const IProvideMultipleClassInfoVtbl ProvideMultipleClassInfoVtbl = ProvideMultipleClassInfo_GetInfoOfIndex };
-static void init_automation_object(AutomationObject *This, MSIHANDLE msiHandle, tid_t tid) +static void init_automation_object(struct automation_object *This, MSIHANDLE msiHandle, tid_t tid) { TRACE("%p, %lu, %s\n", This, msiHandle, debugstr_guid(get_riid_from_tid(tid)));
@@ -556,15 +557,15 @@ static void init_automation_object(AutomationObject *This, MSIHANDLE msiHandle, * ListEnumerator methods */
-static inline ListEnumerator *impl_from_IEnumVARIANT(IEnumVARIANT* iface) +static inline struct list_enumerator *impl_from_IEnumVARIANT(IEnumVARIANT* iface) { - return CONTAINING_RECORD(iface, ListEnumerator, IEnumVARIANT_iface); + return CONTAINING_RECORD(iface, struct list_enumerator, IEnumVARIANT_iface); }
static HRESULT WINAPI ListEnumerator_QueryInterface(IEnumVARIANT* iface, REFIID riid, void** ppvObject) { - ListEnumerator *This = impl_from_IEnumVARIANT(iface); + struct list_enumerator *This = impl_from_IEnumVARIANT(iface);
TRACE("(%p/%p)->(%s,%p)\n", iface, This, debugstr_guid(riid), ppvObject);
@@ -590,7 +591,7 @@ static HRESULT WINAPI ListEnumerator_QueryInterface(IEnumVARIANT* iface, REFIID
static ULONG WINAPI ListEnumerator_AddRef(IEnumVARIANT* iface) { - ListEnumerator *This = impl_from_IEnumVARIANT(iface); + struct list_enumerator *This = impl_from_IEnumVARIANT(iface);
TRACE("(%p/%p)\n", iface, This);
@@ -599,7 +600,7 @@ static ULONG WINAPI ListEnumerator_AddRef(IEnumVARIANT* iface)
static ULONG WINAPI ListEnumerator_Release(IEnumVARIANT* iface) { - ListEnumerator *This = impl_from_IEnumVARIANT(iface); + struct list_enumerator *This = impl_from_IEnumVARIANT(iface); ULONG ref = InterlockedDecrement(&This->ref);
TRACE("(%p/%p)\n", iface, This); @@ -616,7 +617,7 @@ static ULONG WINAPI ListEnumerator_Release(IEnumVARIANT* iface) static HRESULT WINAPI ListEnumerator_Next(IEnumVARIANT* iface, ULONG celt, VARIANT* rgVar, ULONG* fetched) { - ListEnumerator *This = impl_from_IEnumVARIANT(iface); + struct list_enumerator *This = impl_from_IEnumVARIANT(iface); ULONG i, local;
TRACE("%p, %lu, %p, %p\n", iface, celt, rgVar, fetched); @@ -640,7 +641,7 @@ static HRESULT WINAPI ListEnumerator_Next(IEnumVARIANT* iface, ULONG celt, VARIA
static HRESULT WINAPI ListEnumerator_Skip(IEnumVARIANT* iface, ULONG celt) { - ListEnumerator *This = impl_from_IEnumVARIANT(iface); + struct list_enumerator *This = impl_from_IEnumVARIANT(iface);
TRACE("%p, %lu\n", iface, celt);
@@ -656,7 +657,7 @@ static HRESULT WINAPI ListEnumerator_Skip(IEnumVARIANT* iface, ULONG celt)
static HRESULT WINAPI ListEnumerator_Reset(IEnumVARIANT* iface) { - ListEnumerator *This = impl_from_IEnumVARIANT(iface); + struct list_enumerator *This = impl_from_IEnumVARIANT(iface);
TRACE("(%p)\n", iface);
@@ -666,7 +667,7 @@ static HRESULT WINAPI ListEnumerator_Reset(IEnumVARIANT* iface)
static HRESULT WINAPI ListEnumerator_Clone(IEnumVARIANT* iface, IEnumVARIANT **ppEnum) { - ListEnumerator *This = impl_from_IEnumVARIANT(iface); + struct list_enumerator *This = impl_from_IEnumVARIANT(iface); HRESULT hr;
TRACE("(%p,%p)\n", iface, ppEnum); @@ -697,13 +698,13 @@ static const struct IEnumVARIANTVtbl ListEnumerator_Vtbl = };
/* Create a list enumerator, placing the result in the pointer ppObj. */ -static HRESULT create_list_enumerator(ListObject *list, void **ppObj) +static HRESULT create_list_enumerator(struct list_object *list, void **ppObj) { - ListEnumerator *object; + struct list_enumerator *object;
TRACE("(%p, %p)\n", list, ppObj);
- object = malloc(sizeof(ListEnumerator)); + object = malloc(sizeof(*object));
/* Set all the VTable references */ object->IEnumVARIANT_iface.lpVtbl = &ListEnumerator_Vtbl; @@ -752,7 +753,7 @@ static HRESULT DispGetParam_CopyOnly( }
static HRESULT summaryinfo_invoke( - AutomationObject* This, + struct automation_object *This, DISPID dispIdMember, REFIID riid, LCID lcid, @@ -904,7 +905,7 @@ static HRESULT summaryinfo_invoke( }
static HRESULT record_invoke( - AutomationObject* This, + struct automation_object *This, DISPID dispIdMember, REFIID riid, LCID lcid, @@ -996,7 +997,7 @@ static HRESULT record_invoke(
static HRESULT create_record(MSIHANDLE msiHandle, IDispatch **disp) { - AutomationObject *record; + struct automation_object *record;
record = malloc(sizeof(*record)); if (!record) return E_OUTOFMEMORY; @@ -1009,7 +1010,7 @@ static HRESULT create_record(MSIHANDLE msiHandle, IDispatch **disp) }
static HRESULT list_invoke( - AutomationObject* This, + struct automation_object *This, DISPID dispIdMember, REFIID riid, LCID lcid, @@ -1019,7 +1020,7 @@ static HRESULT list_invoke( EXCEPINFO* pExcepInfo, UINT* puArgErr) { - ListObject *list = CONTAINING_RECORD(This, ListObject, autoobj); + struct list_object *list = CONTAINING_RECORD(This, struct list_object, autoobj); IUnknown *pUnk = NULL; HRESULT hr;
@@ -1065,9 +1066,9 @@ static HRESULT list_invoke( return S_OK; }
-static void list_free(AutomationObject *This) +static void list_free(struct automation_object *This) { - ListObject *list = CONTAINING_RECORD(This, ListObject, autoobj); + struct list_object *list = CONTAINING_RECORD(This, struct list_object, autoobj); int i;
for (i = 0; i < list->count; i++) @@ -1105,11 +1106,11 @@ static HRESULT get_products_count(const WCHAR *product, int *len)
static HRESULT create_list(const WCHAR *product, IDispatch **dispatch) { - ListObject *list; + struct list_object *list; HRESULT hr; int i;
- list = calloc(1, sizeof(ListObject)); + list = calloc(1, sizeof(*list)); if (!list) return E_OUTOFMEMORY;
init_automation_object(&list->autoobj, 0, StringList_tid); @@ -1151,7 +1152,7 @@ static HRESULT create_list(const WCHAR *product, IDispatch **dispatch) }
static HRESULT view_invoke( - AutomationObject* This, + struct automation_object *This, DISPID dispIdMember, REFIID riid, LCID lcid, @@ -1176,7 +1177,7 @@ static HRESULT view_invoke( { hr = DispGetParam(pDispParams, 0, VT_DISPATCH, &varg0, puArgErr); if (SUCCEEDED(hr) && V_DISPATCH(&varg0) != NULL) - MsiViewExecute(This->msiHandle, ((AutomationObject *)V_DISPATCH(&varg0))->msiHandle); + MsiViewExecute(This->msiHandle, ((struct automation_object *)V_DISPATCH(&varg0))->msiHandle); else MsiViewExecute(This->msiHandle, 0); } @@ -1211,7 +1212,8 @@ static HRESULT view_invoke( hr = DispGetParam(pDispParams, 1, VT_DISPATCH, &varg1, puArgErr); if (FAILED(hr)) return hr; if (!V_DISPATCH(&varg1)) return DISP_E_EXCEPTION; - if ((ret = MsiViewModify(This->msiHandle, V_I4(&varg0), ((AutomationObject *)V_DISPATCH(&varg1))->msiHandle)) != ERROR_SUCCESS) + if ((ret = MsiViewModify(This->msiHandle, V_I4(&varg0), + ((struct automation_object *)V_DISPATCH(&varg1))->msiHandle)) != ERROR_SUCCESS) { VariantClear(&varg1); ERR("MsiViewModify returned %d\n", ret); @@ -1255,7 +1257,7 @@ static HRESULT DatabaseImpl_LastErrorRecord(WORD wFlags, }
HRESULT database_invoke( - AutomationObject* This, + struct automation_object *This, DISPID dispIdMember, REFIID riid, LCID lcid, @@ -1340,7 +1342,7 @@ HRESULT database_invoke( }
static HRESULT session_invoke( - AutomationObject* This, + struct automation_object *This, DISPID dispIdMember, REFIID riid, LCID lcid, @@ -1350,7 +1352,7 @@ static HRESULT session_invoke( EXCEPINFO* pExcepInfo, UINT* puArgErr) { - SessionObject *session = CONTAINING_RECORD(This, SessionObject, autoobj); + struct session_object *session = CONTAINING_RECORD(This, struct session_object, autoobj); WCHAR *szString; DWORD dwLen = 0; MSIHANDLE msiHandle; @@ -1521,7 +1523,7 @@ static HRESULT session_invoke(
V_VT(pVarResult) = VT_I4; V_I4(pVarResult) = - MsiProcessMessage(This->msiHandle, V_I4(&varg0), ((AutomationObject *)V_DISPATCH(&varg1))->msiHandle); + MsiProcessMessage(This->msiHandle, V_I4(&varg0), ((struct automation_object *)V_DISPATCH(&varg1))->msiHandle); break;
case DISPID_SESSION_SETINSTALLLEVEL: @@ -1682,7 +1684,7 @@ static HRESULT InstallerImpl_CreateRecord(WORD wFlags, return create_record(hrec, &V_DISPATCH(pVarResult)); }
-static HRESULT InstallerImpl_OpenPackage(AutomationObject* This, +static HRESULT InstallerImpl_OpenPackage(struct automation_object *This, WORD wFlags, DISPPARAMS* pDispParams, VARIANT* pVarResult, @@ -2319,7 +2321,7 @@ static HRESULT InstallerImpl_RelatedProducts(WORD flags, }
static HRESULT installer_invoke( - AutomationObject* This, + struct automation_object *This, DISPID dispIdMember, REFIID riid, LCID lcid, @@ -2420,14 +2422,14 @@ static HRESULT installer_invoke(
HRESULT create_msiserver(IUnknown *outer, void **ppObj) { - AutomationObject *installer; + struct automation_object *installer;
TRACE("(%p %p)\n", outer, ppObj);
if (outer) return CLASS_E_NOAGGREGATION;
- installer = malloc(sizeof(AutomationObject)); + installer = malloc(sizeof(*installer)); if (!installer) return E_OUTOFMEMORY;
init_automation_object(installer, 0, Installer_tid); @@ -2439,9 +2441,9 @@ HRESULT create_msiserver(IUnknown *outer, void **ppObj)
HRESULT create_session(MSIHANDLE msiHandle, IDispatch *installer, IDispatch **disp) { - SessionObject *session; + struct session_object *session;
- session = malloc(sizeof(SessionObject)); + session = malloc(sizeof(*session)); if (!session) return E_OUTOFMEMORY;
init_automation_object(&session->autoobj, msiHandle, Session_tid); @@ -2454,11 +2456,11 @@ HRESULT create_session(MSIHANDLE msiHandle, IDispatch *installer, IDispatch **di
static HRESULT create_database(MSIHANDLE msiHandle, IDispatch **dispatch) { - AutomationObject *database; + struct automation_object *database;
TRACE("%lu %p\n", msiHandle, dispatch);
- database = malloc(sizeof(AutomationObject)); + database = malloc(sizeof(*database)); if (!database) return E_OUTOFMEMORY;
init_automation_object(database, msiHandle, Database_tid); @@ -2470,11 +2472,11 @@ static HRESULT create_database(MSIHANDLE msiHandle, IDispatch **dispatch)
static HRESULT create_view(MSIHANDLE msiHandle, IDispatch **dispatch) { - AutomationObject *view; + struct automation_object *view;
TRACE("%lu %p\n", msiHandle, dispatch);
- view = malloc(sizeof(AutomationObject)); + view = malloc(sizeof(*view)); if (!view) return E_OUTOFMEMORY;
init_automation_object(view, msiHandle, View_tid); @@ -2486,7 +2488,7 @@ static HRESULT create_view(MSIHANDLE msiHandle, IDispatch **dispatch)
static HRESULT create_summaryinfo(MSIHANDLE msiHandle, IDispatch **disp) { - AutomationObject *info; + struct automation_object *info;
info = malloc(sizeof(*info)); if (!info) return E_OUTOFMEMORY; diff --git a/dlls/msi/create.c b/dlls/msi/create.c index c9aa8f18f23..0202a67ca18 100644 --- a/dlls/msi/create.c +++ b/dlls/msi/create.c @@ -38,7 +38,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(msidb);
/* below is the query interface to a table */
-typedef struct tagMSICREATEVIEW +struct create_view { MSIVIEW view; MSIDATABASE *db; @@ -46,11 +46,11 @@ typedef struct tagMSICREATEVIEW BOOL bIsTemp; BOOL hold; column_info *col_info; -} MSICREATEVIEW; +};
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 );
@@ -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 ) { - MSICREATEVIEW *cv = (MSICREATEVIEW*)view; + struct create_view *cv = (struct create_view *)view; BOOL persist = (cv->bIsTemp) ? MSICONDITION_FALSE : MSICONDITION_TRUE;
TRACE("%p Table %s (%s)\n", cv, debugstr_w(cv->name), @@ -73,7 +73,7 @@ static UINT CREATE_execute( struct tagMSIVIEW *view, MSIRECORD *record )
static UINT CREATE_close( struct tagMSIVIEW *view ) { - MSICREATEVIEW *cv = (MSICREATEVIEW*)view; + struct create_view *cv = (struct create_view *)view;
TRACE("%p\n", cv);
@@ -82,7 +82,7 @@ static UINT CREATE_close( struct tagMSIVIEW *view )
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 );
@@ -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, 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 );
@@ -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, MSIRECORD *rec, UINT row) { - MSICREATEVIEW *cv = (MSICREATEVIEW*)view; + struct create_view *cv = (struct create_view *)view;
TRACE("%p %d %p\n", cv, eModifyMode, rec );
@@ -111,7 +111,7 @@ static UINT CREATE_modify( struct tagMSIVIEW *view, MSIMODIFY eModifyMode,
static UINT CREATE_delete( struct tagMSIVIEW *view ) { - MSICREATEVIEW *cv = (MSICREATEVIEW*)view; + struct create_view *cv = (struct create_view *)view;
TRACE("%p\n", cv );
@@ -160,7 +160,7 @@ static UINT check_columns( const column_info *col_info ) UINT CREATE_CreateView( MSIDATABASE *db, MSIVIEW **view, LPCWSTR table, column_info *col_info, BOOL hold ) { - MSICREATEVIEW *cv = NULL; + struct create_view *cv = NULL; UINT r; column_info *col; BOOL temp = TRUE; diff --git a/dlls/msi/custom.c b/dlls/msi/custom.c index fa5c1051fee..8b020db260d 100644 --- a/dlls/msi/custom.c +++ b/dlls/msi/custom.c @@ -43,13 +43,13 @@ WINE_DEFAULT_DEBUG_CHANNEL(msi);
#define CUSTOM_ACTION_TYPE_MASK 0x3F
-typedef struct tagMSIRUNNINGACTION +struct running_action { struct list entry; HANDLE handle; BOOL process; LPWSTR name; -} MSIRUNNINGACTION; +};
typedef UINT (WINAPI *MsiCustomActionEntryPoint)( MSIHANDLE );
@@ -298,9 +298,9 @@ static MSIBINARY *get_temp_binary(MSIPACKAGE *package, LPCWSTR source) static void file_running_action(MSIPACKAGE* package, HANDLE Handle, BOOL process, LPCWSTR name) { - MSIRUNNINGACTION *action; + struct running_action *action;
- action = malloc( sizeof(MSIRUNNINGACTION) ); + action = malloc( sizeof(*action) );
action->handle = Handle; action->process = process; @@ -1563,7 +1563,7 @@ void ACTION_FinishCustomActions(const MSIPACKAGE* package)
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 );
diff --git a/dlls/msi/database.c b/dlls/msi/database.c index 504e81f57c7..20c74c4d742 100644 --- a/dlls/msi/database.c +++ b/dlls/msi/database.c @@ -1206,7 +1206,7 @@ UINT WINAPI MsiDatabaseMergeA( MSIHANDLE hDatabase, MSIHANDLE hDatabaseMerge, co return r; }
-typedef struct _tagMERGETABLE +struct merge_table { struct list entry; struct list rows; @@ -1218,22 +1218,22 @@ typedef struct _tagMERGETABLE DWORD numtypes; LPWSTR *labels; DWORD numlabels; -} MERGETABLE; +};
-typedef struct _tagMERGEROW +struct merge_row { struct list entry; MSIRECORD *data; -} MERGEROW; +};
-typedef struct _tagMERGEDATA +struct merge_data { MSIDATABASE *db; MSIDATABASE *merge; - MERGETABLE *curtable; + struct merge_table *curtable; MSIQUERY *curview; struct list *tabledata; -} MERGEDATA; +};
static BOOL merge_type_match(LPCWSTR type1, LPCWSTR type2) { @@ -1462,9 +1462,9 @@ done:
static UINT merge_diff_row(MSIRECORD *rec, LPVOID param) { - MERGEDATA *data = param; - MERGETABLE *table = data->curtable; - MERGEROW *mergerow; + struct merge_data *data = param; + struct merge_table *table = data->curtable; + struct merge_row *mergerow; MSIQUERY *dbview = NULL; MSIRECORD *row = NULL; LPWSTR query = NULL; @@ -1496,7 +1496,7 @@ static UINT merge_diff_row(MSIRECORD *rec, LPVOID param) r = ERROR_SUCCESS; }
- mergerow = malloc(sizeof(MERGEROW)); + mergerow = malloc(sizeof(*mergerow)); if (!mergerow) { r = ERROR_OUTOFMEMORY; @@ -1606,13 +1606,13 @@ end: return r; }
-static void merge_free_rows(MERGETABLE *table) +static void merge_free_rows(struct merge_table *table) { struct list *item, *cursor;
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); msiobj_release(&row->data->hdr); @@ -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;
@@ -1654,13 +1654,13 @@ static void free_merge_table(MERGETABLE *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; - MERGETABLE *table; + struct merge_table *table; MSIQUERY *mergeview = NULL;
- table = calloc(1, sizeof(MERGETABLE)); + table = calloc(1, sizeof(*table)); if (!table) { *ptable = NULL; @@ -1701,8 +1701,8 @@ err:
static UINT merge_diff_tables(MSIRECORD *rec, LPVOID param) { - MERGEDATA *data = param; - MERGETABLE *table; + struct merge_data *data = param; + struct merge_table *table; MSIQUERY *dbview = NULL; MSIQUERY *mergeview = NULL; LPCWSTR name; @@ -1754,7 +1754,7 @@ static UINT gather_merge_data(MSIDATABASE *db, MSIDATABASE *merge, struct list *tabledata) { MSIQUERY *view; - MERGEDATA data; + struct merge_data data; UINT r;
r = MSI_DatabaseOpenViewW(merge, L"SELECT * FROM `_Tables`", &view); @@ -1769,10 +1769,10 @@ static UINT gather_merge_data(MSIDATABASE *db, MSIDATABASE *merge, return r; }
-static UINT merge_table(MSIDATABASE *db, MERGETABLE *table) +static UINT merge_table(MSIDATABASE *db, struct merge_table *table) { UINT r; - MERGEROW *row; + struct merge_row *row; MSIVIEW *tv;
if (!TABLE_Exists(db, table->name)) @@ -1782,7 +1782,7 @@ static UINT merge_table(MSIDATABASE *db, MERGETABLE *table) 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); if (r != ERROR_SUCCESS) @@ -1832,7 +1832,7 @@ UINT WINAPI MsiDatabaseMergeW( MSIHANDLE hDatabase, MSIHANDLE hDatabaseMerge, co struct list tabledata = LIST_INIT(tabledata); struct list *item, *cursor; MSIDATABASE *db, *merge; - MERGETABLE *table; + struct merge_table *table; BOOL conflicts; UINT r;
@@ -1854,7 +1854,7 @@ UINT WINAPI MsiDatabaseMergeW( MSIHANDLE hDatabase, MSIHANDLE hDatabaseMerge, co goto done;
conflicts = FALSE; - LIST_FOR_EACH_ENTRY(table, &tabledata, MERGETABLE, entry) + LIST_FOR_EACH_ENTRY(table, &tabledata, struct merge_table, entry) { if (table->numconflicts) { @@ -1875,7 +1875,7 @@ UINT WINAPI MsiDatabaseMergeW( MSIHANDLE hDatabase, MSIHANDLE hDatabaseMerge, co
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); free_merge_table(table); } diff --git a/dlls/msi/delete.c b/dlls/msi/delete.c index e0dafdd7068..1d80dce8d87 100644 --- a/dlls/msi/delete.c +++ b/dlls/msi/delete.c @@ -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. */
-typedef struct tagMSIDELETEVIEW +struct delete_view { MSIVIEW view; MSIDATABASE *db; MSIVIEW *table; -} MSIDELETEVIEW; +};
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 );
@@ -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) { - MSIDELETEVIEW *dv = (MSIDELETEVIEW*)view; + struct delete_view *dv = (struct delete_view *)view;
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
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;
TRACE("%p %p\n", dv, record); @@ -102,7 +102,7 @@ static UINT DELETE_execute( struct tagMSIVIEW *view, MSIRECORD *record )
static UINT DELETE_close( struct tagMSIVIEW *view ) { - MSIDELETEVIEW *dv = (MSIDELETEVIEW*)view; + struct delete_view *dv = (struct delete_view *)view;
TRACE("%p\n", dv );
@@ -114,7 +114,7 @@ static UINT DELETE_close( struct tagMSIVIEW *view )
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 );
@@ -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, 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 );
@@ -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, MSIRECORD *rec, UINT row ) { - MSIDELETEVIEW *dv = (MSIDELETEVIEW*)view; + struct delete_view *dv = (struct delete_view *)view;
TRACE("%p %d %p\n", dv, eModifyMode, rec );
@@ -152,7 +152,7 @@ static UINT DELETE_modify( struct tagMSIVIEW *view, MSIMODIFY eModifyMode,
static UINT DELETE_delete( struct tagMSIVIEW *view ) { - MSIDELETEVIEW *dv = (MSIDELETEVIEW*)view; + struct delete_view *dv = (struct delete_view *)view;
TRACE("%p\n", dv );
@@ -189,7 +189,7 @@ static const MSIVIEWOPS delete_ops =
UINT DELETE_CreateView( MSIDATABASE *db, MSIVIEW **view, MSIVIEW *table ) { - MSIDELETEVIEW *dv = NULL; + struct delete_view *dv = NULL;
TRACE("%p\n", dv );
diff --git a/dlls/msi/dialog.c b/dlls/msi/dialog.c index d7c9b088c24..91e7a567f55 100644 --- a/dlls/msi/dialog.c +++ b/dlls/msi/dialog.c @@ -49,19 +49,12 @@ WINE_DEFAULT_DEBUG_CHANNEL(msi);
extern HINSTANCE msi_hInstance;
-struct msi_control_tag; -typedef struct msi_control_tag msi_control; -typedef UINT (*msi_handler)( msi_dialog *, msi_control *, WPARAM ); -typedef void (*msi_update)( msi_dialog *, msi_control * ); -typedef UINT (*control_event_handler)( msi_dialog *, const WCHAR *, const WCHAR * ); -typedef UINT (*event_handler)( msi_dialog *, const WCHAR * ); - -struct msi_control_tag +struct control { struct list entry; HWND hwnd; - msi_handler handler; - msi_update update; + UINT (*handler)( msi_dialog *, struct control *, WPARAM ); + void (*update)( msi_dialog *, struct control * ); LPWSTR property; LPWSTR value; HBITMAP hBitmap; @@ -77,19 +70,19 @@ struct msi_control_tag WCHAR name[1]; };
-typedef struct msi_font_tag +struct font { struct list entry; HFONT hfont; COLORREF color; WCHAR name[1]; -} msi_font; +};
struct msi_dialog_tag { MSIPACKAGE *package; msi_dialog *parent; - control_event_handler event_handler; + UINT (*event_handler)( msi_dialog *, const WCHAR *, const WCHAR * ); BOOL finished; INT scale; DWORD attributes; @@ -101,7 +94,7 @@ struct msi_dialog_tag HWND hWndFocus; LPWSTR control_default; LPWSTR control_cancel; - event_handler pending_event; + UINT (*pending_event)( msi_dialog *, const WCHAR * ); LPWSTR pending_argument; INT retval; WCHAR name[1]; @@ -116,19 +109,18 @@ struct subscriber WCHAR *attribute; };
-typedef UINT (*msi_dialog_control_func)( msi_dialog *dialog, MSIRECORD *rec ); struct control_handler { LPCWSTR control_type; - msi_dialog_control_func func; + UINT (*func)( msi_dialog *dialog, MSIRECORD *rec ); };
-typedef struct +struct radio_button_group_descr { - msi_dialog* dialog; - msi_control *parent; - LPWSTR propval; -} radio_button_group_descr; + msi_dialog *dialog; + struct control *parent; + WCHAR *propval; +};
/* dialog sequencing */
@@ -167,41 +159,41 @@ static INT dialog_scale_unit( msi_dialog *dialog, INT val ) return MulDiv( val, dialog->scale, 12 ); }
-static msi_control *dialog_find_control( msi_dialog *dialog, LPCWSTR name ) +static struct control *dialog_find_control( msi_dialog *dialog, const WCHAR *name ) { - msi_control *control; + struct control *control;
if( !name ) return NULL; if( !dialog->hwnd ) return NULL; - LIST_FOR_EACH_ENTRY( control, &dialog->controls, msi_control, entry ) + LIST_FOR_EACH_ENTRY( control, &dialog->controls, struct control, entry ) if( !wcscmp( control->name, name ) ) /* FIXME: case sensitive? */ return control; return NULL; }
-static msi_control *dialog_find_control_by_type( msi_dialog *dialog, LPCWSTR type ) +static struct control *dialog_find_control_by_type( msi_dialog *dialog, const WCHAR *type ) { - msi_control *control; + struct control *control;
if( !type ) return NULL; if( !dialog->hwnd ) return NULL; - LIST_FOR_EACH_ENTRY( control, &dialog->controls, msi_control, entry ) + LIST_FOR_EACH_ENTRY( control, &dialog->controls, struct control, entry ) if( !wcscmp( control->type, type ) ) /* FIXME: case sensitive? */ return control; return NULL; }
-static msi_control *dialog_find_control_by_hwnd( msi_dialog *dialog, HWND hwnd ) +static struct control *dialog_find_control_by_hwnd( msi_dialog *dialog, HWND hwnd ) { - msi_control *control; + struct control *control;
if( !dialog->hwnd ) return NULL; - LIST_FOR_EACH_ENTRY( control, &dialog->controls, msi_control, entry ) + LIST_FOR_EACH_ENTRY( control, &dialog->controls, struct control, entry ) if( hwnd == control->hwnd ) return control; return NULL; @@ -279,7 +271,7 @@ static WCHAR *dialog_get_style( const WCHAR *p, const WCHAR **rest ) static UINT dialog_add_font( MSIRECORD *rec, void *param ) { msi_dialog *dialog = param; - msi_font *font; + struct font *font; LPCWSTR face, name; LOGFONTW lf; INT style; @@ -287,7 +279,7 @@ static UINT dialog_add_font( MSIRECORD *rec, void *param )
/* create a font and add it to the list */ name = MSI_RecordGetString( rec, 1 ); - font = malloc( offsetof( msi_font, name[wcslen( name ) + 1] ) ); + font = malloc( offsetof( struct font, name[wcslen( name ) + 1] ) ); lstrcpyW( font->name, name ); list_add_head( &dialog->fonts, &font->entry );
@@ -322,11 +314,11 @@ static UINT dialog_add_font( MSIRECORD *rec, void *param ) return ERROR_SUCCESS; }
-static msi_font *dialog_find_font( msi_dialog *dialog, const WCHAR *name ) +static struct font *dialog_find_font( msi_dialog *dialog, const WCHAR *name ) { - msi_font *font = NULL; + struct font *font = NULL;
- LIST_FOR_EACH_ENTRY( font, &dialog->fonts, msi_font, entry ) + LIST_FOR_EACH_ENTRY( font, &dialog->fonts, struct font, entry ) if( !wcscmp( font->name, name ) ) /* FIXME: case sensitive? */ break;
@@ -335,7 +327,7 @@ static msi_font *dialog_find_font( msi_dialog *dialog, const WCHAR *name )
static UINT dialog_set_font( msi_dialog *dialog, HWND hwnd, const WCHAR *name ) { - msi_font *font; + struct font *font;
font = dialog_find_font( dialog, name ); if( font ) @@ -361,7 +353,7 @@ static UINT dialog_build_font_list( msi_dialog *dialog ) return r; }
-static void destroy_control( msi_control *t ) +static void destroy_control( struct control *t ) { list_remove( &t->entry ); /* leave dialog->hwnd - destroying parent destroys child windows */ @@ -380,18 +372,18 @@ static void destroy_control( msi_control *t ) free( t ); }
-static msi_control *dialog_create_window( msi_dialog *dialog, MSIRECORD *rec, DWORD exstyle, - const WCHAR *szCls, const WCHAR *name, const WCHAR *text, - DWORD style, HWND parent ) +static struct control *dialog_create_window( msi_dialog *dialog, MSIRECORD *rec, DWORD exstyle, + const WCHAR *szCls, const WCHAR *name, const WCHAR *text, + DWORD style, HWND parent ) { DWORD x, y, width, height; LPWSTR font = NULL, title_font = NULL; LPCWSTR title = NULL; - msi_control *control; + struct control *control;
style |= WS_CHILD;
- control = malloc( offsetof( msi_control, name[wcslen( name ) + 1] ) ); + control = malloc( offsetof( struct control, name[wcslen( name ) + 1] ) ); if (!control) return NULL;
@@ -505,9 +497,9 @@ static HICON load_icon( MSIDATABASE *db, const WCHAR *text, UINT attributes )
static void dialog_update_controls( msi_dialog *dialog, const WCHAR *property ) { - msi_control *control; + struct control *control;
- LIST_FOR_EACH_ENTRY( control, &dialog->controls, msi_control, entry ) + LIST_FOR_EACH_ENTRY( control, &dialog->controls, struct control, entry ) { if ( control->property && !wcscmp( control->property, property ) && control->update ) control->update( dialog, control ); @@ -516,9 +508,9 @@ static void dialog_update_controls( msi_dialog *dialog, const WCHAR *property )
static void dialog_update_all_controls( msi_dialog *dialog ) { - msi_control *control; + struct control *control;
- LIST_FOR_EACH_ENTRY( control, &dialog->controls, msi_control, entry ) + LIST_FOR_EACH_ENTRY( control, &dialog->controls, struct control, entry ) { if ( control->property && control->update ) control->update( dialog, control ); @@ -552,7 +544,7 @@ struct msi_selection_tree_info HTREEITEM selected; };
-static MSIFEATURE *seltree_get_selected_feature( msi_control *control ) +static MSIFEATURE *seltree_get_selected_feature( struct control *control ) { struct msi_selection_tree_info *info = GetPropW( control->hwnd, L"MSIDATA" ); return seltree_feature_from_item( control->hwnd, info->selected ); @@ -560,7 +552,7 @@ static MSIFEATURE *seltree_get_selected_feature( msi_control *control )
static void dialog_handle_event( msi_dialog *dialog, const WCHAR *control, const WCHAR *attribute, MSIRECORD *rec ) { - msi_control* ctrl; + struct control* ctrl;
ctrl = dialog_find_control( dialog, control ); if (!ctrl) @@ -718,7 +710,7 @@ static void dialog_map_events( msi_dialog *dialog, const WCHAR *control ) }
/* everything except radio buttons */ -static msi_control *dialog_add_control( msi_dialog *dialog, MSIRECORD *rec, const WCHAR *szCls, DWORD style ) +static struct control *dialog_add_control( msi_dialog *dialog, MSIRECORD *rec, const WCHAR *szCls, DWORD style ) { DWORD attributes; const WCHAR *text = NULL, *name, *control_type; @@ -745,7 +737,7 @@ static msi_control *dialog_add_control( msi_dialog *dialog, MSIRECORD *rec, cons
struct msi_text_info { - msi_font *font; + struct font *font; WNDPROC oldproc; DWORD attributes; }; @@ -801,7 +793,7 @@ static LRESULT WINAPI MSIText_WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM
static UINT dialog_text_control( msi_dialog *dialog, MSIRECORD *rec ) { - msi_control *control; + struct control *control; struct msi_text_info *info; LPCWSTR text, ptr, prop, control_name; LPWSTR font_name; @@ -918,7 +910,7 @@ static UINT dialog_control_event( MSIRECORD *rec, void *param ) return ERROR_SUCCESS; }
-static UINT dialog_button_handler( msi_dialog *dialog, msi_control *control, WPARAM param ) +static UINT dialog_button_handler( msi_dialog *dialog, struct control *control, WPARAM param ) { MSIQUERY *view; UINT r; @@ -1015,7 +1007,7 @@ end:
static UINT dialog_button_control( msi_dialog *dialog, MSIRECORD *rec ) { - msi_control *control; + struct control *control; UINT attributes, style, cx = 0, cy = 0, flags = 0; WCHAR *name = NULL;
@@ -1096,7 +1088,7 @@ static WCHAR *get_checkbox_value( msi_dialog *dialog, const WCHAR *prop ) return ret; }
-static UINT dialog_get_checkbox_state( msi_dialog *dialog, msi_control *control ) +static UINT dialog_get_checkbox_state( msi_dialog *dialog, struct control *control ) { WCHAR state[2] = {0}; DWORD sz = 2; @@ -1105,7 +1097,7 @@ static UINT dialog_get_checkbox_state( msi_dialog *dialog, msi_control *control return state[0] ? 1 : 0; }
-static void dialog_set_checkbox_state( msi_dialog *dialog, msi_control *control, UINT state ) +static void dialog_set_checkbox_state( msi_dialog *dialog, struct control *control, UINT state ) { LPCWSTR val;
@@ -1125,13 +1117,13 @@ static void dialog_set_checkbox_state( msi_dialog *dialog, msi_control *control, dialog_set_property( dialog->package, control->property, val ); }
-static void dialog_checkbox_sync_state( msi_dialog *dialog, msi_control *control ) +static void dialog_checkbox_sync_state( msi_dialog *dialog, struct control *control ) { UINT state = dialog_get_checkbox_state( dialog, control ); SendMessageW( control->hwnd, BM_SETCHECK, state ? BST_CHECKED : BST_UNCHECKED, 0 ); }
-static UINT dialog_checkbox_handler( msi_dialog *dialog, msi_control *control, WPARAM param ) +static UINT dialog_checkbox_handler( msi_dialog *dialog, struct control *control, WPARAM param ) { UINT state;
@@ -1150,7 +1142,7 @@ static UINT dialog_checkbox_handler( msi_dialog *dialog, msi_control *control, W
static UINT dialog_checkbox_control( msi_dialog *dialog, MSIRECORD *rec ) { - msi_control *control; + struct control *control; LPCWSTR prop;
TRACE("%p %p\n", dialog, rec); @@ -1175,7 +1167,7 @@ static UINT dialog_line_control( msi_dialog *dialog, MSIRECORD *rec ) LPCWSTR name; DWORD style, exstyle = 0; DWORD x, y, width, height; - msi_control *control; + struct control *control;
TRACE("%p %p\n", dialog, rec);
@@ -1193,7 +1185,7 @@ static UINT dialog_line_control( msi_dialog *dialog, MSIRECORD *rec )
dialog_map_events( dialog, name );
- control = malloc( offsetof( msi_control, name[wcslen( name ) + 1] ) ); + control = malloc( offsetof( struct control, name[wcslen( name ) + 1] ) ); if (!control) return ERROR_OUTOFMEMORY;
@@ -1234,7 +1226,7 @@ static UINT dialog_line_control( msi_dialog *dialog, MSIRECORD *rec ) struct msi_scrolltext_info { msi_dialog *dialog; - msi_control *control; + struct control *control; WNDPROC oldproc; };
@@ -1287,7 +1279,7 @@ static DWORD CALLBACK richedit_stream_in( DWORD_PTR arg, BYTE *buffer, LONG coun return 0; }
-static void scrolltext_add_text( msi_control *control, const WCHAR *text ) +static void scrolltext_add_text( struct control *control, const WCHAR *text ) { struct msi_streamin_info info; EDITSTREAM es; @@ -1308,7 +1300,7 @@ static void scrolltext_add_text( msi_control *control, const WCHAR *text ) static UINT dialog_scrolltext_control( msi_dialog *dialog, MSIRECORD *rec ) { struct msi_scrolltext_info *info; - msi_control *control; + struct control *control; HMODULE hRichedit; LPCWSTR text; DWORD style; @@ -1351,7 +1343,7 @@ static UINT dialog_scrolltext_control( msi_dialog *dialog, MSIRECORD *rec ) static UINT dialog_bitmap_control( msi_dialog *dialog, MSIRECORD *rec ) { UINT cx, cy, flags, style, attributes; - msi_control *control; + struct control *control; LPWSTR name;
flags = LR_LOADFROMFILE; @@ -1385,7 +1377,7 @@ static UINT dialog_bitmap_control( msi_dialog *dialog, MSIRECORD *rec )
static UINT dialog_icon_control( msi_dialog *dialog, MSIRECORD *rec ) { - msi_control *control; + struct control *control; DWORD attributes; LPWSTR name;
@@ -1492,7 +1484,7 @@ static UINT combobox_add_items( struct msi_combobox_info *info, const WCHAR *pro static UINT dialog_set_control_condition( MSIRECORD *rec, void *param ) { msi_dialog *dialog = param; - msi_control *control; + struct control *control; LPCWSTR name, action, condition; UINT r;
@@ -1540,7 +1532,7 @@ static UINT dialog_evaluate_control_conditions( msi_dialog *dialog ) return r; }
-static UINT dialog_combobox_handler( msi_dialog *dialog, msi_control *control, WPARAM param ) +static UINT dialog_combobox_handler( msi_dialog *dialog, struct control *control, WPARAM param ) { struct msi_combobox_info *info; int index; @@ -1565,7 +1557,7 @@ static UINT dialog_combobox_handler( msi_dialog *dialog, msi_control *control, W return ERROR_SUCCESS; }
-static void dialog_combobox_update( msi_dialog *dialog, msi_control *control ) +static void dialog_combobox_update( msi_dialog *dialog, struct control *control ) { struct msi_combobox_info *info; LPWSTR value, tmp; @@ -1603,7 +1595,7 @@ static void dialog_combobox_update( msi_dialog *dialog, msi_control *control ) static UINT dialog_combo_control( msi_dialog *dialog, MSIRECORD *rec ) { struct msi_combobox_info *info; - msi_control *control; + struct control *control; DWORD attributes, style; LPCWSTR prop;
@@ -1650,7 +1642,7 @@ static UINT dialog_combo_control( msi_dialog *dialog, MSIRECORD *rec ) return ERROR_SUCCESS; }
-static UINT dialog_edit_handler( msi_dialog *dialog, msi_control *control, WPARAM param ) +static UINT dialog_edit_handler( msi_dialog *dialog, struct control *control, WPARAM param ) { LPWSTR buf;
@@ -1671,7 +1663,7 @@ static UINT dialog_edit_handler( msi_dialog *dialog, msi_control *control, WPARA
static UINT dialog_edit_control( msi_dialog *dialog, MSIRECORD *rec ) { - msi_control *control; + struct control *control; LPCWSTR prop, text; LPWSTR val, begin, end; WCHAR num[MAX_NUM_DIGITS]; @@ -1984,7 +1976,7 @@ static UINT dialog_maskedit_control( msi_dialog *dialog, MSIRECORD *rec ) LPWSTR font_mask, val = NULL, font; struct msi_maskedit_info *info = NULL; UINT ret = ERROR_SUCCESS; - msi_control *control; + struct control *control; LPCWSTR prop, mask;
TRACE("\n"); @@ -2050,7 +2042,7 @@ end:
static UINT dialog_progress_bar( msi_dialog *dialog, MSIRECORD *rec ) { - msi_control *control; + struct control *control; DWORD attributes, style;
style = WS_VISIBLE; @@ -2071,11 +2063,11 @@ static UINT dialog_progress_bar( msi_dialog *dialog, MSIRECORD *rec ) struct msi_pathedit_info { msi_dialog *dialog; - msi_control *control; + struct control *control; WNDPROC oldproc; };
-static WCHAR *get_path_property( msi_dialog *dialog, msi_control *control ) +static WCHAR *get_path_property( msi_dialog *dialog, struct control *control ) { WCHAR *prop, *path; BOOL indirect = control->attributes & msidbControlAttributesIndirect; @@ -2085,7 +2077,7 @@ static WCHAR *get_path_property( msi_dialog *dialog, msi_control *control ) return path; }
-static void dialog_update_pathedit( msi_dialog *dialog, msi_control *control ) +static void dialog_update_pathedit( msi_dialog *dialog, struct control *control ) { WCHAR *path;
@@ -2111,7 +2103,7 @@ static BOOL dialog_verify_path( const WCHAR *path ) }
/* returns TRUE if the path is valid, FALSE otherwise */ -static BOOL dialog_onkillfocus( msi_dialog *dialog, msi_control *control ) +static BOOL dialog_onkillfocus( msi_dialog *dialog, struct control *control ) { LPWSTR buf, prop; BOOL indirect; @@ -2174,7 +2166,7 @@ static LRESULT WINAPI MSIPathEdit_WndProc(HWND hWnd, UINT msg, WPARAM wParam, LP static UINT dialog_pathedit_control( msi_dialog *dialog, MSIRECORD *rec ) { struct msi_pathedit_info *info; - msi_control *control; + struct control *control; LPCWSTR prop;
info = malloc( sizeof *info ); @@ -2198,7 +2190,7 @@ static UINT dialog_pathedit_control( msi_dialog *dialog, MSIRECORD *rec ) return ERROR_SUCCESS; }
-static UINT dialog_radiogroup_handler( msi_dialog *dialog, msi_control *control, WPARAM param ) +static UINT dialog_radiogroup_handler( msi_dialog *dialog, struct control *control, WPARAM param ) { if (HIWORD(param) != BN_CLICKED) return ERROR_SUCCESS; @@ -2213,9 +2205,9 @@ static UINT dialog_radiogroup_handler( msi_dialog *dialog, msi_control *control, /* radio buttons are a bit different from normal controls */ static UINT dialog_create_radiobutton( MSIRECORD *rec, void *param ) { - radio_button_group_descr *group = param; + struct radio_button_group_descr *group = param; msi_dialog *dialog = group->dialog; - msi_control *control; + struct control *control; LPCWSTR prop, text, name; DWORD style = WS_CHILD | WS_VISIBLE | WS_TABSTOP | BS_AUTORADIOBUTTON | BS_MULTILINE;
@@ -2267,9 +2259,9 @@ static UINT dialog_radiogroup_control( msi_dialog *dialog, MSIRECORD *rec ) { UINT r; LPCWSTR prop; - msi_control *control; + struct control *control; MSIQUERY *view; - radio_button_group_descr group; + struct radio_button_group_descr group; MSIPACKAGE *package = dialog->package; WNDPROC oldproc; DWORD attr, style = WS_GROUP; @@ -2558,7 +2550,7 @@ static void seltree_create_imagelist( HWND hwnd ) SendMessageW( hwnd, TVM_SETIMAGELIST, TVSIL_STATE, (LPARAM)himl ); }
-static UINT dialog_seltree_handler( msi_dialog *dialog, msi_control *control, WPARAM param ) +static UINT dialog_seltree_handler( msi_dialog *dialog, struct control *control, WPARAM param ) { struct msi_selection_tree_info *info = GetPropW( control->hwnd, L"MSIDATA" ); LPNMTREEVIEWW tv = (LPNMTREEVIEWW)param; @@ -2616,7 +2608,7 @@ done:
static UINT dialog_selection_tree( msi_dialog *dialog, MSIRECORD *rec ) { - msi_control *control; + struct control *control; LPCWSTR prop, control_name; MSIPACKAGE *package = dialog->package; DWORD style; @@ -2662,7 +2654,7 @@ static UINT dialog_selection_tree( msi_dialog *dialog, MSIRECORD *rec )
static UINT dialog_group_box( msi_dialog *dialog, MSIRECORD *rec ) { - msi_control *control; + struct control *control; DWORD style;
style = BS_GROUPBOX | WS_CHILD | WS_GROUP; @@ -2757,7 +2749,7 @@ static UINT listbox_add_items( struct msi_listbox_info *info, const WCHAR *prope return r; }
-static UINT dialog_listbox_handler( msi_dialog *dialog, msi_control *control, WPARAM param ) +static UINT dialog_listbox_handler( msi_dialog *dialog, struct control *control, WPARAM param ) { struct msi_listbox_info *info; int index; @@ -2779,7 +2771,7 @@ static UINT dialog_listbox_handler( msi_dialog *dialog, msi_control *control, WP static UINT dialog_list_box( msi_dialog *dialog, MSIRECORD *rec ) { struct msi_listbox_info *info; - msi_control *control; + struct control *control; DWORD attributes, style; LPCWSTR prop;
@@ -2821,7 +2813,7 @@ static UINT dialog_list_box( msi_dialog *dialog, MSIRECORD *rec )
/******************** Directory Combo ***************************************/
-static void dialog_update_directory_combo( msi_dialog *dialog, msi_control *control ) +static void dialog_update_directory_combo( msi_dialog *dialog, struct control *control ) { WCHAR *path;
@@ -2840,7 +2832,7 @@ static void dialog_update_directory_combo( msi_dialog *dialog, msi_control *cont
static UINT dialog_directory_combo( msi_dialog *dialog, MSIRECORD *rec ) { - msi_control *control; + struct control *control; LPCWSTR prop; DWORD style;
@@ -2862,7 +2854,7 @@ static UINT dialog_directory_combo( msi_dialog *dialog, MSIRECORD *rec )
/******************** Directory List ***************************************/
-static void dialog_update_directory_list( msi_dialog *dialog, msi_control *control ) +static void dialog_update_directory_list( msi_dialog *dialog, struct control *control ) { WCHAR dir_spec[MAX_PATH], *path; WIN32_FIND_DATAW wfd; @@ -2909,7 +2901,7 @@ static void dialog_update_directory_list( msi_dialog *dialog, msi_control *contr
static UINT dialog_directorylist_up( msi_dialog *dialog ) { - msi_control *control; + struct control *control; LPWSTR prop, path, ptr; BOOL indirect;
@@ -2965,7 +2957,7 @@ static WCHAR *get_unique_folder_name( const WCHAR *root, int *ret_len )
static UINT dialog_directorylist_new( msi_dialog *dialog ) { - msi_control *control; + struct control *control; WCHAR *path; LVITEMW item; int index; @@ -2988,7 +2980,7 @@ static UINT dialog_directorylist_new( msi_dialog *dialog ) return ERROR_SUCCESS; }
-static UINT dialog_dirlist_handler( msi_dialog *dialog, msi_control *control, WPARAM param ) +static UINT dialog_dirlist_handler( msi_dialog *dialog, struct control *control, WPARAM param ) { NMHDR *nmhdr = (NMHDR *)param; WCHAR text[MAX_PATH], *new_path, *path, *prop; @@ -3055,7 +3047,7 @@ static UINT dialog_dirlist_handler( msi_dialog *dialog, msi_control *control, WP
static UINT dialog_directory_list( msi_dialog *dialog, MSIRECORD *rec ) { - msi_control *control; + struct control *control; LPCWSTR prop; DWORD style;
@@ -3102,7 +3094,7 @@ static const WCHAR column_keys[][80] = L"VolumeCostDifference", };
-static void dialog_vcl_add_columns( msi_dialog *dialog, msi_control *control, MSIRECORD *rec ) +static void dialog_vcl_add_columns( msi_dialog *dialog, struct control *control, MSIRECORD *rec ) { LPCWSTR text = MSI_RecordGetString( rec, 10 ); LPCWSTR begin = text, end; @@ -3175,7 +3167,7 @@ static LONGLONG vcl_get_cost( msi_dialog *dialog ) return total_cost; }
-static void dialog_vcl_add_drives( msi_dialog *dialog, msi_control *control ) +static void dialog_vcl_add_drives( msi_dialog *dialog, struct control *control ) { ULARGE_INTEGER total, unused; LONGLONG difference, cost; @@ -3249,7 +3241,7 @@ static void dialog_vcl_add_drives( msi_dialog *dialog, msi_control *control )
static UINT dialog_volumecost_list( msi_dialog *dialog, MSIRECORD *rec ) { - msi_control *control; + struct control *control; DWORD style;
style = LVS_REPORT | WS_VSCROLL | WS_HSCROLL | LVS_SHAREIMAGELISTS | @@ -3267,7 +3259,7 @@ static UINT dialog_volumecost_list( msi_dialog *dialog, MSIRECORD *rec )
/******************** VolumeSelect Combo ***************************************/
-static UINT dialog_volsel_handler( msi_dialog *dialog, msi_control *control, WPARAM param ) +static UINT dialog_volsel_handler( msi_dialog *dialog, struct control *control, WPARAM param ) { WCHAR text[MAX_PATH]; LPWSTR prop; @@ -3295,7 +3287,7 @@ static UINT dialog_volsel_handler( msi_dialog *dialog, msi_control *control, WPA return ERROR_SUCCESS; }
-static void dialog_vsc_add_drives( msi_dialog *dialog, msi_control *control ) +static void dialog_vsc_add_drives( msi_dialog *dialog, struct control *control ) { LPWSTR drives, ptr; DWORD size; @@ -3320,7 +3312,7 @@ static void dialog_vsc_add_drives( msi_dialog *dialog, msi_control *control )
static UINT dialog_volumeselect_combo( msi_dialog *dialog, MSIRECORD *rec ) { - msi_control *control; + struct control *control; LPCWSTR prop; DWORD style;
@@ -3342,7 +3334,7 @@ static UINT dialog_volumeselect_combo( msi_dialog *dialog, MSIRECORD *rec ) return ERROR_SUCCESS; }
-static UINT dialog_hyperlink_handler( msi_dialog *dialog, msi_control *control, WPARAM param ) +static UINT dialog_hyperlink_handler( msi_dialog *dialog, struct control *control, WPARAM param ) { int len, len_href = ARRAY_SIZE( L"href" ) - 1; const WCHAR *p, *q; @@ -3389,7 +3381,7 @@ static UINT dialog_hyperlink_handler( msi_dialog *dialog, msi_control *control,
static UINT dialog_hyperlink( msi_dialog *dialog, MSIRECORD *rec ) { - msi_control *control; + struct control *control; DWORD style = WS_CHILD | WS_TABSTOP | WS_GROUP; const WCHAR *text = MSI_RecordGetString( rec, 10 ); int len = lstrlenW( text ); @@ -3419,10 +3411,10 @@ static UINT dialog_hyperlink( msi_dialog *dialog, MSIRECORD *rec ) struct listview_param { msi_dialog *dialog; - msi_control *control; + struct control *control; };
-static UINT dialog_listview_handler( msi_dialog *dialog, msi_control *control, WPARAM param ) +static UINT dialog_listview_handler( msi_dialog *dialog, struct control *control, WPARAM param ) { NMHDR *nmhdr = (NMHDR *)param;
@@ -3456,7 +3448,7 @@ static UINT listview_add_item( MSIRECORD *rec, void *param ) return ERROR_SUCCESS; }
-static UINT listview_add_items( msi_dialog *dialog, msi_control *control ) +static UINT listview_add_items( msi_dialog *dialog, struct control *control ) { MSIQUERY *view; struct listview_param lv_param = { dialog, control }; @@ -3473,7 +3465,7 @@ static UINT listview_add_items( msi_dialog *dialog, msi_control *control )
static UINT dialog_listview( msi_dialog *dialog, MSIRECORD *rec ) { - msi_control *control; + struct control *control; LPCWSTR prop; DWORD style, attributes; LVCOLUMNW col; @@ -3683,7 +3675,7 @@ static void dialog_adjust_dialog_pos( msi_dialog *dialog, MSIRECORD *rec, RECT * static void dialog_set_tab_order( msi_dialog *dialog, const WCHAR *first ) { struct list tab_chain; - msi_control *control; + struct control *control; HWND prev = HWND_TOP;
list_init( &tab_chain ); @@ -3698,7 +3690,7 @@ static void dialog_set_tab_order( msi_dialog *dialog, const WCHAR *first ) control = dialog_find_control( dialog, control->tabnext ); }
- LIST_FOR_EACH_ENTRY( control, &tab_chain, msi_control, entry ) + LIST_FOR_EACH_ENTRY( control, &tab_chain, struct control, entry ) { SetWindowPos( control->hwnd, prev, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOOWNERZORDER | SWP_NOREDRAW | @@ -3765,7 +3757,7 @@ static LRESULT dialog_oncreate( HWND hwnd, CREATESTRUCTW *cs )
static LRESULT dialog_oncommand( msi_dialog *dialog, WPARAM param, HWND hwnd ) { - msi_control *control = NULL; + struct control *control = NULL;
TRACE( "%p, %#Ix, %p\n", dialog, param, hwnd );
@@ -3796,7 +3788,7 @@ static LRESULT dialog_oncommand( msi_dialog *dialog, WPARAM param, HWND hwnd ) static LRESULT dialog_onnotify( msi_dialog *dialog, LPARAM param ) { LPNMHDR nmhdr = (LPNMHDR) param; - msi_control *control = dialog_find_control_by_hwnd( dialog, nmhdr->hwndFrom ); + struct control *control = dialog_find_control_by_hwnd( dialog, nmhdr->hwndFrom );
TRACE("%p %p\n", dialog, nmhdr->hwndFrom);
@@ -3970,7 +3962,7 @@ static BOOL dialog_register_class( void ) }
static msi_dialog *dialog_create( MSIPACKAGE *package, const WCHAR *name, msi_dialog *parent, - control_event_handler event_handler ) + UINT (*event_handler)(msi_dialog *, const WCHAR *, const WCHAR *) ) { MSIRECORD *rec = NULL; msi_dialog *dialog; @@ -4094,7 +4086,7 @@ static void event_cleanup_subscriptions( MSIPACKAGE *package, const WCHAR *dialo
void msi_dialog_destroy( msi_dialog *dialog ) { - msi_font *font, *next; + struct font *font, *next;
if( uiThreadId != GetCurrentThreadId() ) { @@ -4114,15 +4106,14 @@ void msi_dialog_destroy( msi_dialog *dialog ) /* destroy the list of controls */ while( !list_empty( &dialog->controls ) ) { - msi_control *t; + struct control *t;
- t = LIST_ENTRY( list_head( &dialog->controls ), - msi_control, entry ); + t = LIST_ENTRY( list_head( &dialog->controls ), struct control, entry ); destroy_control( t ); }
/* destroy the list of fonts */ - LIST_FOR_EACH_ENTRY_SAFE( font, next, &dialog->fonts, msi_font, entry ) + LIST_FOR_EACH_ENTRY_SAFE( font, next, &dialog->fonts, struct font, entry ) { list_remove( &font->entry ); DeleteObject( font->hfont ); @@ -4282,7 +4273,7 @@ UINT WINAPI MsiPreviewBillboardA( MSIHANDLE hPreview, const char *szControlName, struct control_event { const WCHAR *event; - event_handler handler; + UINT (*handler)( msi_dialog *, const WCHAR * ); };
static UINT dialog_event_handler( msi_dialog *, const WCHAR *, const WCHAR * ); diff --git a/dlls/msi/distinct.c b/dlls/msi/distinct.c index 23e74e17edc..d1b99f9ca64 100644 --- a/dlls/msi/distinct.c +++ b/dlls/msi/distinct.c @@ -35,25 +35,25 @@
WINE_DEFAULT_DEBUG_CHANNEL(msidb);
-typedef struct tagDISTINCTSET +struct distinct_set { UINT val; UINT count; UINT row; - struct tagDISTINCTSET *nextrow; - struct tagDISTINCTSET *nextcol; -} DISTINCTSET; + struct distinct_set *nextrow; + struct distinct_set *nextcol; +};
-typedef struct tagMSIDISTINCTVIEW +struct distinct_view { MSIVIEW view; MSIDATABASE *db; MSIVIEW *table; UINT row_count; 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 */ while( *x ) @@ -67,7 +67,7 @@ static DISTINCTSET ** distinct_insert( DISTINCTSET **x, UINT val, UINT row ) }
/* nothing found, so add one */ - *x = malloc( sizeof(DISTINCTSET) ); + *x = malloc( sizeof(**x) ); if( *x ) { (*x)->val = val; @@ -79,11 +79,11 @@ static DISTINCTSET ** distinct_insert( DISTINCTSET **x, UINT val, UINT row ) return x; }
-static void distinct_free( DISTINCTSET *x ) +static void distinct_free( struct distinct_set *x ) { while( x ) { - DISTINCTSET *next = x->nextrow; + struct distinct_set *next = x->nextrow; distinct_free( x->nextcol ); free( x ); x = next; @@ -92,7 +92,7 @@ static void distinct_free( DISTINCTSET *x )
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 );
@@ -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 ) { - MSIDISTINCTVIEW *dv = (MSIDISTINCTVIEW*)view; + struct distinct_view *dv = (struct distinct_view *)view; UINT r, i, j, r_count, c_count; - DISTINCTSET *rowset = NULL; + struct distinct_set *rowset = NULL;
TRACE("%p %p\n", dv, record);
@@ -133,7 +133,7 @@ static UINT DISTINCT_execute( struct tagMSIVIEW *view, MSIRECORD *record ) /* build it */ for( i=0; i<r_count; i++ ) { - DISTINCTSET **x = &rowset; + struct distinct_set **x = &rowset;
for( j=1; j<=c_count; j++ ) { @@ -171,7 +171,7 @@ static UINT DISTINCT_execute( struct tagMSIVIEW *view, MSIRECORD *record )
static UINT DISTINCT_close( struct tagMSIVIEW *view ) { - MSIDISTINCTVIEW *dv = (MSIDISTINCTVIEW*)view; + struct distinct_view *dv = (struct distinct_view *)view;
TRACE("%p\n", dv );
@@ -187,7 +187,7 @@ static UINT DISTINCT_close( struct tagMSIVIEW *view )
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 );
@@ -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, 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 );
@@ -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, MSIRECORD *rec, UINT row ) { - MSIDISTINCTVIEW *dv = (MSIDISTINCTVIEW*)view; + struct distinct_view *dv = (struct distinct_view *)view;
TRACE("%p %d %p\n", dv, eModifyMode, rec );
@@ -233,7 +233,7 @@ static UINT DISTINCT_modify( struct tagMSIVIEW *view, MSIMODIFY eModifyMode,
static UINT DISTINCT_delete( struct tagMSIVIEW *view ) { - MSIDISTINCTVIEW *dv = (MSIDISTINCTVIEW*)view; + struct distinct_view *dv = (struct distinct_view *)view;
TRACE("%p\n", dv );
@@ -272,7 +272,7 @@ static const MSIVIEWOPS distinct_ops =
UINT DISTINCT_CreateView( MSIDATABASE *db, MSIVIEW **view, MSIVIEW *table ) { - MSIDISTINCTVIEW *dv = NULL; + struct distinct_view *dv = NULL; UINT count = 0, r;
TRACE("%p\n", dv ); diff --git a/dlls/msi/drop.c b/dlls/msi/drop.c index 9c3aebba0eb..9c7fc0ca0ea 100644 --- a/dlls/msi/drop.c +++ b/dlls/msi/drop.c @@ -34,18 +34,18 @@
WINE_DEFAULT_DEBUG_CHANNEL(msidb);
-typedef struct tagMSIDROPVIEW +struct drop_view { MSIVIEW view; MSIDATABASE *db; MSIVIEW *table; column_info *colinfo; INT hold; -} MSIDROPVIEW; +};
static UINT DROP_execute(struct tagMSIVIEW *view, MSIRECORD *record) { - MSIDROPVIEW *dv = (MSIDROPVIEW*)view; + struct drop_view *dv = (struct drop_view *)view; UINT r;
TRACE("%p %p\n", dv, record); @@ -62,7 +62,7 @@ static UINT DROP_execute(struct tagMSIVIEW *view, MSIRECORD *record)
static UINT DROP_close(struct tagMSIVIEW *view) { - MSIDROPVIEW *dv = (MSIDROPVIEW*)view; + struct drop_view *dv = (struct drop_view *)view;
TRACE("%p\n", dv);
@@ -71,7 +71,7 @@ static UINT DROP_close(struct tagMSIVIEW *view)
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);
@@ -80,7 +80,7 @@ static UINT DROP_get_dimensions(struct tagMSIVIEW *view, UINT *rows, UINT *cols)
static UINT DROP_delete( struct tagMSIVIEW *view ) { - MSIDROPVIEW *dv = (MSIDROPVIEW*)view; + struct drop_view *dv = (struct drop_view *)view;
TRACE("%p\n", dv );
@@ -117,7 +117,7 @@ static const MSIVIEWOPS drop_ops =
UINT DROP_CreateView(MSIDATABASE *db, MSIVIEW **view, LPCWSTR name) { - MSIDROPVIEW *dv; + struct drop_view *dv; UINT r;
TRACE("%p %s\n", view, debugstr_w(name)); diff --git a/dlls/msi/files.c b/dlls/msi/files.c index b325d1c4085..96c6c5eaa4b 100644 --- a/dlls/msi/files.c +++ b/dlls/msi/files.c @@ -851,14 +851,14 @@ done:
#define is_dot_dir(x) ((x[0] == '.') && ((x[1] == 0) || ((x[1] == '.') && (x[2] == 0))))
-typedef struct +struct file_list { struct list entry; LPWSTR sourcename; LPWSTR destname; LPWSTR source; LPWSTR dest; -} FILE_LIST; +};
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 ) return path; }
-static void free_file_entry(FILE_LIST *file) +static void free_file_entry(struct file_list *file) { free(file->source); free(file->dest); free(file); }
-static void free_list(FILE_LIST *list) +static void free_list(struct file_list *list) { 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); 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; DWORD size;
- new = calloc(1, sizeof(FILE_LIST)); + new = calloc(1, sizeof(*new)); if (!new) return FALSE;
@@ -969,7 +969,7 @@ static BOOL add_wildcard( FILE_LIST *files, const WCHAR *source, WCHAR *dest ) 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) { @@ -988,7 +988,7 @@ static BOOL move_files_wildcard( MSIPACKAGE *package, const WCHAR *source, WCHAR HANDLE hfile; LPWSTR path; BOOL res; - FILE_LIST files, *file; + struct file_list files, *file; DWORD size;
hfile = msi_find_first_file( package, source, &wfd ); @@ -1016,7 +1016,7 @@ static BOOL move_files_wildcard( MSIPACKAGE *package, const WCHAR *source, WCHAR goto done;
/* 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; file->dest = realloc(file->dest, size * sizeof(WCHAR)); if (!file->dest) @@ -1034,7 +1034,7 @@ static BOOL move_files_wildcard( MSIPACKAGE *package, const WCHAR *source, WCHAR
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 );
diff --git a/dlls/msi/font.c b/dlls/msi/font.c index b4eadbc8968..6a4057f6901 100644 --- a/dlls/msi/font.c +++ b/dlls/msi/font.c @@ -28,40 +28,43 @@
WINE_DEFAULT_DEBUG_CHANNEL(msi);
-typedef struct _tagTT_OFFSET_TABLE { +struct offset_table +{ USHORT uMajorVersion; USHORT uMinorVersion; USHORT uNumOfTables; USHORT uSearchRange; USHORT uEntrySelector; USHORT uRangeShift; -} TT_OFFSET_TABLE; +};
-typedef struct _tagTT_TABLE_DIRECTORY { +struct table_directory +{ char szTag[4]; /* table name */ ULONG uCheckSum; /* Check sum */ ULONG uOffset; /* Offset from beginning of file */ 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 uNRCount; /* Name Records count */ - USHORT uStorageOffset; /* Offset for strings storage, - * from start of the table */ -} TT_NAME_TABLE_HEADER; + USHORT uStorageOffset; /* Offset for strings storage from start of the table */ +};
#define NAME_ID_FULL_FONT_NAME 4 #define NAME_ID_VERSION 5
-typedef struct _tagTT_NAME_RECORD { +struct name_record +{ USHORT uPlatformID; USHORT uEncodingID; USHORT uLanguageID; USHORT uNameID; USHORT uStringLength; USHORT uStringOffset; /* from start of storage area */ -} TT_NAME_RECORD; +};
#define SWAPWORD(x) MAKEWORD(HIBYTE(x), LOBYTE(x)) #define SWAPLONG(x) MAKELONG(SWAPWORD(HIWORD(x)), SWAPWORD(LOWORD(x))) @@ -72,11 +75,11 @@ typedef struct _tagTT_NAME_RECORD { */ static WCHAR *load_ttf_name_id( MSIPACKAGE *package, const WCHAR *filename, DWORD id ) { - TT_TABLE_DIRECTORY tblDir; + struct table_directory tblDir; BOOL bFound = FALSE; - TT_OFFSET_TABLE ttOffsetTable; - TT_NAME_TABLE_HEADER ttNTHeader; - TT_NAME_RECORD ttRecord; + struct offset_table ttOffsetTable; + struct name_table_header ttNTHeader; + struct name_record ttRecord; DWORD dwRead; HANDLE handle; LPWSTR ret = NULL; @@ -92,7 +95,7 @@ static WCHAR *load_ttf_name_id( MSIPACKAGE *package, const WCHAR *filename, DWOR return NULL; }
- if (!ReadFile(handle,&ttOffsetTable, sizeof(TT_OFFSET_TABLE),&dwRead,NULL)) + if (!ReadFile(handle,&ttOffsetTable, sizeof(struct offset_table),&dwRead,NULL)) goto end;
ttOffsetTable.uNumOfTables = SWAPWORD(ttOffsetTable.uNumOfTables); @@ -105,7 +108,7 @@ static WCHAR *load_ttf_name_id( MSIPACKAGE *package, const WCHAR *filename, DWOR
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; if (memcmp(tblDir.szTag,"name",4)==0) { @@ -120,14 +123,14 @@ static WCHAR *load_ttf_name_id( MSIPACKAGE *package, const WCHAR *filename, DWOR goto end;
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;
ttNTHeader.uNRCount = SWAPWORD(ttNTHeader.uNRCount); ttNTHeader.uStorageOffset = SWAPWORD(ttNTHeader.uStorageOffset); 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;
ttRecord.uNameID = SWAPWORD(ttRecord.uNameID); diff --git a/dlls/msi/format.c b/dlls/msi/format.c index 8802756d88c..1d2d61f787d 100644 --- a/dlls/msi/format.c +++ b/dlls/msi/format.c @@ -54,7 +54,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(msi);
#define left_type(x) (x & 0xF0)
-typedef struct _tagFORMAT +struct format { MSIPACKAGE *package; MSIRECORD *record; @@ -64,9 +64,9 @@ typedef struct _tagFORMAT BOOL propfailed; BOOL groupfailed; int groups; -} FORMAT; +};
-typedef struct _tagFORMSTR +struct form_str { struct list entry; int n; @@ -74,25 +74,25 @@ typedef struct _tagFORMSTR int type; BOOL propfound; BOOL nonprop; -} FORMSTR; +};
-typedef struct _tagSTACK +struct stack { 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); return stack; }
-static void free_stack(STACK *stack) +static void free_stack(struct stack *stack) { 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); free(str); } @@ -100,28 +100,28 @@ static void free_stack(STACK *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); }
-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)) 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); 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) return str; @@ -130,17 +130,17 @@ static FORMSTR *stack_find(STACK *stack, int type) 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]; }
-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;
@@ -154,7 +154,7 @@ static WCHAR *dup_formstr( FORMAT *format, FORMSTR *str, int *ret_len ) 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; DWORD len; @@ -180,7 +180,7 @@ static WCHAR *deformat_index( FORMAT *format, FORMSTR *str, int *ret_len ) 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; DWORD len = 0; @@ -203,7 +203,7 @@ static WCHAR *deformat_property( FORMAT *format, FORMSTR *str, int *ret_len ) 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; MSICOMPONENT *comp; @@ -227,7 +227,7 @@ static WCHAR *deformat_component( FORMAT *format, FORMSTR *str, int *ret_len ) 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; const MSIFILE *file; @@ -257,7 +257,7 @@ done: 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; DWORD len; @@ -275,7 +275,7 @@ static WCHAR *deformat_environment( FORMAT *format, FORMSTR *str, int *ret_len ) 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 ) { LPCWSTR data = get_formstr_data(format, str); @@ -389,10 +389,10 @@ static BOOL format_is_literal(WCHAR 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; - FORMSTR *str; + struct form_str *str; LPCWSTR data; WCHAR ch;
@@ -401,7 +401,7 @@ static int format_lex(FORMAT *format, FORMSTR **out) if (!format->deformatted) return FORMAT_NULL;
- *out = calloc(1, sizeof(FORMSTR)); + *out = calloc(1, sizeof(**out)); if (!*out) return FORMAT_FAIL;
@@ -473,10 +473,10 @@ static int format_lex(FORMAT *format, FORMSTR **out) return type; }
-static FORMSTR *format_replace( FORMAT *format, BOOL propfound, BOOL nonprop, - int oldsize, int type, WCHAR *replace, int len ) +static struct form_str *format_replace( struct format *format, BOOL propfound, BOOL nonprop, + int oldsize, int type, WCHAR *replace, int len ) { - FORMSTR *ret; + struct form_str *ret; LPWSTR str, ptr; DWORD size = 0; int n; @@ -533,7 +533,7 @@ static FORMSTR *format_replace( FORMAT *format, BOOL propfound, BOOL nonprop, if (!replace) return NULL;
- ret = calloc(1, sizeof(FORMSTR)); + ret = calloc(1, sizeof(*ret)); if (!ret) return NULL;
@@ -546,12 +546,12 @@ static FORMSTR *format_replace( FORMAT *format, BOOL propfound, BOOL nonprop, 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, int *oldsize, int *type, int *len ) { WCHAR *replaced; - FORMSTR *content, *node; + struct form_str *content, *node; int n;
*nonprop = FALSE; @@ -575,7 +575,7 @@ static WCHAR *replace_stack_group( FORMAT *format, STACK *values, free(node); }
- content = calloc(1, sizeof(FORMSTR)); + content = calloc(1, sizeof(*content)); content->n = n; content->len = *oldsize; content->type = FORMAT_LITERAL; @@ -616,12 +616,12 @@ static WCHAR *replace_stack_group( FORMAT *format, STACK *values, 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, int *oldsize, int *type, int *len ) { WCHAR *replaced; - FORMSTR *content, *node; + struct form_str *content, *node; int n;
*propfound = FALSE; @@ -644,7 +644,7 @@ static WCHAR *replace_stack_prop( FORMAT *format, STACK *values, free(node); }
- content = calloc(1, sizeof(FORMSTR)); + content = calloc(1, sizeof(*content)); content->n = n + 1; content->len = *oldsize - 2; content->type = *type; @@ -676,10 +676,10 @@ static WCHAR *replace_stack_prop( FORMAT *format, STACK *values, 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; - FORMSTR *beg, *top, *node; + struct form_str *beg, *top, *node; BOOL propfound = FALSE, nonprop = FALSE, group = FALSE; int type, n, len = 0, oldsize = 0;
@@ -757,10 +757,10 @@ static DWORD deformat_string_internal(MSIPACKAGE *package, LPCWSTR ptr, WCHAR** data, DWORD *len, MSIRECORD* record) { - FORMAT format; - FORMSTR *str = NULL; - STACK *stack, *temp; - FORMSTR *node; + struct format format; + struct form_str *str = NULL; + struct stack *stack, *temp; + struct form_str *node; int type;
if (!ptr) @@ -773,7 +773,7 @@ static DWORD deformat_string_internal(MSIPACKAGE *package, LPCWSTR ptr, *data = wcsdup(ptr); *len = lstrlenW(ptr);
- ZeroMemory(&format, sizeof(FORMAT)); + ZeroMemory(&format, sizeof(format)); format.package = package; format.record = record; format.deformatted = *data; diff --git a/dlls/msi/insert.c b/dlls/msi/insert.c index d14300a0b7a..ffa870e08ac 100644 --- a/dlls/msi/insert.c +++ b/dlls/msi/insert.c @@ -38,7 +38,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(msidb);
/* below is the query interface to a table */
-typedef struct tagMSIINSERTVIEW +struct insert_view { MSIVIEW view; MSIVIEW *table; @@ -46,11 +46,11 @@ typedef struct tagMSIINSERTVIEW BOOL bIsTemp; MSIVIEW *sv; column_info *vals; -} MSIINSERTVIEW; +};
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 );
@@ -106,7 +106,7 @@ err: /* checks to see if the column order specified in the INSERT query * 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; UINT i; @@ -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, * 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; UINT col_count, val_count; @@ -176,7 +176,7 @@ err: 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;
@@ -203,7 +203,7 @@ static BOOL row_has_null_primary_keys(MSIINSERTVIEW *iv, MSIRECORD *row)
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; MSIVIEW *sv; MSIRECORD *values = NULL; @@ -251,7 +251,7 @@ err:
static UINT INSERT_close( struct tagMSIVIEW *view ) { - MSIINSERTVIEW *iv = (MSIINSERTVIEW*)view; + struct insert_view *iv = (struct insert_view *)view; MSIVIEW *sv;
TRACE("%p\n", iv); @@ -265,7 +265,7 @@ static UINT INSERT_close( struct tagMSIVIEW *view )
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;
TRACE("%p %p %p\n", iv, rows, cols ); @@ -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, UINT *type, BOOL *temporary, LPCWSTR *table_name ) { - MSIINSERTVIEW *iv = (MSIINSERTVIEW*)view; + struct insert_view *iv = (struct insert_view *)view; MSIVIEW *sv;
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
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 );
@@ -303,7 +303,7 @@ static UINT INSERT_modify( struct tagMSIVIEW *view, MSIMODIFY eModifyMode, MSIRE
static UINT INSERT_delete( struct tagMSIVIEW *view ) { - MSIINSERTVIEW *iv = (MSIINSERTVIEW*)view; + struct insert_view *iv = (struct insert_view *)view; MSIVIEW *sv;
TRACE("%p\n", iv ); @@ -351,7 +351,7 @@ static UINT count_column_info( const column_info *ci ) UINT INSERT_CreateView( MSIDATABASE *db, MSIVIEW **view, LPCWSTR table, column_info *columns, column_info *values, BOOL temp ) { - MSIINSERTVIEW *iv = NULL; + struct insert_view *iv = NULL; UINT r; MSIVIEW *tv = NULL, *sv = NULL;
diff --git a/dlls/msi/msi.c b/dlls/msi/msi.c index 2fcda9144d9..42f2122bed8 100644 --- a/dlls/msi/msi.c +++ b/dlls/msi/msi.c @@ -4005,17 +4005,17 @@ UINT WINAPI MsiReinstallFeatureA( const char *szProduct, const char *szFeature, return rc; }
-typedef struct +struct md5_ctx { unsigned int i[2]; unsigned int buf[4]; unsigned char in[64]; unsigned char digest[16]; -} MD5_CTX; +};
-extern VOID WINAPI MD5Init( MD5_CTX *); -extern VOID WINAPI MD5Update( MD5_CTX *, const unsigned char *, unsigned int ); -extern VOID WINAPI MD5Final( MD5_CTX *); +extern void WINAPI MD5Init( struct md5_ctx * ); +extern void WINAPI MD5Update( struct md5_ctx *, const unsigned char *, unsigned int ); +extern void WINAPI MD5Final( struct md5_ctx * );
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 * { if ((p = MapViewOfFile( mapping, FILE_MAP_READ, 0, 0, length ))) { - MD5_CTX ctx; + struct md5_ctx ctx;
MD5Init( &ctx ); MD5Update( &ctx, p, length ); diff --git a/dlls/msi/msi_main.c b/dlls/msi/msi_main.c index 258489c4ef1..a2b6b6a0503 100644 --- a/dlls/msi/msi_main.c +++ b/dlls/msi/msi_main.c @@ -87,20 +87,21 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) return TRUE; }
-typedef struct tagIClassFactoryImpl { +struct class_factory +{ IClassFactory IClassFactory_iface; - HRESULT (*create_object)( IUnknown*, LPVOID* ); -} IClassFactoryImpl; + HRESULT (*create_object)( IUnknown *, void ** ); +};
-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, 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);
@@ -129,7 +130,7 @@ static ULONG WINAPI MsiCF_Release(LPCLASSFACTORY iface) static HRESULT WINAPI MsiCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) { - IClassFactoryImpl *This = impl_from_IClassFactory(iface); + struct class_factory *This = impl_from_IClassFactory(iface); IUnknown *unk = NULL; HRESULT r;
@@ -165,7 +166,7 @@ static const IClassFactoryVtbl MsiCF_Vtbl = MsiCF_LockServer };
-static IClassFactoryImpl MsiServer_CF = { { &MsiCF_Vtbl }, create_msiserver }; +static struct class_factory MsiServer_CF = { { &MsiCF_Vtbl }, create_msiserver };
/****************************************************************** * DllGetClassObject [MSI.@] diff --git a/dlls/msi/package.c b/dlls/msi/package.c index 4331f8365ee..9e34b7e6351 100644 --- a/dlls/msi/package.c +++ b/dlls/msi/package.c @@ -573,11 +573,11 @@ static LPWSTR get_fusion_filename(MSIPACKAGE *package) return filename; }
-typedef struct tagLANGANDCODEPAGE +struct lang_codepage { WORD wLanguage; WORD wCodePage; -} LANGANDCODEPAGE; +};
static void set_msi_assembly_prop(MSIPACKAGE *package) { @@ -586,7 +586,7 @@ static void set_msi_assembly_prop(MSIPACKAGE *package) LPVOID version = NULL; WCHAR buf[MAX_PATH]; LPWSTR fusion, verstr; - LANGANDCODEPAGE *translate; + struct lang_codepage *translate;
fusion = get_fusion_filename(package); if (!fusion) diff --git a/dlls/msi/query.h b/dlls/msi/query.h index 5e5f3906f4f..2323a8481d4 100644 --- a/dlls/msi/query.h +++ b/dlls/msi/query.h @@ -68,7 +68,6 @@ struct complex_expr struct expr *right; };
-struct tagJOINTABLE; union ext_column { struct @@ -79,7 +78,7 @@ union ext_column struct { UINT column; - struct tagJOINTABLE *table; + struct join_table *table; } parsed; };
diff --git a/dlls/msi/script.c b/dlls/msi/script.c index 519beb86a63..f355918b07d 100644 --- a/dlls/msi/script.c +++ b/dlls/msi/script.c @@ -50,18 +50,19 @@ WINE_DEFAULT_DEBUG_CHANNEL(msi); #endif
/* - * MsiActiveScriptSite - Our IActiveScriptSite implementation. + * struct script_site - Our IActiveScriptSite implementation. */ -typedef struct { +struct script_site +{ IActiveScriptSite IActiveScriptSite_iface; IDispatch *installer; IDispatch *session; 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 */ 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);
@@ -88,7 +89,7 @@ static HRESULT WINAPI MsiActiveScriptSite_QueryInterface(IActiveScriptSite* ifac
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); TRACE( "(%p)->(%lu)\n", This, ref ); return ref; @@ -96,7 +97,7 @@ static ULONG WINAPI MsiActiveScriptSite_AddRef(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);
TRACE( "(%p)->(%lu)\n", This, ref ); @@ -109,14 +110,14 @@ static ULONG WINAPI MsiActiveScriptSite_Release(IActiveScriptSite* iface)
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); return E_NOTIMPL; /* Script will use system-defined locale */ }
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 );
@@ -149,14 +150,14 @@ static HRESULT WINAPI MsiActiveScriptSite_GetItemInfo(IActiveScriptSite* iface,
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); return E_NOTIMPL; }
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); return S_OK; } @@ -198,7 +199,7 @@ static HRESULT WINAPI MsiActiveScriptSite_OnStateChange(IActiveScriptSite* iface
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; HRESULT hr;
@@ -219,14 +220,14 @@ static HRESULT WINAPI MsiActiveScriptSite_OnScriptError(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); return S_OK; }
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); return S_OK; } @@ -246,15 +247,15 @@ static const struct IActiveScriptSiteVtbl activescriptsitevtbl = 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);
*obj = NULL;
- object = malloc(sizeof(MsiActiveScriptSite)); + object = malloc(sizeof(*object)); if (!object) return E_OUTOFMEMORY;
@@ -290,7 +291,7 @@ DWORD call_script(MSIHANDLE hPackage, INT type, LPCWSTR script, LPCWSTR function HRESULT hr; IActiveScript *pActiveScript = NULL; IActiveScriptParse *pActiveScriptParse = NULL; - MsiActiveScriptSite *scriptsite; + struct script_site *scriptsite; IDispatch *pDispatch = NULL; DISPPARAMS dispparamsNoArgs = {NULL, NULL, 0, 0}; DISPID dispid; diff --git a/dlls/msi/select.c b/dlls/msi/select.c index 1b77d1095d3..cfb17f60b62 100644 --- a/dlls/msi/select.c +++ b/dlls/msi/select.c @@ -38,7 +38,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(msidb);
/* below is the query interface to a table */
-typedef struct tagMSISELECTVIEW +struct select_view { MSIVIEW view; MSIDATABASE *db; @@ -46,9 +46,9 @@ typedef struct tagMSISELECTVIEW UINT num_cols; UINT max_cols; 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; MSIRECORD *object; @@ -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 ) { - MSISELECTVIEW *sv = (MSISELECTVIEW*)view; + struct select_view *sv = (struct select_view *)view;
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
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 );
@@ -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 ) { - MSISELECTVIEW *sv = (MSISELECTVIEW*)view; + struct select_view *sv = (struct select_view *)view; UINT i, expanded_mask = 0, r = ERROR_SUCCESS, col_count = 0; MSIRECORD *expanded;
@@ -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 ) { - MSISELECTVIEW *sv = (MSISELECTVIEW*)view; + struct select_view *sv = (struct select_view *)view; UINT table_cols, r; MSIRECORD *outrec;
@@ -183,7 +183,7 @@ static UINT SELECT_insert_row( struct tagMSIVIEW *view, MSIRECORD *record, UINT
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);
@@ -195,7 +195,7 @@ static UINT SELECT_execute( struct tagMSIVIEW *view, MSIRECORD *record )
static UINT SELECT_close( struct tagMSIVIEW *view ) { - MSISELECTVIEW *sv = (MSISELECTVIEW*)view; + struct select_view *sv = (struct select_view *)view;
TRACE("%p\n", sv );
@@ -207,7 +207,7 @@ static UINT SELECT_close( struct tagMSIVIEW *view )
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 );
@@ -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, 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 );
@@ -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) { - MSISELECTVIEW *sv = (MSISELECTVIEW*)view; + struct select_view *sv = (struct select_view *)view; UINT r, i, col, type, val; IStream *stream; LPCWSTR str; @@ -295,7 +295,7 @@ UINT msi_select_update(MSIVIEW *view, MSIRECORD *rec, UINT row) static UINT SELECT_modify( struct tagMSIVIEW *view, MSIMODIFY mode, MSIRECORD *rec, UINT row ) { - MSISELECTVIEW *sv = (MSISELECTVIEW*)view; + struct select_view *sv = (struct select_view *)view; MSIRECORD *table_rec; UINT r;
@@ -336,7 +336,7 @@ static UINT SELECT_modify( struct tagMSIVIEW *view, MSIMODIFY mode,
static UINT SELECT_delete( struct tagMSIVIEW *view ) { - MSISELECTVIEW *sv = (MSISELECTVIEW*)view; + struct select_view *sv = (struct select_view *)view;
TRACE("%p\n", sv );
@@ -372,8 +372,7 @@ static const MSIVIEWOPS select_ops = NULL, };
-static UINT SELECT_AddColumn( MSISELECTVIEW *sv, LPCWSTR name, - LPCWSTR table_name ) +static UINT SELECT_AddColumn( struct select_view *sv, const WCHAR *name, const WCHAR *table_name ) { UINT r, n; MSIVIEW *table; @@ -423,14 +422,14 @@ static int select_count_columns( const column_info *col ) UINT SELECT_CreateView( MSIDATABASE *db, MSIVIEW **view, MSIVIEW *table, const column_info *columns ) { - MSISELECTVIEW *sv = NULL; + struct select_view *sv = NULL; UINT count = 0, r = ERROR_SUCCESS;
TRACE("%p\n", sv );
count = select_count_columns( columns );
- sv = calloc( 1, offsetof( MSISELECTVIEW, cols[count] ) ); + sv = calloc( 1, offsetof( struct select_view, cols[count] ) ); if( !sv ) return ERROR_FUNCTION_FAILED;
diff --git a/dlls/msi/source.c b/dlls/msi/source.c index 6545f5dc63c..d67a16ab4a3 100644 --- a/dlls/msi/source.c +++ b/dlls/msi/source.c @@ -42,13 +42,13 @@ WINE_DEFAULT_DEBUG_CHANNEL(msi); * These apis are defined in MSI 3.0 */
-typedef struct tagMediaInfo +struct media_info { struct list entry; LPWSTR path; WCHAR szIndex[10]; DWORD index; -} media_info; +};
static UINT OpenSourceKey(LPCWSTR szProduct, HKEY* key, DWORD dwOptions, MSIINSTALLCONTEXT context, BOOL create) @@ -937,17 +937,16 @@ static void free_source_list(struct list *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); free(info->path); free(info); } }
-static void add_source_to_list(struct list *sourcelist, media_info *info, - DWORD *index) +static void add_source_to_list(struct list *sourcelist, struct media_info *info, DWORD *index) { - media_info *iter; + struct media_info *iter; BOOL found = FALSE;
if (index) *index = 0; @@ -958,7 +957,7 @@ static void add_source_to_list(struct list *sourcelist, media_info *info, 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) { @@ -983,7 +982,7 @@ static UINT fill_source_list(struct list *sourcelist, HKEY sourcekey, DWORD *cou DWORD index = 0; WCHAR name[10]; DWORD size, val_size; - media_info *entry; + struct media_info *entry;
*count = 0;
@@ -994,7 +993,7 @@ static UINT fill_source_list(struct list *sourcelist, HKEY sourcekey, DWORD *cou if (r != ERROR_SUCCESS) return r;
- entry = malloc(sizeof(media_info)); + entry = malloc(sizeof(*entry)); if (!entry) goto error;
@@ -1037,7 +1036,7 @@ UINT WINAPI MsiSourceListAddSourceExW( const WCHAR *szProduct, const WCHAR *szUs HKEY sourcekey, typekey; UINT rc; struct list sourcelist; - media_info *info; + struct media_info *info; WCHAR *source, squashed_pc[SQUASHED_GUID_SIZE], name[10]; LPCWSTR postfix; DWORD size, count, index; @@ -1118,7 +1117,7 @@ UINT WINAPI MsiSourceListAddSourceExW( const WCHAR *szProduct, const WCHAR *szUs else { swprintf(name, ARRAY_SIZE(name), L"%d", dwIndex); - info = malloc(sizeof(media_info)); + info = malloc(sizeof(*info)); if (!info) { rc = ERROR_OUTOFMEMORY; @@ -1130,7 +1129,7 @@ UINT WINAPI MsiSourceListAddSourceExW( const WCHAR *szProduct, const WCHAR *szUs info->index = dwIndex; 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) continue; diff --git a/dlls/msi/storages.c b/dlls/msi/storages.c index df17aa036a5..94415035842 100644 --- a/dlls/msi/storages.c +++ b/dlls/msi/storages.c @@ -40,23 +40,23 @@ WINE_DEFAULT_DEBUG_CHANNEL(msidb); #define NUM_STORAGES_COLS 2 #define MAX_STORAGES_NAME_LEN 62
-typedef struct tabSTORAGE +struct storage { UINT str_index; IStorage *storage; } STORAGE;
-typedef struct tagMSISTORAGESVIEW +struct storages_view { MSIVIEW view; MSIDATABASE *db; - STORAGE *storages; + struct storage *storages; UINT max_storages; UINT num_rows; 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) { @@ -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) { - MSISTORAGESVIEW *sv = (MSISTORAGESVIEW *)view; + struct storages_view *sv = (struct storages_view *)view;
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
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);
@@ -155,7 +155,7 @@ done:
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; const WCHAR *name; HRESULT hr; @@ -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) { - MSISTORAGESVIEW *sv = (MSISTORAGESVIEW *)view; + struct storages_view *sv = (struct storages_view *)view; IStorage *stg, *substg = NULL, *prev; IStream *stm; LPWSTR name = NULL; @@ -259,7 +259,7 @@ done:
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)) return ERROR_FUNCTION_FAILED; @@ -294,7 +294,7 @@ static UINT STORAGES_close(struct tagMSIVIEW *view)
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);
@@ -330,7 +330,7 @@ static UINT STORAGES_get_column_info( struct tagMSIVIEW *view, UINT n, LPCWSTR * 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; UINT r, i, id, data; @@ -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) { - MSISTORAGESVIEW *sv = (MSISTORAGESVIEW *)view; + struct storages_view *sv = (struct storages_view *)view; UINT r, row;
r = storages_find_row(sv, rec, &row); @@ -368,7 +368,7 @@ static UINT storages_modify_update(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;
r = storages_find_row(sv, rec, &row); @@ -420,7 +420,7 @@ static UINT STORAGES_modify(struct tagMSIVIEW *view, MSIMODIFY eModifyMode, MSIR
static UINT STORAGES_delete(struct tagMSIVIEW *view) { - MSISTORAGESVIEW *sv = (MSISTORAGESVIEW *)view; + struct storages_view *sv = (struct storages_view *)view; UINT i;
TRACE("(%p)\n", view); @@ -461,7 +461,7 @@ static const MSIVIEWOPS storages_ops = NULL, };
-static INT add_storages_to_table(MSISTORAGESVIEW *sv) +static INT add_storages_to_table(struct storages_view *sv) { IEnumSTATSTG *stgenum = NULL; STATSTG stat; @@ -514,12 +514,12 @@ static INT add_storages_to_table(MSISTORAGESVIEW *sv)
UINT STORAGES_CreateView(MSIDATABASE *db, MSIVIEW **view) { - MSISTORAGESVIEW *sv; + struct storages_view *sv; INT rows;
TRACE("(%p, %p)\n", db, view);
- sv = calloc(1, sizeof(MSISTORAGESVIEW)); + sv = calloc(1, sizeof(*sv)); if (!sv) return ERROR_FUNCTION_FAILED;
diff --git a/dlls/msi/streams.c b/dlls/msi/streams.c index fb83e49db8b..4c23a97d10f 100644 --- a/dlls/msi/streams.c +++ b/dlls/msi/streams.c @@ -38,12 +38,12 @@ WINE_DEFAULT_DEBUG_CHANNEL(msidb);
#define NUM_STREAMS_COLS 2
-typedef struct tagMSISTREAMSVIEW +struct streams_view { MSIVIEW view; MSIDATABASE *db; UINT num_cols; -} MSISTREAMSVIEW; +};
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) { - MSISTREAMSVIEW *sv = (MSISTREAMSVIEW *)view; + struct streams_view *sv = (struct streams_view *)view;
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
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; HRESULT hr;
@@ -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 ) { - MSISTREAMSVIEW *sv = (MSISTREAMSVIEW *)view; + struct streams_view *sv = (struct streams_view *)view; IStream *prev;
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
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);
@@ -162,7 +162,7 @@ static UINT STREAMS_set_row(struct tagMSIVIEW *view, UINT row, MSIRECORD *rec, U 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; UINT r, i, id, val; @@ -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) { - MSISTREAMSVIEW *sv = (MSISTREAMSVIEW *)view; + struct streams_view *sv = (struct streams_view *)view; UINT i, r, num_rows = sv->db->num_streams + 1;
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
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; const WCHAR *name; WCHAR *encname; @@ -256,7 +256,7 @@ static UINT STREAMS_close(struct tagMSIVIEW *view)
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);
@@ -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, 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);
@@ -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) { - MSISTREAMSVIEW *sv = (MSISTREAMSVIEW *)view; + struct streams_view *sv = (struct streams_view *)view; UINT r, row;
r = streams_find_row(sv, rec, &row); @@ -307,7 +307,7 @@ static UINT streams_modify_update(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;
r = streams_find_row( sv, rec, NULL ); @@ -362,7 +362,7 @@ static UINT STREAMS_modify(struct tagMSIVIEW *view, MSIMODIFY eModifyMode, MSIRE
static UINT STREAMS_delete(struct tagMSIVIEW *view) { - MSISTREAMSVIEW *sv = (MSISTREAMSVIEW *)view; + struct streams_view *sv = (struct streams_view *)view;
TRACE("(%p)\n", view);
@@ -538,7 +538,7 @@ UINT msi_get_stream( MSIDATABASE *db, const WCHAR *name, IStream **ret )
UINT STREAMS_CreateView(MSIDATABASE *db, MSIVIEW **view) { - MSISTREAMSVIEW *sv; + struct streams_view *sv; UINT r;
TRACE("(%p, %p)\n", db, view); @@ -547,7 +547,7 @@ UINT STREAMS_CreateView(MSIDATABASE *db, MSIVIEW **view) if (r != ERROR_SUCCESS) return r;
- if (!(sv = calloc( 1, sizeof(MSISTREAMSVIEW) ))) + if (!(sv = calloc( 1, sizeof(*sv) ))) return ERROR_OUTOFMEMORY;
sv->view.ops = &streams_ops; diff --git a/dlls/msi/suminfo.c b/dlls/msi/suminfo.c index 57ebca1807a..26da79ce8e1 100644 --- a/dlls/msi/suminfo.c +++ b/dlls/msi/suminfo.c @@ -44,30 +44,35 @@ WINE_DEFAULT_DEBUG_CHANNEL(msi);
#include "pshpack1.h"
-typedef struct { +struct property_set_header +{ WORD wByteOrder; WORD wFormat; DWORD dwOSVer; CLSID clsID; DWORD reserved; -} PROPERTYSETHEADER; +};
-typedef struct { +struct format_id_offset +{ FMTID fmtid; DWORD dwOffset; -} FORMATIDOFFSET; +};
-typedef struct { +struct property_section_header +{ DWORD cbSection; DWORD cProperties; -} PROPERTYSECTIONHEADER; +};
-typedef struct { +struct property_id_offset +{ DWORD propid; DWORD dwOffset; -} PROPERTYIDOFFSET; +};
-typedef struct { +struct property_data +{ DWORD type; union { INT i4; @@ -78,7 +83,7 @@ typedef struct { BYTE str[1]; } str; } u; -} PROPERTY_DATA; +};
#include "poppack.h"
@@ -86,7 +91,7 @@ static HRESULT (WINAPI *pPropVariantChangeType) (PROPVARIANT *ppropvarDest, REFPROPVARIANT propvarSrc, 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 ) { @@ -170,14 +175,14 @@ static void read_properties_from_data( PROPVARIANT *prop, LPBYTE data, DWORD sz { UINT type; DWORD i, size; - PROPERTY_DATA *propdata; + struct property_data *propdata; PROPVARIANT property, *ptr; PROPVARIANT changed; - PROPERTYIDOFFSET *idofs; - PROPERTYSECTIONHEADER *section_hdr; + struct property_id_offset *idofs; + struct property_section_header *section_hdr;
- section_hdr = (PROPERTYSECTIONHEADER*) &data[0]; - idofs = (PROPERTYIDOFFSET*) &data[SECT_HDR_SIZE]; + section_hdr = (struct property_section_header *) &data[0]; + idofs = (struct property_id_offset *)&data[SECT_HDR_SIZE];
/* now set all the properties */ for( i = 0; i < section_hdr->cProperties; i++ ) @@ -195,7 +200,7 @@ static void read_properties_from_data( PROPVARIANT *prop, LPBYTE data, DWORD sz 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 */ size = sz - idofs[i].dwOffset - sizeof(DWORD); @@ -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 ) { - PROPERTYSETHEADER set_hdr; - FORMATIDOFFSET format_hdr; - PROPERTYSECTIONHEADER section_hdr; + struct property_set_header set_hdr; + struct format_id_offset format_hdr; + struct property_section_header section_hdr; LPBYTE data = NULL; LARGE_INTEGER ofs; ULONG count, sz; @@ -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 ) { UINT ret = ERROR_FUNCTION_FAILED; - PROPERTYSETHEADER set_hdr; - FORMATIDOFFSET format_hdr; - PROPERTYSECTIONHEADER section_hdr; - PROPERTYIDOFFSET idofs[MSI_MAX_PROPS]; + struct property_set_header set_hdr; + struct format_id_offset format_hdr; + struct property_section_header section_hdr; + struct property_id_offset idofs[MSI_MAX_PROPS]; LPBYTE data = NULL; ULONG count, sz; HRESULT r; diff --git a/dlls/msi/table.c b/dlls/msi/table.c index 5484f4da794..f65250766a4 100644 --- a/dlls/msi/table.c +++ b/dlls/msi/table.c @@ -40,22 +40,22 @@ WINE_DEFAULT_DEBUG_CHANNEL(msidb);
#define MSITABLE_HASH_TABLE_SIZE 37
-typedef struct tagMSICOLUMNHASHENTRY +struct column_hash_entry { - struct tagMSICOLUMNHASHENTRY *next; + struct column_hash_entry *next; UINT value; UINT row; -} MSICOLUMNHASHENTRY; +};
-typedef struct tagMSICOLUMNINFO +struct column_info { LPCWSTR tablename; UINT number; LPCWSTR colname; UINT type; UINT offset; - MSICOLUMNHASHENTRY **hash_table; -} MSICOLUMNINFO; + struct column_hash_entry **hash_table; +};
struct tagMSITABLE { @@ -63,7 +63,7 @@ struct tagMSITABLE BOOL *data_persistent; UINT row_count; struct list entry; - MSICOLUMNINFO *colinfo; + struct column_info *colinfo; UINT col_count; MSICONDITION persistent; LONG ref_count; @@ -71,20 +71,22 @@ struct tagMSITABLE };
/* information for default tables */ -static const MSICOLUMNINFO _Columns_cols[4] = { +static const struct column_info _Columns_cols[4] = +{ { L"_Columns", 1, L"Table", MSITYPE_VALID | MSITYPE_STRING | MSITYPE_KEY | 64, 0, NULL }, { L"_Columns", 2, L"Number", MSITYPE_VALID | MSITYPE_KEY | 2, 2, NULL }, { L"_Columns", 3, L"Name", MSITYPE_VALID | MSITYPE_STRING | 64, 4, NULL }, { L"_Columns", 4, L"Type", MSITYPE_VALID | 2, 6, NULL }, };
-static const MSICOLUMNINFO _Tables_cols[1] = { +static const struct column_info _Tables_cols[1] = +{ { L"_Tables", 1, L"Name", MSITYPE_VALID | MSITYPE_STRING | MSITYPE_KEY | 64, 0, NULL }, };
#define MAX_STREAM_NAME 0x1f
-static inline UINT bytes_per_column( MSIDATABASE *db, const MSICOLUMNINFO *col, UINT bytes_per_strref ) +static inline UINT bytes_per_column( MSIDATABASE *db, const struct column_info *col, UINT bytes_per_strref ) { if( MSITYPE_IS_BINARY(col->type) ) return 2; @@ -353,7 +355,7 @@ end: return ret; }
-static void free_colinfo( MSICOLUMNINFO *colinfo, UINT count ) +static void free_colinfo( struct column_info *colinfo, UINT count ) { UINT i; for (i = 0; i < count; i++) free( colinfo[i].hash_table ); @@ -371,9 +373,9 @@ static void free_table( MSITABLE *table ) free( table ); }
-static UINT table_get_row_size( MSIDATABASE *db, const MSICOLUMNINFO *cols, UINT count, UINT bytes_per_strref ) +static UINT table_get_row_size( MSIDATABASE *db, const struct column_info *cols, UINT count, UINT bytes_per_strref ) { - const MSICOLUMNINFO *last_col; + const struct column_info *last_col;
if (!count) return 0; @@ -489,7 +491,7 @@ static MSITABLE *find_cached_table( MSIDATABASE *db, LPCWSTR name ) return NULL; }
-static void table_calc_column_offsets( MSIDATABASE *db, MSICOLUMNINFO *colinfo, DWORD count ) +static void table_calc_column_offsets( MSIDATABASE *db, struct column_info *colinfo, DWORD count ) { DWORD i;
@@ -506,9 +508,9 @@ static void table_calc_column_offsets( MSIDATABASE *db, MSICOLUMNINFO *colinfo, } }
-static UINT get_defaulttablecolumns( MSIDATABASE *db, LPCWSTR name, MSICOLUMNINFO *colinfo, UINT *sz ) +static UINT get_defaulttablecolumns( MSIDATABASE *db, const WCHAR *name, struct column_info *colinfo, UINT *sz ) { - const MSICOLUMNINFO *p; + const struct column_info *p; DWORD i, n;
TRACE("%s\n", debugstr_w(name)); @@ -535,12 +537,12 @@ static UINT get_defaulttablecolumns( MSIDATABASE *db, LPCWSTR name, MSICOLUMNINF return ERROR_SUCCESS; }
-static UINT get_tablecolumns( MSIDATABASE *db, LPCWSTR szTableName, MSICOLUMNINFO *colinfo, UINT *sz ); +static UINT get_tablecolumns( MSIDATABASE *, const WCHAR *, struct column_info *, UINT * );
-static UINT table_get_column_info( MSIDATABASE *db, LPCWSTR name, MSICOLUMNINFO **pcols, UINT *pcount ) +static UINT table_get_column_info( MSIDATABASE *db, const WCHAR *name, struct column_info **pcols, UINT *pcount ) { UINT r, column_count = 0; - MSICOLUMNINFO *columns; + struct column_info *columns;
/* get the number of columns in this table */ column_count = 0; @@ -556,7 +558,7 @@ static UINT table_get_column_info( MSIDATABASE *db, LPCWSTR name, MSICOLUMNINFO
TRACE("table %s found\n", debugstr_w(name));
- columns = malloc( column_count * sizeof(MSICOLUMNINFO) ); + columns = malloc( column_count * sizeof(*columns) ); if (!columns) return ERROR_FUNCTION_FAILED;
@@ -626,7 +628,7 @@ static UINT read_table_int( BYTE *const *data, UINT row, UINT col, UINT bytes ) return ret; }
-static UINT get_tablecolumns( MSIDATABASE *db, LPCWSTR szTableName, MSICOLUMNINFO *colinfo, UINT *sz ) +static UINT get_tablecolumns( MSIDATABASE *db, const WCHAR *szTableName, struct column_info *colinfo, UINT *sz ) { UINT r, i, n = 0, table_id, count, maxcount = *sz; MSITABLE *table = NULL; @@ -738,7 +740,7 @@ UINT msi_create_table( MSIDATABASE *db, LPCWSTR name, column_info *col_info, for( col = col_info; col; col = col->next ) table->col_count++;
- table->colinfo = malloc( table->col_count * sizeof(MSICOLUMNINFO) ); + table->colinfo = malloc( table->col_count * sizeof(*table->colinfo) ); if (!table->colinfo) { free_table( table ); @@ -991,20 +993,20 @@ BOOL TABLE_Exists( MSIDATABASE *db, LPCWSTR name )
/* below is the query interface to a table */
-typedef struct tagMSITABLEVIEW +struct table_view { MSIVIEW view; MSIDATABASE *db; MSITABLE *table; - MSICOLUMNINFO *columns; + struct column_info *columns; UINT num_cols; UINT row_size; WCHAR name[1]; -} MSITABLEVIEW; +};
static UINT TABLE_fetch_int( struct tagMSIVIEW *view, UINT row, UINT col, UINT *val ) { - MSITABLEVIEW *tv = (MSITABLEVIEW*)view; + struct table_view *tv = (struct table_view *)view; UINT offset, n;
if( !tv->table ) @@ -1039,7 +1041,7 @@ static UINT TABLE_fetch_int( struct tagMSIVIEW *view, UINT row, UINT col, UINT * return ERROR_SUCCESS; }
-static UINT get_stream_name( const MSITABLEVIEW *tv, UINT row, WCHAR **pstname ) +static UINT get_stream_name( const struct table_view *tv, UINT row, WCHAR **pstname ) { LPWSTR p, stname = NULL; UINT i, r, type, ival; @@ -1131,7 +1133,7 @@ err: */ static UINT TABLE_fetch_stream( struct tagMSIVIEW *view, UINT row, UINT col, IStream **stm ) { - MSITABLEVIEW *tv = (MSITABLEVIEW*)view; + struct table_view *tv = (struct table_view *)view; UINT r; WCHAR *name;
@@ -1154,7 +1156,7 @@ static UINT TABLE_fetch_stream( struct tagMSIVIEW *view, UINT row, UINT col, ISt }
/* Set a table value, i.e. preadjusted integer or string ID. */ -static UINT table_set_bytes( MSITABLEVIEW *tv, UINT row, UINT col, UINT val ) +static UINT table_set_bytes( struct table_view *tv, UINT row, UINT col, UINT val ) { UINT offset, n, i;
@@ -1191,7 +1193,7 @@ static UINT table_set_bytes( MSITABLEVIEW *tv, UINT row, UINT col, UINT val ) return ERROR_SUCCESS; }
-static UINT int_to_table_storage( const MSITABLEVIEW *tv, UINT col, int val, UINT *ret ) +static UINT int_to_table_storage( const struct table_view *tv, UINT col, int val, UINT *ret ) { if ((tv->columns[col-1].type & MSI_DATASIZEMASK) == 2) { @@ -1213,7 +1215,7 @@ static UINT int_to_table_storage( const MSITABLEVIEW *tv, UINT col, int val, UIN
static UINT TABLE_set_int( MSIVIEW *view, UINT row, UINT col, int val ) { - MSITABLEVIEW *tv = (MSITABLEVIEW *)view; + struct table_view *tv = (struct table_view *)view; UINT r, table_int;
TRACE("row %u, col %u, val %d.\n", row, col, val); @@ -1240,7 +1242,7 @@ static UINT TABLE_set_int( MSIVIEW *view, UINT row, UINT col, int val )
static UINT TABLE_set_string( MSIVIEW *view, UINT row, UINT col, const WCHAR *val, int len ) { - MSITABLEVIEW *tv = (MSITABLEVIEW *)view; + struct table_view *tv = (struct table_view *)view; BOOL persistent; UINT id, r;
@@ -1277,7 +1279,7 @@ static UINT TABLE_set_string( MSIVIEW *view, UINT row, UINT col, const WCHAR *va
static UINT TABLE_get_row( struct tagMSIVIEW *view, UINT row, MSIRECORD **rec ) { - MSITABLEVIEW *tv = (MSITABLEVIEW *)view; + struct table_view *tv = (struct table_view *)view;
if (!tv->table) return ERROR_INVALID_PARAMETER; @@ -1339,7 +1341,7 @@ done:
static UINT TABLE_set_stream( MSIVIEW *view, UINT row, UINT col, IStream *stream ) { - MSITABLEVIEW *tv = (MSITABLEVIEW *)view; + struct table_view *tv = (struct table_view *)view; WCHAR *name; UINT r;
@@ -1353,9 +1355,9 @@ static UINT TABLE_set_stream( MSIVIEW *view, UINT row, UINT col, IStream *stream return r; }
-static UINT get_table_value_from_record( MSITABLEVIEW *tv, MSIRECORD *rec, UINT iField, UINT *pvalue ) +static UINT get_table_value_from_record( struct table_view *tv, MSIRECORD *rec, UINT iField, UINT *pvalue ) { - MSICOLUMNINFO columninfo; + struct column_info columninfo; UINT r;
if (!iField || iField > tv->num_cols || MSI_RecordIsNull( rec, iField )) @@ -1387,7 +1389,7 @@ static UINT get_table_value_from_record( MSITABLEVIEW *tv, MSIRECORD *rec, UINT
static UINT TABLE_set_row( struct tagMSIVIEW *view, UINT row, MSIRECORD *rec, UINT mask ) { - MSITABLEVIEW *tv = (MSITABLEVIEW*)view; + struct table_view *tv = (struct table_view *)view; UINT i, val, r = ERROR_SUCCESS;
if ( !tv->table ) @@ -1472,7 +1474,7 @@ static UINT TABLE_set_row( struct tagMSIVIEW *view, UINT row, MSIRECORD *rec, UI
static UINT table_create_new_row( struct tagMSIVIEW *view, UINT *num, BOOL temporary ) { - MSITABLEVIEW *tv = (MSITABLEVIEW*)view; + struct table_view *tv = (struct table_view *)view; BYTE **p, *row; BOOL *b; UINT sz; @@ -1531,7 +1533,7 @@ static UINT table_create_new_row( struct tagMSIVIEW *view, UINT *num, BOOL tempo
static UINT TABLE_execute( struct tagMSIVIEW *view, MSIRECORD *record ) { - MSITABLEVIEW *tv = (MSITABLEVIEW*)view; + struct table_view *tv = (struct table_view *)view;
TRACE("%p %p\n", tv, record);
@@ -1549,7 +1551,7 @@ static UINT TABLE_close( struct tagMSIVIEW *view )
static UINT TABLE_get_dimensions( struct tagMSIVIEW *view, UINT *rows, UINT *cols) { - MSITABLEVIEW *tv = (MSITABLEVIEW*)view; + struct table_view *tv = (struct table_view *)view;
TRACE("%p %p %p\n", view, rows, cols );
@@ -1569,7 +1571,7 @@ static UINT TABLE_get_column_info( struct tagMSIVIEW *view, UINT n, LPCWSTR *name, UINT *type, BOOL *temporary, LPCWSTR *table_name ) { - MSITABLEVIEW *tv = (MSITABLEVIEW*)view; + struct table_view *tv = (struct table_view *)view;
TRACE("%p %d %p %p\n", tv, n, name, type );
@@ -1599,9 +1601,9 @@ static UINT TABLE_get_column_info( struct tagMSIVIEW *view, return ERROR_SUCCESS; }
-static UINT table_find_row( MSITABLEVIEW *, MSIRECORD *, UINT *, UINT * ); +static UINT table_find_row( struct table_view *, MSIRECORD *, UINT *, UINT * );
-static UINT table_validate_new( MSITABLEVIEW *tv, MSIRECORD *rec, UINT *column ) +static UINT table_validate_new( struct table_view *tv, MSIRECORD *rec, UINT *column ) { UINT r, row, i;
@@ -1645,7 +1647,7 @@ static UINT table_validate_new( MSITABLEVIEW *tv, MSIRECORD *rec, UINT *column ) return ERROR_SUCCESS; }
-static int compare_record( MSITABLEVIEW *tv, UINT row, MSIRECORD *rec ) +static int compare_record( struct table_view *tv, UINT row, MSIRECORD *rec ) { UINT r, i, ivalue, x;
@@ -1678,7 +1680,7 @@ static int compare_record( MSITABLEVIEW *tv, UINT row, MSIRECORD *rec ) return 1; }
-static int find_insert_index( MSITABLEVIEW *tv, MSIRECORD *rec ) +static int find_insert_index( struct table_view *tv, MSIRECORD *rec ) { int idx, c, low = 0, high = tv->table->row_count - 1;
@@ -1705,7 +1707,7 @@ static int find_insert_index( MSITABLEVIEW *tv, MSIRECORD *rec )
static UINT TABLE_insert_row( struct tagMSIVIEW *view, MSIRECORD *rec, UINT row, BOOL temporary ) { - MSITABLEVIEW *tv = (MSITABLEVIEW*)view; + struct table_view *tv = (struct table_view *)view; UINT i, r;
TRACE("%p %p %s\n", tv, rec, temporary ? "TRUE" : "FALSE" ); @@ -1738,7 +1740,7 @@ static UINT TABLE_insert_row( struct tagMSIVIEW *view, MSIRECORD *rec, UINT row,
static UINT TABLE_delete_row( struct tagMSIVIEW *view, UINT row ) { - MSITABLEVIEW *tv = (MSITABLEVIEW*)view; + struct table_view *tv = (struct table_view *)view; UINT r, num_rows, num_cols, i;
TRACE("%p %d\n", tv, row); @@ -1776,7 +1778,7 @@ static UINT TABLE_delete_row( struct tagMSIVIEW *view, UINT row )
static UINT table_update(struct tagMSIVIEW *view, MSIRECORD *rec, UINT row) { - MSITABLEVIEW *tv = (MSITABLEVIEW *)view; + struct table_view *tv = (struct table_view *)view; UINT r, new_row;
/* FIXME: MsiViewFetch should set rec index 0 to some ID that @@ -1802,7 +1804,7 @@ static UINT table_update(struct tagMSIVIEW *view, MSIRECORD *rec, UINT row)
static UINT table_assign(struct tagMSIVIEW *view, MSIRECORD *rec) { - MSITABLEVIEW *tv = (MSITABLEVIEW *)view; + struct table_view *tv = (struct table_view *)view; UINT r, row;
if (!tv->table) @@ -1838,7 +1840,7 @@ static UINT refresh_record( struct tagMSIVIEW *view, MSIRECORD *rec, UINT row ) static UINT TABLE_modify( struct tagMSIVIEW *view, MSIMODIFY eModifyMode, MSIRECORD *rec, UINT row) { - MSITABLEVIEW *tv = (MSITABLEVIEW*)view; + struct table_view *tv = (struct table_view *)view; UINT r, frow, column;
TRACE("%p %d %p\n", view, eModifyMode, rec ); @@ -1912,7 +1914,7 @@ static UINT TABLE_modify( struct tagMSIVIEW *view, MSIMODIFY eModifyMode,
static UINT TABLE_delete( struct tagMSIVIEW *view ) { - MSITABLEVIEW *tv = (MSITABLEVIEW*)view; + struct table_view *tv = (struct table_view *)view;
TRACE("%p\n", view );
@@ -1926,7 +1928,7 @@ static UINT TABLE_delete( struct tagMSIVIEW *view )
static UINT TABLE_add_ref(struct tagMSIVIEW *view) { - MSITABLEVIEW *tv = (MSITABLEVIEW*)view; + struct table_view *tv = (struct table_view *)view;
TRACE( "%p, %ld\n", view, tv->table->ref_count ); return InterlockedIncrement(&tv->table->ref_count); @@ -1934,7 +1936,7 @@ static UINT TABLE_add_ref(struct tagMSIVIEW *view)
static UINT TABLE_remove_column(struct tagMSIVIEW *view, UINT number) { - MSITABLEVIEW *tv = (MSITABLEVIEW*)view; + struct table_view *tv = (struct table_view *)view; MSIRECORD *rec = NULL; MSIVIEW *columns = NULL; UINT row, r; @@ -1967,7 +1969,7 @@ static UINT TABLE_remove_column(struct tagMSIVIEW *view, UINT number) return r; }
- r = table_find_row((MSITABLEVIEW *)columns, rec, &row, NULL); + r = table_find_row((struct table_view *)columns, rec, &row, NULL); if (r != ERROR_SUCCESS) goto done;
@@ -1985,7 +1987,7 @@ done:
static UINT TABLE_release(struct tagMSIVIEW *view) { - MSITABLEVIEW *tv = (MSITABLEVIEW*)view; + struct table_view *tv = (struct table_view *)view; INT ref = tv->table->ref_count; UINT r; INT i; @@ -2025,8 +2027,8 @@ static UINT TABLE_add_column(struct tagMSIVIEW *view, LPCWSTR column, { UINT i, r, table_id, col_id, size, offset; BOOL temporary = type & MSITYPE_TEMPORARY; - MSITABLEVIEW *tv = (MSITABLEVIEW*)view; - MSICOLUMNINFO *colinfo; + struct table_view *tv = (struct table_view *)view; + struct column_info *colinfo;
if (temporary && !hold && !tv->table->ref_count) return ERROR_SUCCESS; @@ -2117,7 +2119,7 @@ static UINT TABLE_add_column(struct tagMSIVIEW *view, LPCWSTR column,
static UINT TABLE_drop(struct tagMSIVIEW *view) { - MSITABLEVIEW *tv = (MSITABLEVIEW*)view; + struct table_view *tv = (struct table_view *)view; MSIVIEW *tables = NULL; MSIRECORD *rec = NULL; UINT r, row; @@ -2145,7 +2147,7 @@ static UINT TABLE_drop(struct tagMSIVIEW *view) return r; }
- r = table_find_row((MSITABLEVIEW *)tables, rec, &row, NULL); + r = table_find_row((struct table_view *)tables, rec, &row, NULL); if (r != ERROR_SUCCESS) goto done;
@@ -2188,7 +2190,7 @@ static const MSIVIEWOPS table_ops =
UINT TABLE_CreateView( MSIDATABASE *db, LPCWSTR name, MSIVIEW **view ) { - MSITABLEVIEW *tv ; + struct table_view *tv ; UINT r, sz;
TRACE("%p %s %p\n", db, debugstr_w(name), view ); @@ -2198,7 +2200,7 @@ UINT TABLE_CreateView( MSIDATABASE *db, LPCWSTR name, MSIVIEW **view ) else if ( !wcscmp( name, L"_Storages" ) ) return STORAGES_CreateView( db, view );
- sz = FIELD_OFFSET( MSITABLEVIEW, name[lstrlenW( name ) + 1] ); + sz = FIELD_OFFSET( struct table_view, name[lstrlenW( name ) + 1] ); tv = calloc( 1, sz ); if( !tv ) return ERROR_FUNCTION_FAILED; @@ -2228,7 +2230,7 @@ UINT TABLE_CreateView( MSIDATABASE *db, LPCWSTR name, MSIVIEW **view ) return ERROR_SUCCESS; }
-static WCHAR* create_key_string(MSITABLEVIEW *tv, MSIRECORD *rec) +static WCHAR *create_key_string(struct table_view *tv, MSIRECORD *rec) { DWORD i, p, len, key_len = 0; WCHAR *key; @@ -2260,7 +2262,7 @@ static WCHAR* create_key_string(MSITABLEVIEW *tv, MSIRECORD *rec) return key; }
-static UINT record_stream_name( const MSITABLEVIEW *tv, MSIRECORD *rec, WCHAR *name, DWORD *len ) +static UINT record_stream_name( const struct table_view *tv, MSIRECORD *rec, WCHAR *name, DWORD *len ) { UINT p = 0, i, r; DWORD l; @@ -2295,7 +2297,7 @@ static UINT record_stream_name( const MSITABLEVIEW *tv, MSIRECORD *rec, WCHAR *n
static UINT TransformView_fetch_int( MSIVIEW *view, UINT row, UINT col, UINT *val ) { - MSITABLEVIEW *tv = (MSITABLEVIEW*)view; + struct table_view *tv = (struct table_view *)view;
if (!tv->table || col > tv->table->col_count) { @@ -2307,7 +2309,7 @@ static UINT TransformView_fetch_int( MSIVIEW *view, UINT row, UINT col, UINT *va
static UINT TransformView_fetch_stream( MSIVIEW *view, UINT row, UINT col, IStream **stm ) { - MSITABLEVIEW *tv = (MSITABLEVIEW*)view; + struct table_view *tv = (struct table_view *)view;
if (!tv->table || col > tv->table->col_count) { @@ -2322,7 +2324,7 @@ static UINT TransformView_set_row( MSIVIEW *view, UINT row, MSIRECORD *rec, UINT static const WCHAR query_pfx[] = L"INSERT INTO `_TransformView` (`new`, `Table`, `Column`, `Row`, `Data`, `Current`) VALUES (1, '";
- MSITABLEVIEW *tv = (MSITABLEVIEW*)view; + struct table_view *tv = (struct table_view *)view; WCHAR buf[256], *query; MSIRECORD *old_rec; MSIQUERY *q; @@ -2463,7 +2465,7 @@ static UINT TransformView_set_row( MSIVIEW *view, UINT row, MSIRECORD *rec, UINT return ERROR_SUCCESS; }
-static UINT TransformView_create_table( MSITABLEVIEW *tv, MSIRECORD *rec ) +static UINT TransformView_create_table( struct table_view *tv, MSIRECORD *rec ) { static const WCHAR query_fmt[] = L"INSERT INTO `_TransformView` (`Table`, `Column`, `new`) VALUES ('%s', 'CREATE', 1)"; @@ -2498,7 +2500,7 @@ static UINT TransformView_create_table( MSITABLEVIEW *tv, MSIRECORD *rec ) return r; }
-static UINT TransformView_add_column( MSITABLEVIEW *tv, MSIRECORD *rec ) +static UINT TransformView_add_column( struct table_view *tv, MSIRECORD *rec ) { static const WCHAR query_pfx[] = L"INSERT INTO `_TransformView` (`new`, `Table`, `Current`, `Column`, `Data`) VALUES (1, '"; @@ -2557,7 +2559,7 @@ static UINT TransformView_insert_row( MSIVIEW *view, MSIRECORD *rec, UINT row, B static const WCHAR query_fmt[] = L"INSERT INTO `_TransformView` (`new`, `Table`, `Column`, `Row`) VALUES (1, '%s', 'INSERT', '%s')";
- MSITABLEVIEW *tv = (MSITABLEVIEW*)view; + struct table_view *tv = (struct table_view *)view; WCHAR buf[256], *query = buf; MSIQUERY *q; WCHAR *key; @@ -2601,7 +2603,7 @@ static UINT TransformView_insert_row( MSIVIEW *view, MSIRECORD *rec, UINT row, B return TransformView_set_row( view, row, rec, ~0 ); }
-static UINT TransformView_drop_table( MSITABLEVIEW *tv, UINT row ) +static UINT TransformView_drop_table( struct table_view *tv, UINT row ) { static const WCHAR query_pfx[] = L"INSERT INTO `_TransformView` ( `new`, `Table`, `Column` ) VALUES ( 1, '"; static const WCHAR query_sfx[] = L"', 'DROP' )"; @@ -2651,7 +2653,7 @@ static UINT TransformView_delete_row( MSIVIEW *view, UINT row ) static const WCHAR query_column[] = L"', 'DELETE', '"; static const WCHAR query_sfx[] = L"')";
- MSITABLEVIEW *tv = (MSITABLEVIEW*)view; + struct table_view *tv = (struct table_view *)view; WCHAR *key, buf[256], *query = buf; UINT r, len, name_len, key_len; MSIRECORD *rec; @@ -2734,7 +2736,7 @@ static UINT TransformView_get_column_info( MSIVIEW *view, UINT n, LPCWSTR *name,
static UINT TransformView_delete( MSIVIEW *view ) { - MSITABLEVIEW *tv = (MSITABLEVIEW*)view; + struct table_view *tv = (struct table_view *)view; if (!tv->table || tv->columns != tv->table->colinfo) free( tv->columns ); return TABLE_delete( view ); @@ -2770,8 +2772,8 @@ UINT TransformView_Create( MSIDATABASE *db, string_table *st, LPCWSTR name, MSIV
WCHAR buf[256], *query = buf; UINT r, len, name_len, size, add_col; - MSICOLUMNINFO *colinfo; - MSITABLEVIEW *tv; + struct column_info *colinfo; + struct table_view *tv; MSIRECORD *rec; MSIQUERY *q;
@@ -2781,7 +2783,7 @@ UINT TransformView_Create( MSIDATABASE *db, string_table *st, LPCWSTR name, MSIV if (r == ERROR_INVALID_PARAMETER) { /* table does not exist */ - size = FIELD_OFFSET( MSITABLEVIEW, name[name_len + 1] ); + size = FIELD_OFFSET( struct table_view, name[name_len + 1] ); tv = calloc( 1, size ); if (!tv) return ERROR_OUTOFMEMORY; @@ -2796,7 +2798,7 @@ UINT TransformView_Create( MSIDATABASE *db, string_table *st, LPCWSTR name, MSIV } else { - tv = (MSITABLEVIEW*)*view; + tv = (struct table_view *)*view; }
tv->view.ops = &transform_view_ops; @@ -2946,7 +2948,7 @@ static UINT read_raw_int(const BYTE *data, UINT col, UINT bytes) return ret; }
-static UINT record_encoded_stream_name( const MSITABLEVIEW *tv, MSIRECORD *rec, WCHAR **pstname ) +static UINT record_encoded_stream_name( const struct table_view *tv, MSIRECORD *rec, WCHAR **pstname ) { UINT r; DWORD len; @@ -2975,12 +2977,12 @@ static UINT record_encoded_stream_name( const MSITABLEVIEW *tv, MSIRECORD *rec, return ERROR_SUCCESS; }
-static MSIRECORD *get_transform_record( const MSITABLEVIEW *tv, const string_table *st, IStorage *stg, +static MSIRECORD *get_transform_record( const struct table_view *tv, const string_table *st, IStorage *stg, const BYTE *rawdata, UINT bytes_per_strref ) { UINT i, val, ofs = 0; USHORT mask; - MSICOLUMNINFO *columns = tv->columns; + struct column_info *columns = tv->columns; MSIRECORD *rec;
mask = rawdata[0] | (rawdata[1] << 8); @@ -3074,7 +3076,7 @@ static void dump_table( const string_table *st, const USHORT *rawdata, UINT raws } }
-static UINT *record_to_row( const MSITABLEVIEW *tv, MSIRECORD *rec ) +static UINT *record_to_row( const struct table_view *tv, MSIRECORD *rec ) { UINT i, r, *data;
@@ -3118,7 +3120,7 @@ static UINT *record_to_row( const MSITABLEVIEW *tv, MSIRECORD *rec ) return data; }
-static UINT row_matches( MSITABLEVIEW *tv, UINT row, const UINT *data, UINT *column ) +static UINT row_matches( struct table_view *tv, UINT row, const UINT *data, UINT *column ) { UINT i, r, x, ret = ERROR_FUNCTION_FAILED;
@@ -3147,7 +3149,7 @@ static UINT row_matches( MSITABLEVIEW *tv, UINT row, const UINT *data, UINT *col return ret; }
-static UINT table_find_row( MSITABLEVIEW *tv, MSIRECORD *rec, UINT *row, UINT *column ) +static UINT table_find_row( struct table_view *tv, MSIRECORD *rec, UINT *row, UINT *column ) { UINT i, r = ERROR_FUNCTION_FAILED, *data;
@@ -3167,17 +3169,17 @@ static UINT table_find_row( MSITABLEVIEW *tv, MSIRECORD *rec, UINT *row, UINT *c return r; }
-typedef struct +struct transform_data { struct list entry; LPWSTR name; -} TRANSFORMDATA; +};
-static UINT table_load_transform( MSIDATABASE *db, IStorage *stg, string_table *st, TRANSFORMDATA *transform, +static UINT table_load_transform( MSIDATABASE *db, IStorage *stg, string_table *st, struct transform_data *transform, UINT bytes_per_strref, int err_cond ) { BYTE *rawdata = NULL; - MSITABLEVIEW *tv = NULL; + struct table_view *tv = NULL; UINT r, n, sz, i, mask, num_cols, colcol = 0, rawsize = 0; MSIRECORD *rec = NULL; WCHAR coltable[32]; @@ -3370,8 +3372,8 @@ UINT msi_table_apply_transform( MSIDATABASE *db, IStorage *stg, int err_cond ) { struct list transforms; IEnumSTATSTG *stgenum = NULL; - TRANSFORMDATA *transform; - TRANSFORMDATA *tables = NULL, *columns = NULL; + struct transform_data *transform; + struct transform_data *tables = NULL, *columns = NULL; HRESULT hr; STATSTG stat; string_table *strings; @@ -3394,7 +3396,7 @@ UINT msi_table_apply_transform( MSIDATABASE *db, IStorage *stg, int err_cond )
while ( TRUE ) { - MSITABLEVIEW *tv = NULL; + struct table_view *tv = NULL; WCHAR name[0x40]; ULONG count = 0;
@@ -3411,7 +3413,7 @@ UINT msi_table_apply_transform( MSIDATABASE *db, IStorage *stg, int err_cond ) !wcscmp( name+1, L"_StringData" ) ) continue;
- transform = calloc( 1, sizeof(TRANSFORMDATA) ); + transform = calloc( 1, sizeof(*transform) ); if ( !transform ) break;
@@ -3490,7 +3492,7 @@ UINT msi_table_apply_transform( MSIDATABASE *db, IStorage *stg, int err_cond )
while ( !list_empty( &transforms ) ) { - transform = LIST_ENTRY( list_head( &transforms ), TRANSFORMDATA, entry ); + transform = LIST_ENTRY( list_head( &transforms ), struct transform_data, entry );
if ( wcscmp( transform->name, L"_Columns" ) && wcscmp( transform->name, L"_Tables" ) && @@ -3517,7 +3519,7 @@ end: msi_destroy_stringtable( strings ); if (transform_view) { - struct tagMSITABLE *table = ((MSITABLEVIEW*)transform_view)->table; + struct tagMSITABLE *table = ((struct table_view *)transform_view)->table;
if (ret != ERROR_SUCCESS) transform_view->ops->release( transform_view ); diff --git a/dlls/msi/tokenize.c b/dlls/msi/tokenize.c index 3b9f98c6f17..22a905d0544 100644 --- a/dlls/msi/tokenize.c +++ b/dlls/msi/tokenize.c @@ -29,8 +29,8 @@ ** All the keywords of the SQL language are stored as in a hash ** table composed of instances of the following structure. */ -typedef struct Keyword Keyword; -struct Keyword { +struct keyword +{ const WCHAR *name; /* The keyword name */ unsigned int len; int tokenType; /* The token value for this keyword */ @@ -43,7 +43,7 @@ struct Keyword { ** They MUST be in alphabetical order */ #define X(str) str, ARRAY_SIZE(str) - 1 -static const Keyword aKeywordTable[] = { +static const struct keyword aKeywordTable[] = { { X(L"ADD"), TK_ADD }, { X(L"ALTER"), TK_ALTER }, { X(L"AND"), TK_AND }, @@ -88,7 +88,7 @@ static const Keyword aKeywordTable[] = { ** Comparison function for binary search. */ 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 );
if ((ret = wcsnicmp( k1->name, k2->name, len ))) return ret; @@ -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. */ static int sqliteKeywordCode(const WCHAR *z, int n){ - Keyword key, *r; + struct keyword key, *r;
if( n>MAX_TOKEN_LEN ) return TK_ID; @@ -111,7 +111,7 @@ static int sqliteKeywordCode(const WCHAR *z, int n){ key.tokenType = 0; key.name = z; 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 ) return r->tokenType; return TK_ID; diff --git a/dlls/msi/update.c b/dlls/msi/update.c index 3fc5b2583bb..865455b1546 100644 --- a/dlls/msi/update.c +++ b/dlls/msi/update.c @@ -38,17 +38,17 @@ WINE_DEFAULT_DEBUG_CHANNEL(msidb);
/* below is the query interface to a table */
-typedef struct tagMSIUPDATEVIEW +struct update_view { MSIVIEW view; MSIDATABASE *db; MSIVIEW *wv; column_info *vals; -} MSIUPDATEVIEW; +};
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 );
@@ -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 ) { - MSIUPDATEVIEW *uv = (MSIUPDATEVIEW*)view; + struct update_view *uv = (struct update_view *)view; UINT i, r, col_count = 0, row_count = 0; MSIRECORD *values = NULL; MSIRECORD *where = NULL; @@ -128,7 +128,7 @@ done:
static UINT UPDATE_close( struct tagMSIVIEW *view ) { - MSIUPDATEVIEW *uv = (MSIUPDATEVIEW*)view; + struct update_view *uv = (struct update_view *)view; MSIVIEW *wv;
TRACE("%p\n", uv); @@ -142,7 +142,7 @@ static UINT UPDATE_close( struct tagMSIVIEW *view )
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;
TRACE("%p %p %p\n", uv, rows, cols ); @@ -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, UINT *type, BOOL *temporary, LPCWSTR *table_name ) { - MSIUPDATEVIEW *uv = (MSIUPDATEVIEW*)view; + struct update_view *uv = (struct update_view *)view; MSIVIEW *wv;
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 static UINT UPDATE_modify( struct tagMSIVIEW *view, MSIMODIFY eModifyMode, MSIRECORD *rec, UINT row ) { - MSIUPDATEVIEW *uv = (MSIUPDATEVIEW*)view; + struct update_view *uv = (struct update_view *)view;
TRACE("%p %d %p\n", uv, eModifyMode, rec );
@@ -181,7 +181,7 @@ static UINT UPDATE_modify( struct tagMSIVIEW *view, MSIMODIFY eModifyMode,
static UINT UPDATE_delete( struct tagMSIVIEW *view ) { - MSIUPDATEVIEW *uv = (MSIUPDATEVIEW*)view; + struct update_view *uv = (struct update_view *)view; MSIVIEW *wv;
TRACE("%p\n", uv ); @@ -220,7 +220,7 @@ static const MSIVIEWOPS update_ops = UINT UPDATE_CreateView( MSIDATABASE *db, MSIVIEW **view, LPWSTR table, column_info *columns, struct expr *expr ) { - MSIUPDATEVIEW *uv = NULL; + struct update_view *uv = NULL; UINT r; MSIVIEW *sv = NULL, *wv = NULL;
diff --git a/dlls/msi/where.c b/dlls/msi/where.c index 05be5338ac6..d2183d348d4 100644 --- a/dlls/msi/where.c +++ b/dlls/msi/where.c @@ -38,20 +38,20 @@ WINE_DEFAULT_DEBUG_CHANNEL(msidb);
/* below is the query interface to a table */ -typedef struct tagMSIROWENTRY +struct row_entry { struct tagMSIWHEREVIEW *wv; /* used during sorting */ UINT values[1]; -} MSIROWENTRY; +};
-typedef struct tagJOINTABLE +struct join_table { - struct tagJOINTABLE *next; + struct join_table *next; MSIVIEW *view; UINT col_count; UINT row_count; UINT table_index; -} JOINTABLE; +};
typedef struct tagMSIORDERINFO { @@ -64,11 +64,11 @@ typedef struct tagMSIWHEREVIEW { MSIVIEW view; MSIDATABASE *db; - JOINTABLE *tables; + struct join_table *tables; UINT row_count; UINT col_count; UINT table_count; - MSIROWENTRY **reorder; + struct row_entry **reorder; UINT reorder_size; /* number of entries available in reorder */ struct expr *cond; UINT rec_index; @@ -100,7 +100,7 @@ static void free_reorder(MSIWHEREVIEW *wv)
static UINT init_reorder(MSIWHEREVIEW *wv) { - MSIROWENTRY **new = calloc(INITIAL_REORDER_SIZE, sizeof(MSIROWENTRY *)); + struct row_entry **new = calloc(INITIAL_REORDER_SIZE, sizeof(*new)); if (!new) return ERROR_OUTOFMEMORY;
@@ -124,11 +124,11 @@ static inline UINT find_row(MSIWHEREVIEW *wv, UINT row, UINT *(values[]))
static UINT add_row(MSIWHEREVIEW *wv, UINT vals[]) { - MSIROWENTRY *new; + struct row_entry *new;
if (wv->reorder_size <= wv->row_count) { - MSIROWENTRY **new_reorder; + struct row_entry **new_reorder; UINT newsize = wv->reorder_size * 2;
new_reorder = realloc(wv->reorder, newsize * sizeof(*new_reorder)); @@ -140,7 +140,7 @@ static UINT add_row(MSIWHEREVIEW *wv, UINT vals[]) wv->reorder_size = newsize; }
- new = malloc(offsetof(MSIROWENTRY, values[wv->table_count])); + new = malloc(offsetof(struct row_entry, values[wv->table_count]));
if (!new) return ERROR_OUTOFMEMORY; @@ -153,9 +153,9 @@ static UINT add_row(MSIWHEREVIEW *wv, UINT vals[]) return ERROR_SUCCESS; }
-static JOINTABLE *find_table(MSIWHEREVIEW *wv, UINT col, UINT *table_col) +static struct join_table *find_table(MSIWHEREVIEW *wv, UINT col, UINT *table_col) { - JOINTABLE *table = wv->tables; + struct join_table *table = wv->tables;
if(col == 0 || col > wv->col_count) return NULL; @@ -174,7 +174,7 @@ static JOINTABLE *find_table(MSIWHEREVIEW *wv, UINT col, UINT *table_col) static UINT parse_column(MSIWHEREVIEW *wv, union ext_column *column, UINT *column_type) { - JOINTABLE *table = wv->tables; + struct join_table *table = wv->tables; UINT i, r;
do @@ -216,7 +216,7 @@ static UINT parse_column(MSIWHEREVIEW *wv, union ext_column *column, static UINT WHERE_fetch_int( struct tagMSIVIEW *view, UINT row, UINT col, UINT *val ) { MSIWHEREVIEW *wv = (MSIWHEREVIEW*)view; - JOINTABLE *table; + struct join_table *table; UINT *rows; UINT r;
@@ -239,7 +239,7 @@ static UINT WHERE_fetch_int( struct tagMSIVIEW *view, UINT row, UINT col, UINT * static UINT WHERE_fetch_stream( struct tagMSIVIEW *view, UINT row, UINT col, IStream **stm ) { MSIWHEREVIEW *wv = (MSIWHEREVIEW*)view; - JOINTABLE *table; + struct join_table *table; UINT *rows; UINT r;
@@ -262,7 +262,7 @@ static UINT WHERE_fetch_stream( struct tagMSIVIEW *view, UINT row, UINT col, ISt static UINT WHERE_set_int(struct tagMSIVIEW *view, UINT row, UINT col, int val) { MSIWHEREVIEW *wv = (MSIWHEREVIEW*)view; - JOINTABLE *table; + struct join_table *table; UINT *rows; UINT r;
@@ -282,7 +282,7 @@ static UINT WHERE_set_int(struct tagMSIVIEW *view, UINT row, UINT col, int val) static UINT WHERE_set_string(struct tagMSIVIEW *view, UINT row, UINT col, const WCHAR *val, int len) { MSIWHEREVIEW *wv = (MSIWHEREVIEW*)view; - JOINTABLE *table; + struct join_table *table; UINT *rows; UINT r;
@@ -302,7 +302,7 @@ static UINT WHERE_set_string(struct tagMSIVIEW *view, UINT row, UINT col, const static UINT WHERE_set_stream(MSIVIEW *view, UINT row, UINT col, IStream *stream) { MSIWHEREVIEW *wv = (MSIWHEREVIEW*)view; - JOINTABLE *table; + struct join_table *table; UINT *rows; UINT r;
@@ -323,7 +323,7 @@ static UINT WHERE_set_row( struct tagMSIVIEW *view, UINT row, MSIRECORD *rec, UI { MSIWHEREVIEW *wv = (MSIWHEREVIEW*)view; UINT i, r, offset = 0; - JOINTABLE *table = wv->tables; + struct join_table *table = wv->tables; UINT *rows; UINT mask_copy = mask;
@@ -493,7 +493,7 @@ static INT INT_evaluate_binary( MSIWHEREVIEW *wv, const UINT rows[],
static inline UINT expr_fetch_value(const union ext_column *expr, const UINT rows[], UINT *val) { - JOINTABLE *table = expr->parsed.table; + struct join_table *table = expr->parsed.table;
if( rows[table->table_index] == INVALID_ROW_INDEX ) { @@ -647,7 +647,7 @@ static UINT WHERE_evaluate( MSIWHEREVIEW *wv, const UINT rows[], return ERROR_SUCCESS; }
-static UINT check_condition( MSIWHEREVIEW *wv, MSIRECORD *record, JOINTABLE **tables, +static UINT check_condition( MSIWHEREVIEW *wv, MSIRECORD *record, struct join_table **tables, UINT table_rows[] ) { UINT r = ERROR_FUNCTION_FAILED; @@ -684,8 +684,8 @@ static UINT check_condition( MSIWHEREVIEW *wv, MSIRECORD *record, JOINTABLE **ta
static int __cdecl compare_entry( const void *left, const void *right ) { - const MSIROWENTRY *le = *(const MSIROWENTRY**)left; - const MSIROWENTRY *re = *(const MSIROWENTRY**)right; + const struct row_entry *le = *(const struct row_entry **)left; + const struct row_entry *re = *(const struct row_entry **)right; const MSIWHEREVIEW *wv = le->wv; MSIORDERINFO *order = wv->order_info; UINT i, j, r, l_val, r_val; @@ -729,7 +729,7 @@ static int __cdecl compare_entry( const void *left, const void *right ) return 0; }
-static void add_to_array( JOINTABLE **array, JOINTABLE *elem ) +static void add_to_array( struct join_table **array, struct join_table *elem ) { while (*array && *array != elem) array++; @@ -737,7 +737,7 @@ static void add_to_array( JOINTABLE **array, JOINTABLE *elem ) *array = elem; }
-static BOOL in_array( JOINTABLE **array, JOINTABLE *elem ) +static BOOL in_array( struct join_table **array, struct join_table *elem ) { while (*array && *array != elem) array++; @@ -748,8 +748,8 @@ static BOOL in_array( JOINTABLE **array, JOINTABLE *elem ) #define JOIN_TO_CONST_EXPR 0x10000 /* comparison to a table involved with a CONST_EXPR comaprison */
-static UINT reorder_check( const struct expr *expr, JOINTABLE **ordered_tables, - BOOL process_joins, JOINTABLE **lastused ) +static UINT reorder_check( const struct expr *expr, struct join_table **ordered_tables, + BOOL process_joins, struct join_table **lastused ) { UINT res = 0;
@@ -787,10 +787,9 @@ static UINT reorder_check( const struct expr *expr, JOINTABLE **ordered_tables, }
/* reorders the tablelist in a way to evaluate the condition as fast as possible */ -static JOINTABLE **ordertables( MSIWHEREVIEW *wv ) +static struct join_table **ordertables( MSIWHEREVIEW *wv ) { - JOINTABLE *table; - JOINTABLE **tables; + struct join_table *table, **tables;
tables = calloc(wv->table_count + 1, sizeof(*tables));
@@ -815,9 +814,9 @@ static UINT WHERE_execute( struct tagMSIVIEW *view, MSIRECORD *record ) { MSIWHEREVIEW *wv = (MSIWHEREVIEW*)view; UINT r; - JOINTABLE *table = wv->tables; + struct join_table *table = wv->tables; UINT *rows; - JOINTABLE **ordered_tables; + struct join_table **ordered_tables; UINT i = 0;
TRACE("%p %p\n", wv, record); @@ -857,7 +856,7 @@ static UINT WHERE_execute( struct tagMSIVIEW *view, MSIRECORD *record ) if (wv->order_info) wv->order_info->error = ERROR_SUCCESS;
- qsort(wv->reorder, wv->row_count, sizeof(MSIROWENTRY *), compare_entry); + qsort(wv->reorder, wv->row_count, sizeof(struct row_entry *), compare_entry);
if (wv->order_info) r = wv->order_info->error; @@ -870,7 +869,7 @@ static UINT WHERE_execute( struct tagMSIVIEW *view, MSIRECORD *record ) static UINT WHERE_close( struct tagMSIVIEW *view ) { MSIWHEREVIEW *wv = (MSIWHEREVIEW*)view; - JOINTABLE *table = wv->tables; + struct join_table *table = wv->tables;
TRACE("%p\n", wv );
@@ -910,7 +909,7 @@ static UINT WHERE_get_column_info( struct tagMSIVIEW *view, UINT n, LPCWSTR *nam UINT *type, BOOL *temporary, LPCWSTR *table_name ) { MSIWHEREVIEW *wv = (MSIWHEREVIEW*)view; - JOINTABLE *table; + struct join_table *table;
TRACE("%p %d %p %p %p %p\n", wv, n, name, type, temporary, table_name );
@@ -980,7 +979,7 @@ static UINT WHERE_modify( struct tagMSIVIEW *view, MSIMODIFY eModifyMode, MSIRECORD *rec, UINT row ) { MSIWHEREVIEW *wv = (MSIWHEREVIEW*)view; - JOINTABLE *table = wv->tables; + struct join_table *table = wv->tables; UINT r;
TRACE("%p %d %p\n", wv, eModifyMode, rec); @@ -1035,13 +1034,13 @@ static UINT WHERE_modify( struct tagMSIVIEW *view, MSIMODIFY eModifyMode, static UINT WHERE_delete( struct tagMSIVIEW *view ) { MSIWHEREVIEW *wv = (MSIWHEREVIEW*)view; - JOINTABLE *table = wv->tables; + struct join_table *table = wv->tables;
TRACE("%p\n", wv );
while(table) { - JOINTABLE *next; + struct join_table *next;
table->view->ops->delete(table->view); table->view = NULL; @@ -1066,7 +1065,7 @@ static UINT WHERE_delete( struct tagMSIVIEW *view ) static UINT WHERE_sort(struct tagMSIVIEW *view, column_info *columns) { MSIWHEREVIEW *wv = (MSIWHEREVIEW *)view; - JOINTABLE *table = wv->tables; + struct join_table *table = wv->tables; column_info *column = columns; MSIORDERINFO *orderinfo; UINT r, count = 0; @@ -1245,12 +1244,12 @@ UINT WHERE_CreateView( MSIDATABASE *db, MSIVIEW **view, LPWSTR tables,
while (*tables) { - JOINTABLE *table; + struct join_table *table;
if ((ptr = wcschr(tables, ' '))) *ptr = '\0';
- table = malloc(sizeof(JOINTABLE)); + table = malloc(sizeof(*table)); if (!table) { r = ERROR_OUTOFMEMORY;