Mike McCormack : msi: Remove track_tempfile()'s unused 2nd parameter.

Alexandre Julliard julliard at wine.codeweavers.com
Tue Nov 14 05:14:27 CST 2006


Module: wine
Branch: master
Commit: c88c0b453d9ef07e8c47c2989c8476e2e157b8f6
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=c88c0b453d9ef07e8c47c2989c8476e2e157b8f6

Author: Mike McCormack <mike at codeweavers.com>
Date:   Tue Nov 14 12:42:27 2006 +0900

msi: Remove track_tempfile()'s unused 2nd parameter.

---

 dlls/msi/custom.c  |    2 +-
 dlls/msi/files.c   |    2 +-
 dlls/msi/helpers.c |   22 ++++++----------------
 dlls/msi/msipriv.h |    3 +--
 4 files changed, 9 insertions(+), 20 deletions(-)

diff --git a/dlls/msi/custom.c b/dlls/msi/custom.c
index 6ec4bb3..14e9918 100644
--- a/dlls/msi/custom.c
+++ b/dlls/msi/custom.c
@@ -307,7 +307,7 @@ static UINT store_binary_to_temp(MSIPACK
         TRACE("Unable to create file\n");
         return ERROR_FUNCTION_FAILED;
     }
-    track_tempfile(package, tmp_file, tmp_file);
+    track_tempfile(package, tmp_file);
 
     row = MSI_QueryGetRecord(package->db, query, source);
     if (!row)
diff --git a/dlls/msi/files.c b/dlls/msi/files.c
index 8d3992e..9793a0a 100644
--- a/dlls/msi/files.c
+++ b/dlls/msi/files.c
@@ -123,7 +123,7 @@ static UINT writeout_cabinet_stream(MSIP
 
     GetTempFileNameW(tmp,stream_name,0,source);
 
-    track_tempfile(package,strrchrW(source,'\\'), source);
+    track_tempfile(package, source);
     the_file = CreateFileW(source, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS,
                            FILE_ATTRIBUTE_NORMAL, NULL);
 
diff --git a/dlls/msi/helpers.c b/dlls/msi/helpers.c
index 819c310..427c1af 100644
--- a/dlls/msi/helpers.c
+++ b/dlls/msi/helpers.c
@@ -108,39 +108,30 @@ MSIFILE* get_loaded_file( MSIPACKAGE* pa
     return NULL;
 }
 
-int track_tempfile( MSIPACKAGE *package, LPCWSTR name, LPCWSTR path )
+int track_tempfile( MSIPACKAGE *package, LPCWSTR path )
 {
     MSITEMPFILE *temp;
 
+    TRACE("%s\n", debugstr_w(path));
+
     LIST_FOR_EACH_ENTRY( temp, &package->tempfiles, MSITEMPFILE, entry )
-    {
-        if (lstrcmpW( name, temp->File )==0)
-        {
-            TRACE("tempfile %s already exists with path %s\n",
-                debugstr_w(temp->File), debugstr_w(temp->Path));
-            return -1;
-        }
-    }
+        if (!lstrcmpW( path, temp->Path ))
+            return 0;
 
     temp = msi_alloc_zero( sizeof (MSITEMPFILE) );
     if (!temp)
         return -1;
 
     list_add_head( &package->tempfiles, &temp->entry );
-
-    temp->File = strdupW( name );
     temp->Path = strdupW( path );
 
-    TRACE("adding tempfile %s with path %s\n",
-           debugstr_w(temp->File), debugstr_w(temp->Path));
-
     return 0;
 }
 
 MSIFOLDER *get_loaded_folder( MSIPACKAGE *package, LPCWSTR dir )
 {
     MSIFOLDER *folder;
-    
+
     LIST_FOR_EACH_ENTRY( folder, &package->folders, MSIFOLDER, entry )
     {
         if (lstrcmpW( dir, folder->Directory )==0)
@@ -407,7 +398,6 @@ static void remove_tracked_tempfiles(MSI
         TRACE("deleting temp file %s\n", debugstr_w( temp->Path ));
         if (!DeleteFileW( temp->Path ))
             ERR("failed to delete %s\n", debugstr_w( temp->Path ));
-        msi_free( temp->File );
         msi_free( temp->Path );
         msi_free( temp );
     }
diff --git a/dlls/msi/msipriv.h b/dlls/msi/msipriv.h
index 44e9170..23879a4 100644
--- a/dlls/msi/msipriv.h
+++ b/dlls/msi/msipriv.h
@@ -366,7 +366,6 @@ typedef struct tagMSIFILE
 typedef struct tagMSITEMPFILE
 {
     struct list entry;
-    LPWSTR File;
     LPWSTR Path;
 } MSITEMPFILE;
 
@@ -751,7 +750,7 @@ extern MSICOMPONENT *get_loaded_componen
 extern MSIFEATURE *get_loaded_feature( MSIPACKAGE* package, LPCWSTR Feature );
 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 int track_tempfile(MSIPACKAGE *package, LPCWSTR path);
 extern UINT schedule_action(MSIPACKAGE *package, UINT script, LPCWSTR action);
 extern void msi_free_action_script(MSIPACKAGE *package, UINT script);
 extern LPWSTR build_icon_path(MSIPACKAGE *, LPCWSTR);




More information about the wine-cvs mailing list