Skip to content

Commit caa225a

Browse files
winesynclearn-more
authored andcommitted
[WINESYNC] msi: Fix table ref count on create.
Signed-off-by: Piotr Caban <[email protected]> Signed-off-by: Hans Leidekker <[email protected]> Signed-off-by: Alexandre Julliard <[email protected]> wine commit id 405486fbe6853c78744099fa1ebe07995e07a438 by Piotr Caban <[email protected]>
1 parent 5c718f5 commit caa225a

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

dll/win32/msi/create.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ static UINT CREATE_execute( struct tagMSIVIEW *view, MSIRECORD *record )
6868
if (cv->bIsTemp && !cv->hold)
6969
return ERROR_SUCCESS;
7070

71-
return msi_create_table( cv->db, cv->name, cv->col_info, persist );
71+
return msi_create_table( cv->db, cv->name, cv->col_info, persist, cv->hold );
7272
}
7373

7474
static UINT CREATE_close( struct tagMSIVIEW *view )

dll/win32/msi/query.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ int sqliteGetToken(const WCHAR *z, int *tokenType, int *skip) DECLSPEC_HIDDEN;
149149
MSIRECORD *msi_query_merge_record( UINT fields, const column_info *vl, MSIRECORD *rec ) DECLSPEC_HIDDEN;
150150

151151
UINT msi_create_table( MSIDATABASE *db, LPCWSTR name, column_info *col_info,
152-
MSICONDITION persistent ) DECLSPEC_HIDDEN;
152+
MSICONDITION persistent, BOOL hold ) DECLSPEC_HIDDEN;
153153

154154
UINT msi_select_update( MSIVIEW *view, MSIRECORD *rec, UINT row ) DECLSPEC_HIDDEN;
155155

dll/win32/msi/table.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -713,7 +713,7 @@ static UINT get_tablecolumns( MSIDATABASE *db, LPCWSTR szTableName, MSICOLUMNINF
713713
}
714714

715715
UINT msi_create_table( MSIDATABASE *db, LPCWSTR name, column_info *col_info,
716-
MSICONDITION persistent )
716+
MSICONDITION persistent, BOOL hold )
717717
{
718718
UINT r, nField;
719719
MSIVIEW *tv = NULL;
@@ -733,7 +733,7 @@ UINT msi_create_table( MSIDATABASE *db, LPCWSTR name, column_info *col_info,
733733
if( !table )
734734
return ERROR_FUNCTION_FAILED;
735735

736-
table->ref_count = 1;
736+
table->ref_count = 0;
737737
table->row_count = 0;
738738
table->data = NULL;
739739
table->data_persistent = NULL;
@@ -742,6 +742,9 @@ UINT msi_create_table( MSIDATABASE *db, LPCWSTR name, column_info *col_info,
742742
table->persistent = persistent;
743743
lstrcpyW( table->name, name );
744744

745+
if( hold )
746+
table->ref_count++;
747+
745748
for( col = col_info; col; col = col->next )
746749
table->col_count++;
747750

0 commit comments

Comments
 (0)