Commit e18f8abe authored by Mike McCormack's avatar Mike McCormack Committed by Alexandre Julliard

- build a standard Wine list of files instead of using an array

- use file pointers instead of array indexes
parent 625d872b
...@@ -93,6 +93,7 @@ typedef struct tagMSIFOLDER ...@@ -93,6 +93,7 @@ typedef struct tagMSIFOLDER
typedef struct tagMSIFILE typedef struct tagMSIFILE
{ {
struct list entry;
LPWSTR File; LPWSTR File;
MSICOMPONENT *Component; MSICOMPONENT *Component;
LPWSTR FileName; LPWSTR FileName;
...@@ -237,8 +238,8 @@ LPWSTR load_dynamic_property(MSIPACKAGE *package, LPCWSTR prop, UINT* rc); ...@@ -237,8 +238,8 @@ LPWSTR load_dynamic_property(MSIPACKAGE *package, LPCWSTR prop, UINT* rc);
LPWSTR resolve_folder(MSIPACKAGE *package, LPCWSTR name, BOOL source, LPWSTR resolve_folder(MSIPACKAGE *package, LPCWSTR name, BOOL source,
BOOL set_prop, MSIFOLDER **folder); BOOL set_prop, MSIFOLDER **folder);
MSICOMPONENT *get_loaded_component( MSIPACKAGE* package, LPCWSTR Component ); MSICOMPONENT *get_loaded_component( MSIPACKAGE* package, LPCWSTR Component );
MSIFEATURE *get_loaded_feature(MSIPACKAGE* package, LPCWSTR Feature ); MSIFEATURE *get_loaded_feature( MSIPACKAGE* package, LPCWSTR Feature );
int get_loaded_file(MSIPACKAGE* package, LPCWSTR file); MSIFILE *get_loaded_file( MSIPACKAGE* package, LPCWSTR file );
int track_tempfile(MSIPACKAGE *package, LPCWSTR name, LPCWSTR path); int track_tempfile(MSIPACKAGE *package, LPCWSTR name, LPCWSTR path);
UINT schedule_action(MSIPACKAGE *package, UINT script, LPCWSTR action); UINT schedule_action(MSIPACKAGE *package, UINT script, LPCWSTR action);
UINT build_icon_path(MSIPACKAGE *, LPCWSTR, LPWSTR *); UINT build_icon_path(MSIPACKAGE *, LPCWSTR, LPWSTR *);
......
...@@ -918,7 +918,7 @@ UINT ACTION_RegisterClassInfo(MSIPACKAGE *package) ...@@ -918,7 +918,7 @@ UINT ACTION_RegisterClassInfo(MSIPACKAGE *package)
for (i = 0; i < package->loaded_classes; i++) for (i = 0; i < package->loaded_classes; i++)
{ {
MSICOMPONENT *comp; MSICOMPONENT *comp;
INT index; MSIFILE *file;
DWORD size, sz; DWORD size, sz;
LPWSTR argument; LPWSTR argument;
MSIFEATURE *feature; MSIFEATURE *feature;
...@@ -959,7 +959,7 @@ UINT ACTION_RegisterClassInfo(MSIPACKAGE *package) ...@@ -959,7 +959,7 @@ UINT ACTION_RegisterClassInfo(MSIPACKAGE *package)
Description)+1)*sizeof(WCHAR)); Description)+1)*sizeof(WCHAR));
RegCreateKeyW(hkey2,package->classes[i].Context,&hkey3); RegCreateKeyW(hkey2,package->classes[i].Context,&hkey3);
index = get_loaded_file( package, comp->KeyPath ); file = get_loaded_file( package, comp->KeyPath );
/* the context server is a short path name /* the context server is a short path name
...@@ -968,7 +968,7 @@ UINT ACTION_RegisterClassInfo(MSIPACKAGE *package) ...@@ -968,7 +968,7 @@ UINT ACTION_RegisterClassInfo(MSIPACKAGE *package)
if (strcmpiW(package->classes[i].Context,szInprocServer32)!=0) if (strcmpiW(package->classes[i].Context,szInprocServer32)!=0)
{ {
sz = 0; sz = 0;
sz = GetShortPathNameW(package->files[index].TargetPath, NULL, 0); sz = GetShortPathNameW( file->TargetPath, NULL, 0 );
if (sz == 0) if (sz == 0)
{ {
ERR("Unable to find short path for CLSID COM Server\n"); ERR("Unable to find short path for CLSID COM Server\n");
...@@ -986,8 +986,7 @@ UINT ACTION_RegisterClassInfo(MSIPACKAGE *package) ...@@ -986,8 +986,7 @@ UINT ACTION_RegisterClassInfo(MSIPACKAGE *package)
} }
argument = HeapAlloc(GetProcessHeap(), 0, size + sizeof(WCHAR)); argument = HeapAlloc(GetProcessHeap(), 0, size + sizeof(WCHAR));
GetShortPathNameW(package->files[index].TargetPath, argument, GetShortPathNameW( file->TargetPath, argument, sz );
sz);
if (package->classes[i].Argument) if (package->classes[i].Argument)
{ {
...@@ -998,7 +997,7 @@ UINT ACTION_RegisterClassInfo(MSIPACKAGE *package) ...@@ -998,7 +997,7 @@ UINT ACTION_RegisterClassInfo(MSIPACKAGE *package)
} }
else else
{ {
size = lstrlenW(package->files[index].TargetPath) * sizeof(WCHAR); size = lstrlenW( file->TargetPath ) * sizeof(WCHAR);
if (package->classes[i].Argument) if (package->classes[i].Argument)
{ {
...@@ -1007,7 +1006,7 @@ UINT ACTION_RegisterClassInfo(MSIPACKAGE *package) ...@@ -1007,7 +1006,7 @@ UINT ACTION_RegisterClassInfo(MSIPACKAGE *package)
} }
argument = HeapAlloc(GetProcessHeap(), 0, size + sizeof(WCHAR)); argument = HeapAlloc(GetProcessHeap(), 0, size + sizeof(WCHAR));
strcpyW(argument, package->files[index].TargetPath); strcpyW( argument, file->TargetPath );
if (package->classes[i].Argument) if (package->classes[i].Argument)
{ {
......
...@@ -586,14 +586,16 @@ static UINT HANDLE_CustomType18(MSIPACKAGE *package, LPCWSTR source, ...@@ -586,14 +586,16 @@ static UINT HANDLE_CustomType18(MSIPACKAGE *package, LPCWSTR source,
WCHAR *cmd; WCHAR *cmd;
INT len; INT len;
static const WCHAR spc[] = {' ',0}; static const WCHAR spc[] = {' ',0};
int index; MSIFILE *file;
UINT prc; UINT prc;
memset(&si,0,sizeof(STARTUPINFOW)); memset(&si,0,sizeof(STARTUPINFOW));
index = get_loaded_file(package,source); file = get_loaded_file(package,source);
if( !file )
return ERROR_FUNCTION_FAILED;
len = strlenW(package->files[index].TargetPath); len = lstrlenW( file->TargetPath );
deformat_string(package,target,&deformated); deformat_string(package,target,&deformated);
if (deformated) if (deformated)
...@@ -602,7 +604,7 @@ static UINT HANDLE_CustomType18(MSIPACKAGE *package, LPCWSTR source, ...@@ -602,7 +604,7 @@ static UINT HANDLE_CustomType18(MSIPACKAGE *package, LPCWSTR source,
cmd = HeapAlloc(GetProcessHeap(),0,len * sizeof(WCHAR)); cmd = HeapAlloc(GetProcessHeap(),0,len * sizeof(WCHAR));
strcpyW(cmd, package->files[index].TargetPath); lstrcpyW( cmd, file->TargetPath);
if (deformated) if (deformated)
{ {
strcatW(cmd, spc); strcatW(cmd, spc);
......
...@@ -207,23 +207,22 @@ static INT_PTR cabinet_notify(FDINOTIFICATIONTYPE fdint, PFDINOTIFICATION pfdin) ...@@ -207,23 +207,22 @@ static INT_PTR cabinet_notify(FDINOTIFICATIONTYPE fdint, PFDINOTIFICATION pfdin)
LPWSTR tracknametmp; LPWSTR tracknametmp;
static const WCHAR tmpprefix[] = {'C','A','B','T','M','P','_',0}; static const WCHAR tmpprefix[] = {'C','A','B','T','M','P','_',0};
LPWSTR given_file; LPWSTR given_file;
INT index;
MSIRECORD * uirow; MSIRECORD * uirow;
LPWSTR uipath; LPWSTR uipath;
MSIFILE *f;
given_file = strdupAtoW(pfdin->psz1); given_file = strdupAtoW(pfdin->psz1);
index = get_loaded_file(data->package, given_file); f = get_loaded_file(data->package, given_file);
if (index < 0) if (!f)
{ {
ERR("Unknown File in Cabinent (%s)\n",debugstr_w(given_file)); ERR("Unknown File in Cabinent (%s)\n",debugstr_w(given_file));
HeapFree(GetProcessHeap(),0,given_file); HeapFree(GetProcessHeap(),0,given_file);
return 0; return 0;
} }
if (!((data->package->files[index].State == 1 || if (!((f->State == 1 || f->State == 2)))
data->package->files[index].State == 2)))
{ {
TRACE("Skipping extraction of %s\n",debugstr_w(given_file)); TRACE("Skipping extraction of %s\n",debugstr_w(given_file));
HeapFree(GetProcessHeap(),0,given_file); HeapFree(GetProcessHeap(),0,given_file);
...@@ -253,16 +252,16 @@ static INT_PTR cabinet_notify(FDINOTIFICATIONTYPE fdint, PFDINOTIFICATION pfdin) ...@@ -253,16 +252,16 @@ static INT_PTR cabinet_notify(FDINOTIFICATIONTYPE fdint, PFDINOTIFICATION pfdin)
/* the UI chunk */ /* the UI chunk */
uirow=MSI_CreateRecord(9); uirow=MSI_CreateRecord(9);
MSI_RecordSetStringW(uirow,1,data->package->files[index].File); MSI_RecordSetStringW( uirow, 1, f->File );
uipath = strdupW(data->package->files[index].TargetPath); uipath = strdupW( f->TargetPath );
*(strrchrW(uipath,'\\')+1)=0; *(strrchrW(uipath,'\\')+1)=0;
MSI_RecordSetStringW(uirow,9,uipath); MSI_RecordSetStringW(uirow,9,uipath);
MSI_RecordSetInteger(uirow,6,data->package->files[index].FileSize); MSI_RecordSetInteger( uirow, 6, f->FileSize );
ui_actiondata(data->package,szInstallFiles,uirow); ui_actiondata(data->package,szInstallFiles,uirow);
msiobj_release( &uirow->hdr ); msiobj_release( &uirow->hdr );
HeapFree(GetProcessHeap(),0,uipath); HeapFree(GetProcessHeap(),0,uipath);
ui_progress(data->package,2,data->package->files[index].FileSize,0,0); ui_progress( data->package, 2, f->FileSize, 0, 0);
return cabinet_open(file, _O_WRONLY | _O_CREAT, 0); return cabinet_open(file, _O_WRONLY | _O_CREAT, 0);
} }
...@@ -433,7 +432,7 @@ static UINT ready_volume(MSIPACKAGE* package, LPCWSTR path, LPWSTR last_volume, ...@@ -433,7 +432,7 @@ static UINT ready_volume(MSIPACKAGE* package, LPCWSTR path, LPWSTR last_volume,
return ERROR_SUCCESS; return ERROR_SUCCESS;
} }
static UINT ready_media_for_file(MSIPACKAGE *package, int fileindex, static UINT ready_media_for_file(MSIPACKAGE *package, MSIFILE *file,
MSICOMPONENT* comp) MSICOMPONENT* comp)
{ {
UINT rc = ERROR_SUCCESS; UINT rc = ERROR_SUCCESS;
...@@ -451,7 +450,6 @@ static UINT ready_media_for_file(MSIPACKAGE *package, int fileindex, ...@@ -451,7 +450,6 @@ static UINT ready_media_for_file(MSIPACKAGE *package, int fileindex,
static UINT last_sequence = 0; static UINT last_sequence = 0;
static LPWSTR last_volume = NULL; static LPWSTR last_volume = NULL;
static LPWSTR last_path = NULL; static LPWSTR last_path = NULL;
MSIFILE* file = NULL;
UINT type; UINT type;
LPCWSTR prompt; LPCWSTR prompt;
static DWORD count = 0; static DWORD count = 0;
...@@ -469,8 +467,6 @@ static UINT ready_media_for_file(MSIPACKAGE *package, int fileindex, ...@@ -469,8 +467,6 @@ static UINT ready_media_for_file(MSIPACKAGE *package, int fileindex,
return ERROR_SUCCESS; return ERROR_SUCCESS;
} }
file = &package->files[fileindex];
if (file->Sequence <= last_sequence) if (file->Sequence <= last_sequence)
{ {
set_file_source(package,file,comp,last_path); set_file_source(package,file,comp,last_path);
...@@ -581,8 +577,6 @@ static UINT ready_media_for_file(MSIPACKAGE *package, int fileindex, ...@@ -581,8 +577,6 @@ static UINT ready_media_for_file(MSIPACKAGE *package, int fileindex,
} }
} }
rc = !extract_cabinet_file(package, source, last_path); rc = !extract_cabinet_file(package, source, last_path);
/* reaquire file ptr */
file = &package->files[fileindex];
} }
else else
{ {
...@@ -615,21 +609,21 @@ static UINT ready_media_for_file(MSIPACKAGE *package, int fileindex, ...@@ -615,21 +609,21 @@ static UINT ready_media_for_file(MSIPACKAGE *package, int fileindex,
return rc; return rc;
} }
inline static UINT get_file_target(MSIPACKAGE *package, LPCWSTR file_key, static UINT get_file_target(MSIPACKAGE *package, LPCWSTR file_key,
LPWSTR* file_source) LPWSTR* file_source)
{ {
DWORD index; MSIFILE *file;
if (!package) if (!package)
return ERROR_INVALID_HANDLE; return ERROR_INVALID_HANDLE;
for (index = 0; index < package->loaded_files; index ++) LIST_FOR_EACH_ENTRY( file, &package->files, MSIFILE, entry )
{ {
if (strcmpW(file_key,package->files[index].File)==0) if (lstrcmpW( file_key, file->File )==0)
{ {
if (package->files[index].State >= 2) if (file->State >= 2)
{ {
*file_source = strdupW(package->files[index].TargetPath); *file_source = strdupW( file->TargetPath );
return ERROR_SUCCESS; return ERROR_SUCCESS;
} }
else else
...@@ -650,8 +644,8 @@ inline static UINT get_file_target(MSIPACKAGE *package, LPCWSTR file_key, ...@@ -650,8 +644,8 @@ inline static UINT get_file_target(MSIPACKAGE *package, LPCWSTR file_key,
UINT ACTION_InstallFiles(MSIPACKAGE *package) UINT ACTION_InstallFiles(MSIPACKAGE *package)
{ {
UINT rc = ERROR_SUCCESS; UINT rc = ERROR_SUCCESS;
DWORD index;
LPWSTR ptr; LPWSTR ptr;
MSIFILE *file;
if (!package) if (!package)
return ERROR_INVALID_HANDLE; return ERROR_INVALID_HANDLE;
...@@ -672,13 +666,10 @@ UINT ACTION_InstallFiles(MSIPACKAGE *package) ...@@ -672,13 +666,10 @@ UINT ACTION_InstallFiles(MSIPACKAGE *package)
FIXME("Write DiskPrompt\n"); FIXME("Write DiskPrompt\n");
/* Pass 1 */ /* Pass 1 */
for (index = 0; index < package->loaded_files; index++) LIST_FOR_EACH_ENTRY( file, &package->files, MSIFILE, entry )
{ {
MSIFILE *file;
MSICOMPONENT* comp = NULL; MSICOMPONENT* comp = NULL;
file = &package->files[index];
if (file->Temporary) if (file->Temporary)
continue; continue;
...@@ -719,12 +710,8 @@ UINT ACTION_InstallFiles(MSIPACKAGE *package) ...@@ -719,12 +710,8 @@ UINT ACTION_InstallFiles(MSIPACKAGE *package)
} }
/* Pass 2 */ /* Pass 2 */
for (index = 0; index < package->loaded_files; index++) LIST_FOR_EACH_ENTRY( file, &package->files, MSIFILE, entry )
{ {
MSIFILE *file;
file = &package->files[index];
if (file->Temporary) if (file->Temporary)
continue; continue;
...@@ -732,7 +719,7 @@ UINT ACTION_InstallFiles(MSIPACKAGE *package) ...@@ -732,7 +719,7 @@ UINT ACTION_InstallFiles(MSIPACKAGE *package)
{ {
TRACE("Pass 2: %s\n",debugstr_w(file->File)); TRACE("Pass 2: %s\n",debugstr_w(file->File));
rc = ready_media_for_file( package, index, file->Component ); rc = ready_media_for_file( package, file, file->Component );
if (rc != ERROR_SUCCESS) if (rc != ERROR_SUCCESS)
{ {
ERR("Unable to ready media\n"); ERR("Unable to ready media\n");
...@@ -740,13 +727,6 @@ UINT ACTION_InstallFiles(MSIPACKAGE *package) ...@@ -740,13 +727,6 @@ UINT ACTION_InstallFiles(MSIPACKAGE *package)
break; break;
} }
/*
* WARNING!
* our file table could change here because a new temp file
* may have been created. So reaquire our ptr.
*/
file = &package->files[index];
TRACE("file paths %s to %s\n",debugstr_w(file->SourcePath), TRACE("file paths %s to %s\n",debugstr_w(file->SourcePath),
debugstr_w(file->TargetPath)); debugstr_w(file->TargetPath));
...@@ -791,7 +771,7 @@ UINT ACTION_InstallFiles(MSIPACKAGE *package) ...@@ -791,7 +771,7 @@ UINT ACTION_InstallFiles(MSIPACKAGE *package)
} }
/* cleanup */ /* cleanup */
ready_media_for_file(NULL, 0, NULL); ready_media_for_file(NULL, NULL, NULL);
return rc; return rc;
} }
......
...@@ -100,38 +100,37 @@ static LPWSTR deformat_file(MSIPACKAGE* package, LPCWSTR key, DWORD* sz, ...@@ -100,38 +100,37 @@ static LPWSTR deformat_file(MSIPACKAGE* package, LPCWSTR key, DWORD* sz,
BOOL shortname) BOOL shortname)
{ {
LPWSTR value = NULL; LPWSTR value = NULL;
INT index; MSIFILE *file;
*sz = 0; *sz = 0;
if (!package) if (!package)
return NULL; return NULL;
index = get_loaded_file(package,key); file = get_loaded_file( package, key );
if (index >=0) if (file)
{ {
if (!shortname) if (!shortname)
{ {
value = strdupW(package->files[index].TargetPath); value = strdupW( file->TargetPath );
*sz = (strlenW(value)) * sizeof(WCHAR); *sz = (strlenW(value)) * sizeof(WCHAR);
} }
else else
{ {
DWORD size = 0; DWORD size = 0;
size = GetShortPathNameW(package->files[index].TargetPath, NULL, 0); size = GetShortPathNameW( file->TargetPath, NULL, 0 );
if (size > 0) if (size > 0)
{ {
*sz = (size-1) * sizeof (WCHAR); *sz = (size-1) * sizeof (WCHAR);
size ++; size ++;
value = HeapAlloc(GetProcessHeap(),0,size * sizeof(WCHAR)); value = HeapAlloc(GetProcessHeap(),0,size * sizeof(WCHAR));
GetShortPathNameW(package->files[index].TargetPath, value, GetShortPathNameW( file->TargetPath, value, size );
size);
} }
else else
{ {
ERR("Unable to get ShortPath size (%s)\n", ERR("Unable to get ShortPath size (%s)\n",
debugstr_w(package->files[index].TargetPath)); debugstr_w( file->TargetPath) );
value = NULL; value = NULL;
*sz = 0; *sz = 0;
} }
......
...@@ -169,7 +169,7 @@ LPWSTR load_dynamic_property(MSIPACKAGE *package, LPCWSTR prop, UINT* rc) ...@@ -169,7 +169,7 @@ LPWSTR load_dynamic_property(MSIPACKAGE *package, LPCWSTR prop, UINT* rc)
MSICOMPONENT* get_loaded_component( MSIPACKAGE* package, LPCWSTR Component ) MSICOMPONENT* get_loaded_component( MSIPACKAGE* package, LPCWSTR Component )
{ {
MSICOMPONENT *comp = NULL; MSICOMPONENT *comp;
LIST_FOR_EACH_ENTRY( comp, &package->components, MSICOMPONENT, entry ) LIST_FOR_EACH_ENTRY( comp, &package->components, MSICOMPONENT, entry )
{ {
...@@ -181,7 +181,7 @@ MSICOMPONENT* get_loaded_component( MSIPACKAGE* package, LPCWSTR Component ) ...@@ -181,7 +181,7 @@ MSICOMPONENT* get_loaded_component( MSIPACKAGE* package, LPCWSTR Component )
MSIFEATURE* get_loaded_feature(MSIPACKAGE* package, LPCWSTR Feature ) MSIFEATURE* get_loaded_feature(MSIPACKAGE* package, LPCWSTR Feature )
{ {
MSIFEATURE *feature = NULL; MSIFEATURE *feature;
LIST_FOR_EACH_ENTRY( feature, &package->features, MSIFEATURE, entry ) LIST_FOR_EACH_ENTRY( feature, &package->features, MSIFEATURE, entry )
{ {
...@@ -191,49 +191,36 @@ MSIFEATURE* get_loaded_feature(MSIPACKAGE* package, LPCWSTR Feature ) ...@@ -191,49 +191,36 @@ MSIFEATURE* get_loaded_feature(MSIPACKAGE* package, LPCWSTR Feature )
return NULL; return NULL;
} }
int get_loaded_file(MSIPACKAGE* package, LPCWSTR file) MSIFILE* get_loaded_file( MSIPACKAGE* package, LPCWSTR key )
{ {
int rc = -1; MSIFILE *file;
DWORD i;
for (i = 0; i < package->loaded_files; i++) LIST_FOR_EACH_ENTRY( file, &package->files, MSIFILE, entry )
{ {
if (strcmpW(file,package->files[i].File)==0) if (lstrcmpW( key, file->File )==0)
{ return file;
rc = i;
break;
}
} }
return rc; return NULL;
} }
int track_tempfile(MSIPACKAGE *package, LPCWSTR name, LPCWSTR path) int track_tempfile( MSIPACKAGE *package, LPCWSTR name, LPCWSTR path )
{ {
DWORD i; MSIFILE *file;
DWORD index;
if (!package) if (!package)
return -2; return -2;
for (i=0; i < package->loaded_files; i++) file = get_loaded_file( package, name );
if (strcmpW(package->files[i].File,name)==0) if (file)
return -1; return -1;
index = package->loaded_files;
package->loaded_files++;
if (package->loaded_files== 1)
package->files = HeapAlloc(GetProcessHeap(),0,sizeof(MSIFILE));
else
package->files = HeapReAlloc(GetProcessHeap(),0,
package->files , package->loaded_files * sizeof(MSIFILE));
memset(&package->files[index],0,sizeof(MSIFILE)); file = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof (MSIFILE) );
package->files[index].File = strdupW(name); file->File = strdupW( name );
package->files[index].TargetPath = strdupW(path); file->TargetPath = strdupW( path );
package->files[index].Temporary = TRUE; file->Temporary = TRUE;
TRACE("Tracking tempfile (%s)\n",debugstr_w(package->files[index].File)); TRACE("Tracking tempfile (%s)\n", debugstr_w( file->File ));
return 0; return 0;
} }
...@@ -429,19 +416,18 @@ UINT schedule_action(MSIPACKAGE *package, UINT script, LPCWSTR action) ...@@ -429,19 +416,18 @@ UINT schedule_action(MSIPACKAGE *package, UINT script, LPCWSTR action)
static void remove_tracked_tempfiles(MSIPACKAGE* package) static void remove_tracked_tempfiles(MSIPACKAGE* package)
{ {
DWORD i; MSIFILE *file;
if (!package) if (!package)
return; return;
for (i = 0; i < package->loaded_files; i++) LIST_FOR_EACH_ENTRY( file, &package->files, MSIFILE, entry )
{ {
if (package->files[i].Temporary) if (file->Temporary)
{ {
TRACE("Cleaning up %s\n",debugstr_w(package->files[i].TargetPath)); TRACE("Cleaning up %s\n", debugstr_w( file->TargetPath ));
DeleteFileW(package->files[i].TargetPath); DeleteFileW( file->TargetPath );
} }
} }
} }
...@@ -497,19 +483,20 @@ void ACTION_free_package_structures( MSIPACKAGE* package) ...@@ -497,19 +483,20 @@ void ACTION_free_package_structures( MSIPACKAGE* package)
HeapFree( GetProcessHeap(), 0, comp ); HeapFree( GetProcessHeap(), 0, comp );
} }
for (i = 0; i < package->loaded_files; i++) LIST_FOR_EACH_SAFE( item, cursor, &package->files )
{ {
HeapFree(GetProcessHeap(),0,package->files[i].File); MSIFILE *file = LIST_ENTRY( item, MSIFILE, entry );
HeapFree(GetProcessHeap(),0,package->files[i].FileName);
HeapFree(GetProcessHeap(),0,package->files[i].ShortName);
HeapFree(GetProcessHeap(),0,package->files[i].Version);
HeapFree(GetProcessHeap(),0,package->files[i].Language);
HeapFree(GetProcessHeap(),0,package->files[i].SourcePath);
HeapFree(GetProcessHeap(),0,package->files[i].TargetPath);
}
if (package->files && package->loaded_files > 0) list_remove( &file->entry );
HeapFree(GetProcessHeap(),0,package->files); HeapFree( GetProcessHeap(), 0, file->File );
HeapFree( GetProcessHeap(), 0, file->FileName );
HeapFree( GetProcessHeap(), 0, file->ShortName );
HeapFree( GetProcessHeap(), 0, file->Version );
HeapFree( GetProcessHeap(), 0, file->Language );
HeapFree( GetProcessHeap(), 0, file->SourcePath );
HeapFree( GetProcessHeap(), 0, file->TargetPath );
HeapFree( GetProcessHeap(), 0, file );
}
/* clean up extension, progid, class and verb structures */ /* clean up extension, progid, class and verb structures */
for (i = 0; i < package->loaded_classes; i++) for (i = 0; i < package->loaded_classes; i++)
......
...@@ -190,8 +190,7 @@ typedef struct tagMSIPACKAGE ...@@ -190,8 +190,7 @@ typedef struct tagMSIPACKAGE
UINT loaded_folders; UINT loaded_folders;
struct list components; struct list components;
struct list features; struct list features;
struct tagMSIFILE *files; struct list files;
UINT loaded_files;
LPWSTR ActionFormat; LPWSTR ActionFormat;
LPWSTR LastAction; LPWSTR LastAction;
......
...@@ -380,9 +380,8 @@ MSIPACKAGE *MSI_CreatePackage( MSIDATABASE *db ) ...@@ -380,9 +380,8 @@ MSIPACKAGE *MSI_CreatePackage( MSIDATABASE *db )
list_init( &package->features ); list_init( &package->features );
package->folders = NULL; package->folders = NULL;
list_init( &package->components ); list_init( &package->components );
package->files = NULL; list_init( &package->files );
package->loaded_folders = 0; package->loaded_folders = 0;
package->loaded_files = 0;
package->ActionFormat = NULL; package->ActionFormat = NULL;
package->LastAction = NULL; package->LastAction = NULL;
package->dialog = NULL; package->dialog = NULL;
......
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