Piotr Caban : msi: Fix table ref count on create.

Alexandre Julliard julliard at winehq.org
Tue Jun 30 14:55:06 CDT 2020


Module: wine
Branch: master
Commit: 405486fbe6853c78744099fa1ebe07995e07a438
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=405486fbe6853c78744099fa1ebe07995e07a438

Author: Piotr Caban <piotr at codeweavers.com>
Date:   Tue Jun 30 05:40:20 2020 +0200

msi: Fix table ref count on create.

Signed-off-by: Piotr Caban <piotr at codeweavers.com>
Signed-off-by: Hans Leidekker <hans at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/msi/create.c | 2 +-
 dlls/msi/query.h  | 2 +-
 dlls/msi/table.c  | 7 +++++--
 3 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/dlls/msi/create.c b/dlls/msi/create.c
index 6133159dce..94c62ec573 100644
--- a/dlls/msi/create.c
+++ b/dlls/msi/create.c
@@ -68,7 +68,7 @@ static UINT CREATE_execute( struct tagMSIVIEW *view, MSIRECORD *record )
     if (cv->bIsTemp && !cv->hold)
         return ERROR_SUCCESS;
 
-    return msi_create_table( cv->db, cv->name, cv->col_info, persist );
+    return msi_create_table( cv->db, cv->name, cv->col_info, persist, cv->hold );
 }
 
 static UINT CREATE_close( struct tagMSIVIEW *view )
diff --git a/dlls/msi/query.h b/dlls/msi/query.h
index c0144d3054..5e5f3906f4 100644
--- a/dlls/msi/query.h
+++ b/dlls/msi/query.h
@@ -149,7 +149,7 @@ int sqliteGetToken(const WCHAR *z, int *tokenType, int *skip) DECLSPEC_HIDDEN;
 MSIRECORD *msi_query_merge_record( UINT fields, const column_info *vl, MSIRECORD *rec ) DECLSPEC_HIDDEN;
 
 UINT msi_create_table( MSIDATABASE *db, LPCWSTR name, column_info *col_info,
-                       MSICONDITION persistent ) DECLSPEC_HIDDEN;
+                       MSICONDITION persistent, BOOL hold ) DECLSPEC_HIDDEN;
 
 UINT msi_select_update( MSIVIEW *view, MSIRECORD *rec, UINT row ) DECLSPEC_HIDDEN;
 
diff --git a/dlls/msi/table.c b/dlls/msi/table.c
index db4dd59f95..7fae4ad07a 100644
--- a/dlls/msi/table.c
+++ b/dlls/msi/table.c
@@ -713,7 +713,7 @@ static UINT get_tablecolumns( MSIDATABASE *db, LPCWSTR szTableName, MSICOLUMNINF
 }
 
 UINT msi_create_table( MSIDATABASE *db, LPCWSTR name, column_info *col_info,
-                       MSICONDITION persistent )
+                       MSICONDITION persistent, BOOL hold )
 {
     UINT r, nField;
     MSIVIEW *tv = NULL;
@@ -733,7 +733,7 @@ UINT msi_create_table( MSIDATABASE *db, LPCWSTR name, column_info *col_info,
     if( !table )
         return ERROR_FUNCTION_FAILED;
 
-    table->ref_count = 1;
+    table->ref_count = 0;
     table->row_count = 0;
     table->data = NULL;
     table->data_persistent = NULL;
@@ -742,6 +742,9 @@ UINT msi_create_table( MSIDATABASE *db, LPCWSTR name, column_info *col_info,
     table->persistent = persistent;
     lstrcpyW( table->name, name );
 
+    if( hold )
+        table->ref_count++;
+
     for( col = col_info; col; col = col->next )
         table->col_count++;
 




More information about the wine-cvs mailing list