Commit b81f1ce5 authored by James Hawkins's avatar James Hawkins Committed by Alexandre Julliard

msi: Use the media_info structure instead of passing in individual values to extract_cabinet_file.

parent 84f34ec2
...@@ -57,6 +57,14 @@ extern const WCHAR szRemoveFiles[]; ...@@ -57,6 +57,14 @@ extern const WCHAR szRemoveFiles[];
static const WCHAR cszTempFolder[]= {'T','e','m','p','F','o','l','d','e','r',0}; static const WCHAR cszTempFolder[]= {'T','e','m','p','F','o','l','d','e','r',0};
struct media_info {
UINT last_sequence;
LPWSTR last_volume;
LPWSTR last_path;
DWORD count;
WCHAR source[MAX_PATH];
};
/* /*
* This is a helper function for handling embedded cabinet media * This is a helper function for handling embedded cabinet media
*/ */
...@@ -272,8 +280,7 @@ static INT_PTR cabinet_notify(FDINOTIFICATIONTYPE fdint, PFDINOTIFICATION pfdin) ...@@ -272,8 +280,7 @@ static INT_PTR cabinet_notify(FDINOTIFICATIONTYPE fdint, PFDINOTIFICATION pfdin)
* *
* Extract files from a cab file. * Extract files from a cab file.
*/ */
static BOOL extract_cabinet_file(MSIPACKAGE* package, LPCWSTR source, static BOOL extract_cabinet_file(MSIPACKAGE* package, struct media_info *mi)
LPCWSTR path)
{ {
HFDI hfdi; HFDI hfdi;
ERF erf; ERF erf;
...@@ -283,7 +290,7 @@ static BOOL extract_cabinet_file(MSIPACKAGE* package, LPCWSTR source, ...@@ -283,7 +290,7 @@ static BOOL extract_cabinet_file(MSIPACKAGE* package, LPCWSTR source,
static CHAR empty[] = ""; static CHAR empty[] = "";
CabData data; CabData data;
TRACE("Extracting %s to %s\n",debugstr_w(source), debugstr_w(path)); TRACE("Extracting %s to %s\n",debugstr_w(mi->source), debugstr_w(mi->last_path));
hfdi = FDICreate(cabinet_alloc, hfdi = FDICreate(cabinet_alloc,
cabinet_free, cabinet_free,
...@@ -300,12 +307,12 @@ static BOOL extract_cabinet_file(MSIPACKAGE* package, LPCWSTR source, ...@@ -300,12 +307,12 @@ static BOOL extract_cabinet_file(MSIPACKAGE* package, LPCWSTR source,
return FALSE; return FALSE;
} }
if (!(cabinet = strdupWtoA( source ))) if (!(cabinet = strdupWtoA( mi->source )))
{ {
FDIDestroy(hfdi); FDIDestroy(hfdi);
return FALSE; return FALSE;
} }
if (!(cab_path = strdupWtoA( path ))) if (!(cab_path = strdupWtoA( mi->last_path )))
{ {
FDIDestroy(hfdi); FDIDestroy(hfdi);
msi_free(cabinet); msi_free(cabinet);
...@@ -348,14 +355,6 @@ static VOID set_file_source(MSIPACKAGE* package, MSIFILE* file, MSICOMPONENT* ...@@ -348,14 +355,6 @@ static VOID set_file_source(MSIPACKAGE* package, MSIFILE* file, MSICOMPONENT*
file->SourcePath = build_directory_name(2, path, file->File); file->SourcePath = build_directory_name(2, path, file->File);
} }
struct media_info {
UINT last_sequence;
LPWSTR last_volume;
LPWSTR last_path;
DWORD count;
WCHAR source[MAX_PATH];
};
static struct media_info *create_media_info( void ) static struct media_info *create_media_info( void )
{ {
struct media_info *mi; struct media_info *mi;
...@@ -422,7 +421,7 @@ static UINT msi_extract_remote_cabinet( MSIPACKAGE *package, struct media_info * ...@@ -422,7 +421,7 @@ static UINT msi_extract_remote_cabinet( MSIPACKAGE *package, struct media_info *
} }
msi_free(cabpath); msi_free(cabpath);
return !extract_cabinet_file(package, mi->source, mi->last_path); return !extract_cabinet_file(package, mi);
} }
static UINT msi_change_media( MSIPACKAGE *package, struct media_info *mi, LPCWSTR prompt ) static UINT msi_change_media( MSIPACKAGE *package, struct media_info *mi, LPCWSTR prompt )
...@@ -578,7 +577,7 @@ static UINT ready_media_for_file( MSIPACKAGE *package, struct media_info *mi, ...@@ -578,7 +577,7 @@ static UINT ready_media_for_file( MSIPACKAGE *package, struct media_info *mi,
} }
else else
{ {
rc = !extract_cabinet_file(package, mi->source, mi->last_path); rc = !extract_cabinet_file(package, mi);
} }
} }
else 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