Commit 062ad505 authored by Mike McCormack's avatar Mike McCormack Committed by Alexandre Julliard

Rename load_dynamic_property and remove its unused 3rd argument.

parent 9f498891
......@@ -475,7 +475,7 @@ UINT ACTION_DoTopLevelINSTALL(MSIPACKAGE *package, LPCWSTR szPackagePath,
strcatW(path,cszbs);
}
check = load_dynamic_property(package, cszSourceDir,NULL);
check = msi_dup_property( package, cszSourceDir );
if (!check)
MSI_SetPropertyW(package, cszSourceDir, path);
HeapFree(GetProcessHeap(), 0, check);
......@@ -1355,7 +1355,7 @@ static MSIFOLDER *load_folder( MSIPACKAGE *package, LPCWSTR dir )
ERR("failed to load parent folder %s\n", debugstr_w(parent));
}
folder->Property = load_dynamic_property( package, dir, NULL );
folder->Property = msi_dup_property( package, dir );
msiobj_release(&row->hdr);
......@@ -1413,7 +1413,7 @@ static BOOL process_state_property (MSIPACKAGE* package, LPCWSTR property,
LPWSTR override;
MSIFEATURE *feature;
override = load_dynamic_property(package, property, NULL);
override = msi_dup_property( package, property );
if (!override)
return FALSE;
......@@ -1472,7 +1472,7 @@ static UINT SetFeatureStates(MSIPACKAGE *package)
TRACE("Checking Install Level\n");
level = load_dynamic_property(package,szlevel,NULL);
level = msi_dup_property( package, szlevel );
if (level)
{
install_level = atoiW(level);
......@@ -1800,7 +1800,7 @@ static UINT ACTION_CostFinalize(MSIPACKAGE *package)
MSI_SetPropertyW(package,szCosting,szOne);
/* set default run level if not set */
level = load_dynamic_property(package,szlevel,NULL);
level = msi_dup_property( package, szlevel );
if (!level)
MSI_SetPropertyW(package,szlevel, szOne);
HeapFree(GetProcessHeap(),0,level);
......@@ -1992,7 +1992,7 @@ static UINT ITERATE_WriteRegistryValues(MSIRECORD *row, LPVOID param)
case -1:
{
static const WCHAR szALLUSER[] = {'A','L','L','U','S','E','R','S',0};
LPWSTR all_users = load_dynamic_property(package, szALLUSER, NULL);
LPWSTR all_users = msi_dup_property( package, szALLUSER );
if (all_users && all_users[0] == '1')
{
root_key = HKEY_LOCAL_MACHINE;
......@@ -2971,16 +2971,16 @@ static UINT ACTION_PublishProduct(MSIPACKAGE *package)
goto end;
buffer = load_dynamic_property(package,INSTALLPROPERTY_PRODUCTNAMEW,NULL);
buffer = msi_dup_property( package, INSTALLPROPERTY_PRODUCTNAMEW );
msi_reg_set_val_str( hukey, INSTALLPROPERTY_PRODUCTNAMEW, buffer );
HeapFree(GetProcessHeap(),0,buffer);
buffer = load_dynamic_property(package,szProductLanguage,NULL);
buffer = msi_dup_property( package, szProductLanguage );
langid = atoiW(buffer);
msi_reg_set_val_dword( hkey, INSTALLPROPERTY_LANGUAGEW, langid );
HeapFree(GetProcessHeap(),0,buffer);
buffer = load_dynamic_property(package,szARPProductIcon,NULL);
buffer = msi_dup_property( package, szARPProductIcon );
if (buffer)
{
LPWSTR path;
......@@ -2989,7 +2989,7 @@ static UINT ACTION_PublishProduct(MSIPACKAGE *package)
}
HeapFree(GetProcessHeap(),0,buffer);
buffer = load_dynamic_property(package,szProductVersion,NULL);
buffer = msi_dup_property( package, szProductVersion );
if (buffer)
{
DWORD verdword = build_version_dword(buffer);
......@@ -3081,10 +3081,10 @@ static UINT ITERATE_WriteIniValues(MSIRECORD *row, LPVOID param)
{
folder = resolve_folder(package, dirproperty, FALSE, FALSE, NULL);
if (!folder)
folder = load_dynamic_property(package,dirproperty,NULL);
folder = msi_dup_property( package, dirproperty );
}
else
folder = load_dynamic_property(package, szWindowsFolder, NULL);
folder = msi_dup_property( package, szWindowsFolder );
if (!folder)
{
......@@ -3402,7 +3402,7 @@ static UINT ACTION_RegisterProduct(MSIPACKAGE *package)
for( i=0; szPropKeys[i][0]; i++ )
{
buffer = load_dynamic_property( package, szPropKeys[i], NULL);
buffer = msi_dup_property( package, szPropKeys[i] );
msi_reg_set_val_str( hkey, szRegKeys[i], buffer );
HeapFree(GetProcessHeap(),0,buffer);
i++;
......@@ -3459,11 +3459,11 @@ static UINT ACTION_RegisterProduct(MSIPACKAGE *package)
msi_reg_set_val_str( hkey, INSTALLPROPERTY_INSTALLDATEW, buffer );
HeapFree(GetProcessHeap(),0,buffer);
buffer = load_dynamic_property(package,szProductLanguage,NULL);
buffer = msi_dup_property( package, szProductLanguage );
msi_reg_set_val_dword( hkey, INSTALLPROPERTY_LANGUAGEW, atoiW(buffer) );
HeapFree(GetProcessHeap(),1,buffer);
buffer = load_dynamic_property(package,szProductVersion,NULL);
buffer = msi_dup_property( package, szProductVersion );
if (buffer)
{
DWORD verdword = build_version_dword(buffer);
......@@ -3475,7 +3475,7 @@ static UINT ACTION_RegisterProduct(MSIPACKAGE *package)
HeapFree(GetProcessHeap(),0,buffer);
/* Handle Upgrade Codes */
upgrade_code = load_dynamic_property(package,szUpgradeCode, NULL);
upgrade_code = msi_dup_property( package, szUpgradeCode );
if (upgrade_code)
{
HKEY hkey2;
......@@ -3660,7 +3660,7 @@ static UINT ACTION_RegisterUser(MSIPACKAGE *package)
if (!package)
return ERROR_INVALID_HANDLE;
productid = load_dynamic_property(package,INSTALLPROPERTY_PRODUCTIDW, &rc);
productid = msi_dup_property( package, INSTALLPROPERTY_PRODUCTIDW );
if (!productid)
return ERROR_SUCCESS;
......@@ -3671,7 +3671,7 @@ static UINT ACTION_RegisterUser(MSIPACKAGE *package)
i = 0;
while (szPropKeys[i][0]!=0)
{
buffer = load_dynamic_property( package, szPropKeys[i], NULL );
buffer = msi_dup_property( package, szPropKeys[i] );
msi_reg_set_val_str( hkey, szRegKeys[i], buffer );
i++;
}
......@@ -3690,7 +3690,7 @@ static UINT ACTION_ExecuteAction(MSIPACKAGE *package)
static const WCHAR szTwo[] = {'2',0};
UINT rc;
LPWSTR level;
level = load_dynamic_property(package,szUILevel,NULL);
level = msi_dup_property( package, szUILevel );
MSI_SetPropertyW(package,szUILevel,szTwo);
package->script->InWhatSequence |= SEQUENCE_EXEC;
......
......@@ -251,7 +251,7 @@ extern UINT ACTION_RegisterMIMEInfo(MSIPACKAGE *package);
/* Helpers */
extern DWORD deformat_string(MSIPACKAGE *package, LPCWSTR ptr, WCHAR** data );
extern WCHAR *load_dynamic_stringW(MSIRECORD *row, INT index);
extern LPWSTR load_dynamic_property(MSIPACKAGE *package, LPCWSTR prop, UINT* rc);
extern LPWSTR msi_dup_property(MSIPACKAGE *package, LPCWSTR prop);
extern LPWSTR resolve_folder(MSIPACKAGE *package, LPCWSTR name, BOOL source,
BOOL set_prop, MSIFOLDER **folder);
extern MSICOMPONENT *get_loaded_component( MSIPACKAGE* package, LPCWSTR Component );
......
......@@ -184,7 +184,7 @@ UINT ACTION_CustomAction(MSIPACKAGE *package,LPCWSTR action, BOOL execute)
static const WCHAR szActionData[] = {
'C','u','s','t','o','m','A','c','t','i','o','n','D','a','t','a',0};
static const WCHAR szBlank[] = {0};
LPWSTR actiondata = load_dynamic_property(package,action,NULL);
LPWSTR actiondata = msi_dup_property( package, action );
if (actiondata)
MSI_SetPropertyW(package,szActionData,actiondata);
else
......@@ -667,13 +667,12 @@ static UINT HANDLE_CustomType50(MSIPACKAGE *package, LPCWSTR source,
WCHAR *deformated;
WCHAR *cmd;
INT len;
UINT prc;
static const WCHAR spc[] = {' ',0};
memset(&si,0,sizeof(STARTUPINFOW));
memset(&info,0,sizeof(PROCESS_INFORMATION));
prop = load_dynamic_property(package,source,&prc);
prop = msi_dup_property( package, source );
if (!prop)
return ERROR_SUCCESS;
......@@ -707,10 +706,7 @@ static UINT HANDLE_CustomType50(MSIPACKAGE *package, LPCWSTR source,
return ERROR_SUCCESS;
}
prc = process_handle(package, type, info.hThread, info.hProcess, action,
NULL);
return prc;
return process_handle(package, type, info.hThread, info.hProcess, action, NULL);
}
static UINT HANDLE_CustomType34(MSIPACKAGE *package, LPCWSTR source,
......
......@@ -628,7 +628,7 @@ static LPWSTR msi_get_checkbox_value( msi_dialog *dialog, LPCWSTR prop )
if (ret)
return ret;
ret = load_dynamic_property(dialog->package, prop, NULL);
ret = msi_dup_property( dialog->package, prop );
if( ret && !ret[0] )
{
HeapFree( GetProcessHeap(), 0, ret );
......@@ -799,7 +799,7 @@ static UINT msi_dialog_edit_control( msi_dialog *dialog, MSIRECORD *rec )
prop = MSI_RecordGetString( rec, 9 );
if( prop )
control->property = strdupW( prop );
val = load_dynamic_property( dialog->package, control->property, NULL );
val = msi_dup_property( dialog->package, control->property );
SetWindowTextW( control->hwnd, val );
HeapFree( GetProcessHeap(), 0, val );
return ERROR_SUCCESS;
......@@ -1041,7 +1041,7 @@ static UINT msi_dialog_maskedit_control( msi_dialog *dialog, MSIRECORD *rec )
msi_control *control;
LPCWSTR prop;
mask = load_dynamic_property( dialog->package, pidt, NULL );
mask = msi_dup_property( dialog->package, pidt );
if( !mask )
{
ERR("PIDTemplate is empty\n");
......@@ -1082,7 +1082,7 @@ static UINT msi_dialog_maskedit_control( msi_dialog *dialog, MSIRECORD *rec )
if( prop )
{
val = load_dynamic_property( dialog->package, prop, NULL );
val = msi_dup_property( dialog->package, prop );
if( val )
{
msi_maskedit_set_text( info, val );
......@@ -1448,7 +1448,7 @@ static LRESULT msi_dialog_oncreate( HWND hwnd, LPCREATESTRUCTW cs )
dialog->attributes = MSI_RecordGetInteger( rec, 6 );
text = MSI_RecordGetString( rec, 7 );
dialog->default_font = load_dynamic_property( dialog->package, df, NULL );
dialog->default_font = msi_dup_property( dialog->package, df );
deformat_string( dialog->package, text, &title );
SetWindowTextW( hwnd, title );
......
......@@ -235,7 +235,7 @@ static UINT ControlEvent_AddSource(MSIPACKAGE* package, LPCWSTR argument,
static UINT ControlEvent_SetTargetPath(MSIPACKAGE* package, LPCWSTR argument,
msi_dialog* dialog)
{
LPWSTR path = load_dynamic_property(package,argument, NULL);
LPWSTR path = msi_dup_property( package, argument );
UINT r;
/* failure to set the path halts the executing of control events */
r = MSI_SetTargetPathW(package, argument, path);
......
......@@ -529,7 +529,7 @@ static UINT ready_media_for_file(MSIPACKAGE *package, MSIFILE *file,
last_path = strdupW(source);
*(strrchrW(last_path,'\\')+1)=0;
path = load_dynamic_property(package,cszSourceDir,NULL);
path = msi_dup_property( package, cszSourceDir );
MsiSourceListAddMediaDiskW(package->ProductCode, NULL,
MSIINSTALLCONTEXT_USERMANAGED, MSICODE_PRODUCT, count,
......@@ -837,7 +837,7 @@ static UINT ITERATE_DuplicateFiles(MSIRECORD *row, LPVOID param)
if (!dest_path)
{
/* try a Property */
dest_path = load_dynamic_property(package, destkey, NULL);
dest_path = msi_dup_property( package, destkey );
if (!dest_path)
{
FIXME("Unable to get destination folder, try AppSearch properties\n");
......
......@@ -219,15 +219,14 @@ static LPWSTR deformat_index(MSIRECORD* record, LPCWSTR key, DWORD* chunk )
static LPWSTR deformat_property(MSIPACKAGE* package, LPCWSTR key, DWORD* chunk)
{
UINT rc;
LPWSTR value;
if (!package)
return NULL;
value = load_dynamic_property(package,key, &rc);
value = msi_dup_property( package, key );
if (rc == ERROR_SUCCESS)
if (value)
*chunk = (strlenW(value)) * sizeof(WCHAR);
return value;
......
......@@ -96,7 +96,7 @@ UINT build_icon_path(MSIPACKAGE *package, LPCWSTR icon_name,
static const WCHAR szFolder[] =
{'A','p','p','D','a','t','a','F','o','l','d','e','r',0};
SystemFolder = load_dynamic_property(package,szFolder,NULL);
SystemFolder = msi_dup_property( package, szFolder );
dest = build_directory_name(3, SystemFolder, szInstaller, package->ProductCode);
......@@ -141,7 +141,7 @@ WCHAR *load_dynamic_stringW(MSIRECORD *row, INT index)
return ret;
}
LPWSTR load_dynamic_property(MSIPACKAGE *package, LPCWSTR prop, UINT* rc)
LPWSTR msi_dup_property(MSIPACKAGE *package, LPCWSTR prop)
{
DWORD sz = 0;
LPWSTR str;
......@@ -149,11 +149,8 @@ LPWSTR load_dynamic_property(MSIPACKAGE *package, LPCWSTR prop, UINT* rc)
r = MSI_GetPropertyW(package, prop, NULL, &sz);
if (r != ERROR_SUCCESS && r != ERROR_MORE_DATA)
{
if (rc)
*rc = r;
return NULL;
}
sz++;
str = HeapAlloc(GetProcessHeap(),0,sz*sizeof(WCHAR));
r = MSI_GetPropertyW(package, prop, str, &sz);
......@@ -162,8 +159,6 @@ LPWSTR load_dynamic_property(MSIPACKAGE *package, LPCWSTR prop, UINT* rc)
HeapFree(GetProcessHeap(),0,str);
str = NULL;
}
if (rc)
*rc = r;
return str;
}
......@@ -264,10 +259,10 @@ LPWSTR resolve_folder(MSIPACKAGE *package, LPCWSTR name, BOOL source,
if (!source)
{
LPWSTR check_path;
check_path = load_dynamic_property(package,cszTargetDir,NULL);
check_path = msi_dup_property( package, cszTargetDir );
if (!check_path)
{
check_path = load_dynamic_property(package,cszRootDrive,NULL);
check_path = msi_dup_property( package, cszRootDrive );
if (set_prop)
MSI_SetPropertyW(package,cszTargetDir,check_path);
}
......@@ -280,10 +275,10 @@ LPWSTR resolve_folder(MSIPACKAGE *package, LPCWSTR name, BOOL source,
}
else
{
path = load_dynamic_property(package,cszSourceDir,NULL);
path = msi_dup_property( package, cszSourceDir );
if (!path)
{
path = load_dynamic_property(package,cszDatabase,NULL);
path = msi_dup_property( package, cszDatabase );
if (path)
{
p = strrchrW(path,'\\');
......
......@@ -678,7 +678,7 @@ LANGID WINAPI MsiGetLanguage(MSIHANDLE hInstall)
if (!package)
return ERROR_INVALID_HANDLE;
buffer = load_dynamic_property(package,szProductLanguage,NULL);
buffer = msi_dup_property( package, szProductLanguage );
langid = atoiW(buffer);
HeapFree(GetProcessHeap(),0,buffer);
......
......@@ -68,7 +68,7 @@ static void append_productcode(MSIPACKAGE* package, LPCWSTR action_property,
DWORD len;
static const WCHAR separator[] = {';',0};
prop = load_dynamic_property(package, action_property, NULL);
prop = msi_dup_property(package, action_property );
if (prop)
len = strlenW(prop);
else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment