From 75658d7aaaa967c32a51941f0c895a5fb9e54dc0 Mon Sep 17 00:00:00 2001 From: Mike McCormack Date: Thu, 22 Sep 2005 10:33:57 +0000 Subject: [PATCH] Make build_icon_path return the path directly. --- dlls/msi/action.c | 14 +++++++------- dlls/msi/action.h | 2 +- dlls/msi/classes.c | 11 +++++------ dlls/msi/helpers.c | 10 ++++------ 4 files changed, 17 insertions(+), 20 deletions(-) diff --git a/dlls/msi/action.c b/dlls/msi/action.c index f5c0068dc47..21958fdff47 100644 --- a/dlls/msi/action.c +++ b/dlls/msi/action.c @@ -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); diff --git a/dlls/msi/action.h b/dlls/msi/action.h index c990e4234a0..d2e03e2af7f 100644 --- a/dlls/msi/action.h +++ b/dlls/msi/action.h @@ -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); diff --git a/dlls/msi/classes.c b/dlls/msi/classes.c index 6fc2cd843d5..c83453131cd 100644 --- a/dlls/msi/classes.c +++ b/dlls/msi/classes.c @@ -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); } } diff --git a/dlls/msi/helpers.c b/dlls/msi/helpers.c index ba253620823..64ffbf8e899 100644 --- a/dlls/msi/helpers.c +++ b/dlls/msi/helpers.c @@ -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)