msi: Remove msi_ prefix from static functions.

This commit is contained in:
Hans Leidekker 2023-01-02 15:56:05 +01:00 committed by Alexandre Julliard
parent d9d700f332
commit 3611398b75
16 changed files with 712 additions and 774 deletions

View file

@ -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 )
{
BOOL ret;
msi_disable_fs_redirection( package );
ret = BindImage( filename, path, NULL );
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() );
}
msi_disable_fs_redirection( package );
if (!BindImage( filename, path, NULL )) WARN( "failed to bind image %lu\n", GetLastError() );
msi_revert_fs_redirection( package );
}
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

View file

@ -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)

View file

@ -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;
}

File diff suppressed because it is too large Load diff

View file

@ -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)

View file

@ -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;
}

View file

@ -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;

View file

@ -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;

View file

@ -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;

View file

@ -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

View file

@ -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);

View file

@ -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)
{

View file

@ -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 );
}

View file

@ -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;

View file

@ -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;
}

View file

@ -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 );