Hans Leidekker : msi: Avoid redundant loading of media info.

Alexandre Julliard julliard at winehq.org
Thu Apr 14 11:58:21 CDT 2011


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

Author: Hans Leidekker <hans at codeweavers.com>
Date:   Thu Apr 14 14:40:45 2011 +0200

msi: Avoid redundant loading of media info.

---

 dlls/msi/media.c |   15 ++++++++-------
 1 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/dlls/msi/media.c b/dlls/msi/media.c
index 7cf7585..9ce92b5 100644
--- a/dlls/msi/media.c
+++ b/dlls/msi/media.c
@@ -658,16 +658,16 @@ static UINT get_drive_type(const WCHAR *path)
 
 UINT msi_load_media_info(MSIPACKAGE *package, UINT Sequence, MSIMEDIAINFO *mi)
 {
+    static const WCHAR query[] = {
+        'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ','`','M','e','d','i','a','`',' ',
+        'W','H','E','R','E',' ','`','L','a','s','t','S','e','q','u','e','n','c','e','`',' ',
+        '>','=',' ','%','i',' ','O','R','D','E','R',' ','B','Y',' ','`','D','i','s','k','I','d','`',0};
     MSIRECORD *row;
-    LPWSTR source_dir;
-    LPWSTR source;
+    LPWSTR source_dir, source;
     DWORD options;
 
-    static const WCHAR query[] = {
-        'S','E','L','E','C','T',' ','*',' ', 'F','R','O','M',' ',
-        '`','M','e','d','i','a','`',' ','W','H','E','R','E',' ',
-        '`','L','a','s','t','S','e','q','u','e','n','c','e','`',' ','>','=',' ','%','i',
-        ' ','O','R','D','E','R',' ','B','Y',' ','`','D','i','s','k','I','d','`',0};
+    if (Sequence <= mi->last_sequence) /* already loaded */
+        return ERROR_SUCCESS;
 
     row = MSI_QueryGetRecord(package->db, query, Sequence);
     if (!row)
@@ -720,6 +720,7 @@ UINT msi_load_media_info(MSIPACKAGE *package, UINT Sequence, MSIMEDIAINFO *mi)
                          options, INSTALLPROPERTY_LASTUSEDSOURCEW, source);
 
     msi_free(source_dir);
+    TRACE("sequence %u -> cabinet %s disk id %u\n", Sequence, debugstr_w(mi->cabinet), mi->disk_id);
     return ERROR_SUCCESS;
 }
 




More information about the wine-cvs mailing list