Commit 75658d7a authored by Mike McCormack's avatar Mike McCormack Committed by Alexandre Julliard

Make build_icon_path return the path directly.

parent 9f1c6de1
......@@ -2815,12 +2815,12 @@ static UINT ITERATE_CreateShortcuts(MSIRECORD *row, LPVOID param)
if (!MSI_RecordIsNull(row,9))
{
WCHAR *Path = NULL;
LPWSTR Path;
INT index;
buffer = MSI_RecordGetString(row,9);
build_icon_path(package,buffer,&Path);
Path = build_icon_path(package,buffer);
index = MSI_RecordGetInteger(row,10);
IShellLinkW_SetIconLocation(sl,Path,index);
......@@ -2885,8 +2885,8 @@ static UINT ITERATE_PublishProduct(MSIRECORD *row, LPVOID param)
{
MSIPACKAGE* package = (MSIPACKAGE*)param;
HANDLE the_file;
LPWSTR FilePath=NULL;
LPCWSTR FileName=NULL;
LPWSTR FilePath;
LPCWSTR FileName;
CHAR buffer[1024];
DWORD sz;
UINT rc;
......@@ -2898,7 +2898,7 @@ static UINT ITERATE_PublishProduct(MSIRECORD *row, LPVOID param)
return ERROR_SUCCESS;
}
build_icon_path(package,FileName,&FilePath);
FilePath = build_icon_path(package,FileName);
TRACE("Creating icon file at %s\n",debugstr_w(FilePath));
......@@ -2995,9 +2995,9 @@ static UINT ACTION_PublishProduct(MSIPACKAGE *package)
buffer = msi_dup_property( package, szARPProductIcon );
if (buffer)
{
LPWSTR path;
build_icon_path(package,buffer,&path);
LPWSTR path = build_icon_path(package,buffer);
msi_reg_set_val_str( hukey, INSTALLPROPERTY_PRODUCTICONW, path );
msi_free( path );
}
msi_free(buffer);
......
......@@ -260,7 +260,7 @@ extern MSIFILE *get_loaded_file( MSIPACKAGE* package, LPCWSTR file );
extern MSIFOLDER *get_loaded_folder( MSIPACKAGE *package, LPCWSTR dir );
extern int track_tempfile(MSIPACKAGE *package, LPCWSTR name, LPCWSTR path);
extern UINT schedule_action(MSIPACKAGE *package, UINT script, LPCWSTR action);
extern UINT build_icon_path(MSIPACKAGE *, LPCWSTR, LPWSTR *);
extern LPWSTR build_icon_path(MSIPACKAGE *, LPCWSTR);
extern DWORD build_version_dword(LPCWSTR);
extern LPWSTR build_directory_name(DWORD , ...);
extern BOOL create_full_pathW(const WCHAR *path);
......
......@@ -153,7 +153,7 @@ static MSIPROGID *load_progid( MSIPACKAGE* package, MSIRECORD *row )
LPWSTR FilePath;
static const WCHAR fmt[] = {'%','s',',','%','i',0};
build_icon_path(package,FileName,&FilePath);
FilePath = build_icon_path(package,FileName);
progid->IconPath = msi_alloc( (strlenW(FilePath)+10)* sizeof(WCHAR) );
......@@ -166,7 +166,7 @@ static MSIPROGID *load_progid( MSIPACKAGE* package, MSIRECORD *row )
{
buffer = MSI_RecordGetString(row,5);
if (buffer)
build_icon_path(package,buffer,&(progid->IconPath));
progid->IconPath = build_icon_path(package,buffer);
}
progid->CurVer = NULL;
......@@ -260,7 +260,7 @@ static MSICLASS *load_class( MSIPACKAGE* package, MSIRECORD *row )
LPWSTR FilePath;
static const WCHAR fmt[] = {'%','s',',','%','i',0};
build_icon_path(package,FileName,&FilePath);
FilePath = build_icon_path(package,FileName);
cls->IconPath = msi_alloc( (strlenW(FilePath)+5)* sizeof(WCHAR) );
......@@ -273,7 +273,7 @@ static MSICLASS *load_class( MSIPACKAGE* package, MSIRECORD *row )
{
buffer = MSI_RecordGetString(row,8);
if (buffer)
build_icon_path(package,buffer,&(cls->IconPath));
cls->IconPath = build_icon_path(package,buffer);
}
if (!MSI_RecordIsNull(row,10))
......@@ -300,8 +300,7 @@ static MSICLASS *load_class( MSIPACKAGE* package, MSIRECORD *row )
}
else
{
cls->DefInprocHandler32 = load_dynamic_stringW(
row, 10);
cls->DefInprocHandler32 = load_dynamic_stringW( row, 10);
reduce_to_longfilename(cls->DefInprocHandler32);
}
}
......
......@@ -84,11 +84,9 @@ DWORD build_version_dword(LPCWSTR version_string)
return rc;
}
UINT build_icon_path(MSIPACKAGE *package, LPCWSTR icon_name,
LPWSTR *FilePath)
LPWSTR build_icon_path(MSIPACKAGE *package, LPCWSTR icon_name )
{
LPWSTR SystemFolder;
LPWSTR dest;
LPWSTR SystemFolder, dest, FilePath;
static const WCHAR szInstaller[] =
{'M','i','c','r','o','s','o','f','t','\\',
......@@ -102,11 +100,11 @@ UINT build_icon_path(MSIPACKAGE *package, LPCWSTR icon_name,
create_full_pathW(dest);
*FilePath = build_directory_name(2, dest, icon_name);
FilePath = build_directory_name(2, dest, icon_name);
msi_free(SystemFolder);
msi_free(dest);
return ERROR_SUCCESS;
return FilePath;
}
WCHAR *load_dynamic_stringW(MSIRECORD *row, INT index)
......
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