Mike McCormack : msi: Initialize the summary information from a storage interface, not a db.

Alexandre Julliard julliard at wine.codeweavers.com
Mon Oct 23 06:14:27 CDT 2006


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

Author: Mike McCormack <mike at codeweavers.com>
Date:   Tue Oct 24 01:11:30 2006 +0900

msi: Initialize the summary information from a storage interface, not a db.

---

 dlls/msi/action.c   |    2 +-
 dlls/msi/database.c |    5 +----
 dlls/msi/msipriv.h  |    4 ++--
 dlls/msi/suminfo.c  |   18 +++++++++---------
 4 files changed, 13 insertions(+), 16 deletions(-)

diff --git a/dlls/msi/action.c b/dlls/msi/action.c
index 8d79028..9205884 100644
--- a/dlls/msi/action.c
+++ b/dlls/msi/action.c
@@ -460,7 +460,7 @@ static UINT msi_parse_patch_summary( MSI
     LPWSTR str, *substorage;
     UINT i, r = ERROR_SUCCESS;
 
-    si = MSI_GetSummaryInformationW( patch_db, 0 );
+    si = MSI_GetSummaryInformationW( patch_db->storage, 0 );
     if (!si)
         return ERROR_FUNCTION_FAILED;
 
diff --git a/dlls/msi/database.c b/dlls/msi/database.c
index c36139e..e496acf 100644
--- a/dlls/msi/database.c
+++ b/dlls/msi/database.c
@@ -57,15 +57,12 @@ DEFINE_GUID( CLSID_MsiPatch, 0x000c1086,
 static VOID MSI_CloseDatabase( MSIOBJECTHDR *arg )
 {
     MSIDATABASE *db = (MSIDATABASE *) arg;
-    DWORD r;
 
     msi_free(db->path);
     free_cached_tables( db );
     msi_free_transforms( db );
     msi_destroy_stringtable( db->strings );
-    r = IStorage_Release( db->storage );
-    if( r )
-        ERR("database reference count was not zero (%d)\n", r);
+    IStorage_Release( db->storage );
     if (db->deletefile)
     {
         DeleteFileW( db->deletefile );
diff --git a/dlls/msi/msipriv.h b/dlls/msi/msipriv.h
index 94edb23..5fe45f6 100644
--- a/dlls/msi/msipriv.h
+++ b/dlls/msi/msipriv.h
@@ -256,7 +256,7 @@ #define MSI_MAX_PROPS 20
 typedef struct tagMSISUMMARYINFO
 {
     MSIOBJECTHDR hdr;
-    MSIDATABASE *db;
+    IStorage *storage;
     DWORD update_count;
     PROPVARIANT property[MSI_MAX_PROPS];
 } MSISUMMARYINFO;
@@ -686,7 +686,7 @@ extern MSIPREVIEW *MSI_EnableUIPreview( 
 extern UINT MSI_PreviewDialogW( MSIPREVIEW *, LPCWSTR );
 
 /* summary information */
-extern MSISUMMARYINFO *MSI_GetSummaryInformationW( MSIDATABASE *db, UINT uiUpdateCount );
+extern MSISUMMARYINFO *MSI_GetSummaryInformationW( IStorage *stg, UINT uiUpdateCount );
 extern LPWSTR msi_suminfo_dup_string( MSISUMMARYINFO *si, UINT uiProperty );
 
 /* undocumented functions */
diff --git a/dlls/msi/suminfo.c b/dlls/msi/suminfo.c
index 5d51e4f..44bcbf4 100644
--- a/dlls/msi/suminfo.c
+++ b/dlls/msi/suminfo.c
@@ -96,7 +96,7 @@ static void MSI_CloseSummaryInfo( MSIOBJ
 
     for( i = 0; i < MSI_MAX_PROPS; i++ )
         free_prop( &si->property[i] );
-    msiobj_release( &si->db->hdr );
+    IStorage_Release( si->storage );
 }
 
 static UINT get_type( UINT uiProperty )
@@ -105,7 +105,7 @@ static UINT get_type( UINT uiProperty )
     {
     case PID_CODEPAGE:
          return VT_I2;
-    
+
     case PID_SUBJECT:
     case PID_AUTHOR:
     case PID_KEYWORDS:
@@ -405,28 +405,28 @@ static UINT save_summary_info( MSISUMMAR
     return ERROR_SUCCESS;
 }
 
-MSISUMMARYINFO *MSI_GetSummaryInformationW( MSIDATABASE *db, UINT uiUpdateCount )
+MSISUMMARYINFO *MSI_GetSummaryInformationW( IStorage *stg, UINT uiUpdateCount )
 {
     IStream *stm = NULL;
     MSISUMMARYINFO *si;
     DWORD grfMode;
     HRESULT r;
 
-    TRACE("%p %d\n", db, uiUpdateCount );
+    TRACE("%p %d\n", stg, uiUpdateCount );
 
     si = alloc_msiobject( MSIHANDLETYPE_SUMMARYINFO, 
                   sizeof (MSISUMMARYINFO), MSI_CloseSummaryInfo );
     if( !si )
         return si;
 
-    msiobj_addref( &db->hdr );
-    si->db = db;
     memset( &si->property, 0, sizeof si->property );
     si->update_count = uiUpdateCount;
+    IStorage_AddRef( stg );
+    si->storage = stg;
 
     /* read the stream... if we fail, we'll start with an empty property set */
     grfMode = STGM_READ | STGM_SHARE_EXCLUSIVE;
-    r = IStorage_OpenStream( si->db->storage, szSumInfo, 0, grfMode, 0, &stm );
+    r = IStorage_OpenStream( si->storage, szSumInfo, 0, grfMode, 0, &stm );
     if( SUCCEEDED(r) )
     {
         load_summary_info( si, stm );
@@ -462,7 +462,7 @@ UINT WINAPI MsiGetSummaryInformationW( M
             return ERROR_INVALID_PARAMETER;
     }
 
-    si = MSI_GetSummaryInformationW( db, uiUpdateCount );
+    si = MSI_GetSummaryInformationW( db->storage, uiUpdateCount );
     if (si)
     {
         *pHandle = alloc_msihandle( &si->hdr );
@@ -749,7 +749,7 @@ UINT WINAPI MsiSummaryInfoPersist( MSIHA
         return ERROR_INVALID_HANDLE;
 
     grfMode = STGM_CREATE | STGM_READWRITE | STGM_SHARE_EXCLUSIVE;
-    r = IStorage_CreateStream( si->db->storage, szSumInfo, grfMode, 0, 0, &stm );
+    r = IStorage_CreateStream( si->storage, szSumInfo, grfMode, 0, 0, &stm );
     if( SUCCEEDED(r) )
     {
         ret = save_summary_info( si, stm );




More information about the wine-cvs mailing list