[2/5] msi: Reduce filename to the long name in ITERATE_RemoveFiles.

Hans Leidekker hans at codeweavers.com
Mon Mar 7 05:39:53 CST 2011


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

diff --git a/dlls/msi/files.c b/dlls/msi/files.c
index d024718..df765e5 100644
--- a/dlls/msi/files.c
+++ b/dlls/msi/files.c
@@ -915,14 +915,14 @@ static UINT ITERATE_RemoveFiles(MSIRECORD *row, LPVOID param)
     MSIPACKAGE *package = param;
     MSICOMPONENT *comp;
     MSIRECORD *uirow;
-    LPCWSTR component, filename, dirprop;
+    LPCWSTR component, dirprop;
     UINT install_mode;
-    LPWSTR dir = NULL, path = NULL;
+    LPWSTR dir = NULL, path = NULL, filename = NULL;
     DWORD size;
     UINT ret = ERROR_SUCCESS;
 
     component = MSI_RecordGetString(row, 2);
-    filename = MSI_RecordGetString(row, 3);
+    filename = strdupW( MSI_RecordGetString(row, 3) );
     dirprop = MSI_RecordGetString(row, 4);
     install_mode = MSI_RecordGetInteger(row, 5);
 
@@ -950,7 +950,12 @@ static UINT ITERATE_RemoveFiles(MSIRECORD *row, LPVOID param)
     if (!dir)
         return ERROR_OUTOFMEMORY;
 
-    size = (filename != NULL) ? lstrlenW(filename) : 0;
+    size = 0;
+    if (filename)
+    {
+        reduce_to_longfilename( filename );
+        size = lstrlenW( filename );
+    }
     size += lstrlenW(dir) + 2;
     path = msi_alloc(size * sizeof(WCHAR));
     if (!path)
@@ -981,6 +986,7 @@ done:
     ui_actiondata( package, szRemoveFiles, uirow );
     msiobj_release( &uirow->hdr );
 
+    msi_free(filename);
     msi_free(path);
     msi_free(dir);
     return ret;
-- 
1.7.1







More information about the wine-patches mailing list