msi [2/11]: Use the media_info structure instead of passing in individual values to extract_cabinet_file

James Hawkins truiken at gmail.com
Tue Nov 7 17:09:29 CST 2006


Hi,

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

 dlls/msi/files.c |   29 ++++++++++++++---------------
 1 files changed, 14 insertions(+), 15 deletions(-)

-- 
James Hawkins
-------------- next part --------------
diff --git a/dlls/msi/files.c b/dlls/msi/files.c
index 2f68467..139aad4 100644
--- a/dlls/msi/files.c
+++ b/dlls/msi/files.c
@@ -57,6 +57,14 @@ extern const WCHAR szRemoveFiles[];
 
 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
  */
@@ -272,8 +280,7 @@ static INT_PTR cabinet_notify(FDINOTIFIC
  *
  * Extract files from a cab file.
  */
-static BOOL extract_cabinet_file(MSIPACKAGE* package, LPCWSTR source, 
-                                 LPCWSTR path)
+static BOOL extract_cabinet_file(MSIPACKAGE* package, struct media_info *mi)
 {
     HFDI hfdi;
     ERF erf;
@@ -283,7 +290,7 @@ static BOOL extract_cabinet_file(MSIPACK
     static CHAR empty[] = "";
     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,
                      cabinet_free,
@@ -300,12 +307,12 @@ static BOOL extract_cabinet_file(MSIPACK
         return FALSE;
     }
 
-    if (!(cabinet = strdupWtoA( source )))
+    if (!(cabinet = strdupWtoA( mi->source )))
     {
         FDIDestroy(hfdi);
         return FALSE;
     }
-    if (!(cab_path = strdupWtoA( path )))
+    if (!(cab_path = strdupWtoA( mi->last_path )))
     {
         FDIDestroy(hfdi);
         msi_free(cabinet);
@@ -348,14 +355,6 @@ static VOID set_file_source(MSIPACKAGE* 
         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 )
 {
     struct media_info *mi;
@@ -422,7 +421,7 @@ static UINT msi_extract_remote_cabinet( 
     }
 
     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 )
@@ -578,7 +577,7 @@ static UINT ready_media_for_file( MSIPAC
         }
         else
         {
-            rc = !extract_cabinet_file(package, mi->source, mi->last_path);
+            rc = !extract_cabinet_file(package, mi);
         }
     }
     else
-- 
1.4.2.4


More information about the wine-patches mailing list