winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
April 2007
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
4 participants
687 discussions
Start a n
N
ew thread
Rob Shearman : msi: Don' t add info to the _Columns table for non-persistent tables.
by Alexandre Julliard
24 Apr '07
24 Apr '07
Module: wine Branch: master Commit: a33cc3d859992aa783dcfca92e3fb31b054df1f5 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=a33cc3d859992aa783dcfca92…
Author: Rob Shearman <rob(a)codeweavers.com> Date: Mon Apr 23 08:25:17 2007 +0100 msi: Don't add info to the _Columns table for non-persistent tables. --- dlls/msi/table.c | 71 ++++++++++++++++++++++++++------------------------ dlls/msi/tests/db.c | 2 - 2 files changed, 37 insertions(+), 36 deletions(-) diff --git a/dlls/msi/table.c b/dlls/msi/table.c index ddf0ee4..09abe1a 100644 --- a/dlls/msi/table.c +++ b/dlls/msi/table.c @@ -670,7 +670,7 @@ UINT msi_create_table( MSIDATABASE *db, LPCWSTR name, column_info *col_info, if( r ) goto err; - r = tv->ops->insert_row( tv, rec, FALSE ); + r = tv->ops->insert_row( tv, rec, !persistent ); TRACE("insert_row returned %x\n", r); if( r ) goto err; @@ -680,51 +680,54 @@ UINT msi_create_table( MSIDATABASE *db, LPCWSTR name, column_info *col_info, msiobj_release( &rec->hdr ); - /* add each column to the _Columns table */ - r = TABLE_CreateView( db, szColumns, &tv ); - if( r ) - return r; - - r = tv->ops->execute( tv, 0 ); - TRACE("tv execute returned %x\n", r); - if( r ) - goto err; - - rec = MSI_CreateRecord( 4 ); - if( !rec ) - goto err; - - r = MSI_RecordSetStringW( rec, 1, name ); - if( r ) - goto err; - - /* - * need to set the table, column number, col name and type - * for each column we enter in the table - */ - nField = 1; - for( col = col_info; col; col = col->next ) + if( persistent ) { - r = MSI_RecordSetInteger( rec, 2, nField ); + /* add each column to the _Columns table */ + r = TABLE_CreateView( db, szColumns, &tv ); if( r ) - goto err; + return r; - r = MSI_RecordSetStringW( rec, 3, col->column ); + r = tv->ops->execute( tv, 0 ); + TRACE("tv execute returned %x\n", r); if( r ) goto err; - r = MSI_RecordSetInteger( rec, 4, col->type ); - if( r ) + rec = MSI_CreateRecord( 4 ); + if( !rec ) goto err; - r = tv->ops->insert_row( tv, rec, !persistent ); + r = MSI_RecordSetStringW( rec, 1, name ); if( r ) goto err; - nField++; + /* + * need to set the table, column number, col name and type + * for each column we enter in the table + */ + nField = 1; + for( col = col_info; col; col = col->next ) + { + r = MSI_RecordSetInteger( rec, 2, nField ); + if( r ) + goto err; + + r = MSI_RecordSetStringW( rec, 3, col->column ); + if( r ) + goto err; + + r = MSI_RecordSetInteger( rec, 4, col->type ); + if( r ) + goto err; + + r = tv->ops->insert_row( tv, rec, FALSE ); + if( r ) + goto err; + + nField++; + } + if( !col ) + r = ERROR_SUCCESS; } - if( !col ) - r = ERROR_SUCCESS; err: if (rec) diff --git a/dlls/msi/tests/db.c b/dlls/msi/tests/db.c index 53599ed..422bba3 100644 --- a/dlls/msi/tests/db.c +++ b/dlls/msi/tests/db.c @@ -2730,7 +2730,6 @@ static void test_temporary_table(void) ok( r == ERROR_SUCCESS, "temporary table exists in _Tables\n"); MsiCloseHandle( rec ); - todo_wine { /* query the column data */ rec = 0; r = do_query(hdb, "select * from `_Columns` where `Table` = 'T' AND `Name` = 'B'", &rec); @@ -2740,7 +2739,6 @@ static void test_temporary_table(void) r = do_query(hdb, "select * from `_Columns` where `Table` = 'T' AND `Name` = 'C'", &rec); ok( r == ERROR_NO_MORE_ITEMS, "temporary table exists in _Columns\n"); if (rec) MsiCloseHandle( rec ); - } MsiCloseHandle( hdb );
1
0
0
0
Rob Shearman : msi: Add support for adding temporary/ non-persistent data to tables.
by Alexandre Julliard
24 Apr '07
24 Apr '07
Module: wine Branch: master Commit: 23379b3b5c5b2e008ad147a45a43221db2d94385 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=23379b3b5c5b2e008ad147a45…
Author: Rob Shearman <rob(a)codeweavers.com> Date: Mon Apr 23 08:24:41 2007 +0100 msi: Add support for adding temporary/non-persistent data to tables. --- dlls/msi/insert.c | 2 +- dlls/msi/msipriv.h | 2 +- dlls/msi/select.c | 4 +- dlls/msi/table.c | 129 ++++++++++++++++++++++++++++++++++++++-------------- 4 files changed, 99 insertions(+), 38 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=23379b3b5c5b2e008ad14…
1
0
0
0
Rob Shearman : msi: The HOLD keyword implies a temporary table, whereas database importing should lead to permanent tables, so remove the HOLD keyword.
by Alexandre Julliard
24 Apr '07
24 Apr '07
Module: wine Branch: master Commit: d8cd46ac47c71f96c67c1a25e2c29875c82ab420 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=d8cd46ac47c71f96c67c1a25e…
Author: Rob Shearman <rob(a)codeweavers.com> Date: Mon Apr 23 08:23:13 2007 +0100 msi: The HOLD keyword implies a temporary table, whereas database importing should lead to permanent tables, so remove the HOLD keyword. --- dlls/msi/database.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/dlls/msi/database.c b/dlls/msi/database.c index ea3e964..875f440 100644 --- a/dlls/msi/database.c +++ b/dlls/msi/database.c @@ -423,7 +423,7 @@ static LPWSTR msi_build_createsql_postlude(LPWSTR *primary_keys, DWORD num_keys) DWORD size, key_size, i; static const WCHAR key_fmt[] = {'`','%','s','`',',',' ',0}; - static const WCHAR postlude_fmt[] = {'P','R','I','M','A','R','Y',' ','K','E','Y',' ','%','s',')',' ','H','O','L','D',0}; + static const WCHAR postlude_fmt[] = {'P','R','I','M','A','R','Y',' ','K','E','Y',' ','%','s',')',0}; for (i = 0, size = 1; i < num_keys; i++) size += lstrlenW(key_fmt) + lstrlenW(primary_keys[i]) - 2;
1
0
0
0
Rob Shearman : msi: Create the table directly in create_table instead of requiring it to be loaded after saving .
by Alexandre Julliard
24 Apr '07
24 Apr '07
Module: wine Branch: master Commit: 338568886c1611d4a68ee920539381a303701fa1 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=338568886c1611d4a68ee9205…
Author: Rob Shearman <rob(a)codeweavers.com> Date: Mon Apr 23 08:22:27 2007 +0100 msi: Create the table directly in create_table instead of requiring it to be loaded after saving. --- dlls/msi/table.c | 47 ++++++++++++++++++++++++++++++++++++++++++++--- 1 files changed, 44 insertions(+), 3 deletions(-) diff --git a/dlls/msi/table.c b/dlls/msi/table.c index dbc292d..712a4af 100644 --- a/dlls/msi/table.c +++ b/dlls/msi/table.c @@ -102,6 +102,7 @@ static const MSICOLUMNINFO _Tables_cols[1] = { static UINT table_get_column_info( MSIDATABASE *db, LPCWSTR name, MSICOLUMNINFO **pcols, UINT *pcount ); +static void table_calc_column_offsets( MSICOLUMNINFO *colinfo, DWORD count ); static UINT get_tablecolumns( MSIDATABASE *db, LPCWSTR szTableName, MSICOLUMNINFO *colinfo, UINT *sz); static void msi_free_colinfo( MSICOLUMNINFO *colinfo, UINT count ); @@ -593,8 +594,6 @@ static UINT table_get_column_info( MSIDATABASE *db, LPCWSTR name, MSICOLUMNINFO return r; } -static UINT get_table( MSIDATABASE *db, LPCWSTR name, MSITABLE **table_ret ); - UINT msi_create_table( MSIDATABASE *db, LPCWSTR name, column_info *col_info, BOOL persistent, MSITABLE **table_ret) { @@ -602,15 +601,51 @@ UINT msi_create_table( MSIDATABASE *db, LPCWSTR name, column_info *col_info, MSIVIEW *tv = NULL; MSIRECORD *rec = NULL; column_info *col; + MSITABLE *table; + UINT i; /* only add tables that don't exist already */ if( TABLE_Exists(db, name ) ) return ERROR_BAD_QUERY_SYNTAX; + table = msi_alloc( sizeof (MSITABLE) + lstrlenW(name)*sizeof (WCHAR) ); + if( !table ) + return ERROR_FUNCTION_FAILED; + + table->row_count = 0; + table->data = NULL; + table->colinfo = NULL; + table->col_count = 0; + lstrcpyW( table->name, name ); + + for( col = col_info; col; col = col->next ) + table->col_count++; + + table->colinfo = msi_alloc( table->col_count * sizeof(MSICOLUMNINFO) ); + if (!table->colinfo) + { + free_table( table ); + return ERROR_FUNCTION_FAILED; + } + + for( i = 0, col = col_info; col; i++, col = col->next ) + { + table->colinfo[ i ].tablename = strdupW( col->table ); + table->colinfo[ i ].number = i + 1; + table->colinfo[ i ].colname = strdupW( col->column ); + table->colinfo[ i ].type = col->type; + table->colinfo[ i ].offset = 0; + table->colinfo[ i ].hash_table = NULL; + } + table_calc_column_offsets( table->colinfo, table->col_count); + r = TABLE_CreateView( db, szTables, &tv ); TRACE("CreateView returned %x\n", r); if( r ) + { + free_table( table ); return r; + } r = tv->ops->execute( tv, 0 ); TRACE("tv execute returned %x\n", r); @@ -689,7 +724,13 @@ err: tv->ops->delete( tv ); if (r == ERROR_SUCCESS) - r = get_table( db, name, table_ret ); + { + list_add_head( &db->tables, &table->entry ); + *table_ret = table; + } + else + free_table( table ); + return r; }
1
0
0
0
Rob Shearman : msi: Move table creation to table.c.
by Alexandre Julliard
24 Apr '07
24 Apr '07
Module: wine Branch: master Commit: ba0507a178b223e7d21ea29e19c54e23e2db5107 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=ba0507a178b223e7d21ea29e1…
Author: Rob Shearman <rob(a)codeweavers.com> Date: Mon Apr 23 08:21:32 2007 +0100 msi: Move table creation to table.c. --- dlls/msi/create.c | 93 +------------------------------------------------ dlls/msi/query.h | 3 ++ dlls/msi/table.c | 100 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 105 insertions(+), 91 deletions(-) diff --git a/dlls/msi/create.c b/dlls/msi/create.c index 740f563..ef71684 100644 --- a/dlls/msi/create.c +++ b/dlls/msi/create.c @@ -59,101 +59,12 @@ static UINT CREATE_fetch_int( struct tagMSIVIEW *view, UINT row, UINT col, UINT static UINT CREATE_execute( struct tagMSIVIEW *view, MSIRECORD *record ) { MSICREATEVIEW *cv = (MSICREATEVIEW*)view; - column_info *col; - UINT r, nField; - static const WCHAR szTables[] = { '_','T','a','b','l','e','s',0 }; - static const WCHAR szColumns[] = { '_','C','o','l','u','m','n','s',0 }; - MSIVIEW *tv = NULL; - MSIRECORD *rec = NULL; + MSITABLE *table; TRACE("%p Table %s (%s)\n", cv, debugstr_w(cv->name), cv->bIsTemp?"temporary":"permanent"); - /* only add tables that don't exist already */ - if( TABLE_Exists(cv->db, cv->name ) ) - return ERROR_BAD_QUERY_SYNTAX; - - r = TABLE_CreateView( cv->db, szTables, &tv ); - TRACE("CreateView returned %x\n", r); - if( r ) - return r; - - r = tv->ops->execute( tv, 0 ); - TRACE("tv execute returned %x\n", r); - if( r ) - goto err; - - rec = MSI_CreateRecord( 1 ); - if( !rec ) - goto err; - - r = MSI_RecordSetStringW( rec, 1, cv->name ); - if( r ) - goto err; - - r = tv->ops->insert_row( tv, rec ); - TRACE("insert_row returned %x\n", r); - if( r ) - goto err; - - tv->ops->delete( tv ); - tv = NULL; - - msiobj_release( &rec->hdr ); - - /* add each column to the _Columns table */ - r = TABLE_CreateView( cv->db, szColumns, &tv ); - if( r ) - return r; - - r = tv->ops->execute( tv, 0 ); - TRACE("tv execute returned %x\n", r); - if( r ) - goto err; - - rec = MSI_CreateRecord( 4 ); - if( !rec ) - goto err; - - r = MSI_RecordSetStringW( rec, 1, cv->name ); - if( r ) - goto err; - - /* - * need to set the table, column number, col name and type - * for each column we enter in the table - */ - nField = 1; - for( col = cv->col_info; col; col = col->next ) - { - r = MSI_RecordSetInteger( rec, 2, nField ); - if( r ) - goto err; - - r = MSI_RecordSetStringW( rec, 3, col->column ); - if( r ) - goto err; - - r = MSI_RecordSetInteger( rec, 4, col->type ); - if( r ) - goto err; - - r = tv->ops->insert_row( tv, rec ); - if( r ) - goto err; - - nField++; - } - if( !col ) - r = ERROR_SUCCESS; - -err: - if (rec) - msiobj_release( &rec->hdr ); - /* FIXME: remove values from the string table on error */ - if( tv ) - tv->ops->delete( tv ); - return r; + return msi_create_table( cv->db, cv->name, cv->col_info, !cv->bIsTemp, &table); } static UINT CREATE_close( struct tagMSIVIEW *view ) diff --git a/dlls/msi/query.h b/dlls/msi/query.h index 86773ad..a8a633f 100644 --- a/dlls/msi/query.h +++ b/dlls/msi/query.h @@ -127,4 +127,7 @@ int sqliteGetToken(const WCHAR *z, int *tokenType); MSIRECORD *msi_query_merge_record( UINT fields, column_info *vl, MSIRECORD *rec ); +UINT msi_create_table( MSIDATABASE *db, LPCWSTR name, column_info *col_info, + BOOL persistent, MSITABLE **table_ret); + #endif /* __WINE_MSI_QUERY_H */ diff --git a/dlls/msi/table.c b/dlls/msi/table.c index e414517..dbc292d 100644 --- a/dlls/msi/table.c +++ b/dlls/msi/table.c @@ -593,6 +593,106 @@ static UINT table_get_column_info( MSIDATABASE *db, LPCWSTR name, MSICOLUMNINFO return r; } +static UINT get_table( MSIDATABASE *db, LPCWSTR name, MSITABLE **table_ret ); + +UINT msi_create_table( MSIDATABASE *db, LPCWSTR name, column_info *col_info, + BOOL persistent, MSITABLE **table_ret) +{ + UINT r, nField; + MSIVIEW *tv = NULL; + MSIRECORD *rec = NULL; + column_info *col; + + /* only add tables that don't exist already */ + if( TABLE_Exists(db, name ) ) + return ERROR_BAD_QUERY_SYNTAX; + + r = TABLE_CreateView( db, szTables, &tv ); + TRACE("CreateView returned %x\n", r); + if( r ) + return r; + + r = tv->ops->execute( tv, 0 ); + TRACE("tv execute returned %x\n", r); + if( r ) + goto err; + + rec = MSI_CreateRecord( 1 ); + if( !rec ) + goto err; + + r = MSI_RecordSetStringW( rec, 1, name ); + if( r ) + goto err; + + r = tv->ops->insert_row( tv, rec ); + TRACE("insert_row returned %x\n", r); + if( r ) + goto err; + + tv->ops->delete( tv ); + tv = NULL; + + msiobj_release( &rec->hdr ); + + /* add each column to the _Columns table */ + r = TABLE_CreateView( db, szColumns, &tv ); + if( r ) + return r; + + r = tv->ops->execute( tv, 0 ); + TRACE("tv execute returned %x\n", r); + if( r ) + goto err; + + rec = MSI_CreateRecord( 4 ); + if( !rec ) + goto err; + + r = MSI_RecordSetStringW( rec, 1, name ); + if( r ) + goto err; + + /* + * need to set the table, column number, col name and type + * for each column we enter in the table + */ + nField = 1; + for( col = col_info; col; col = col->next ) + { + r = MSI_RecordSetInteger( rec, 2, nField ); + if( r ) + goto err; + + r = MSI_RecordSetStringW( rec, 3, col->column ); + if( r ) + goto err; + + r = MSI_RecordSetInteger( rec, 4, col->type ); + if( r ) + goto err; + + r = tv->ops->insert_row( tv, rec ); + if( r ) + goto err; + + nField++; + } + if( !col ) + r = ERROR_SUCCESS; + +err: + if (rec) + msiobj_release( &rec->hdr ); + /* FIXME: remove values from the string table on error */ + if( tv ) + tv->ops->delete( tv ); + + if (r == ERROR_SUCCESS) + r = get_table( db, name, table_ret ); + return r; +} + static UINT get_table( MSIDATABASE *db, LPCWSTR name, MSITABLE **table_ret ) { MSITABLE *table;
1
0
0
0
Rob Shearman : msi: Store the column info in the MSITABLE structure.
by Alexandre Julliard
24 Apr '07
24 Apr '07
Module: wine Branch: master Commit: 3aa9a25cb3302f12d331827f5d9b7146c01fb81c URL:
http://source.winehq.org/git/wine.git/?a=commit;h=3aa9a25cb3302f12d331827f5…
Author: Rob Shearman <rob(a)codeweavers.com> Date: Mon Apr 23 08:20:21 2007 +0100 msi: Store the column info in the MSITABLE structure. Load the data on view creation for simplicity instead of view execution. --- dlls/msi/table.c | 216 +++++++++++++++++++++++++----------------------------- 1 files changed, 101 insertions(+), 115 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=3aa9a25cb3302f12d3318…
1
0
0
0
Rob Shearman : msi: Remove the hash table for a column when one of its values is modified since it will now be invalid .
by Alexandre Julliard
24 Apr '07
24 Apr '07
Module: wine Branch: master Commit: 94d48238ffe8edc3778f71b3467100c9beff0a33 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=94d48238ffe8edc3778f71b34…
Author: Rob Shearman <rob(a)codeweavers.com> Date: Mon Apr 23 08:19:07 2007 +0100 msi: Remove the hash table for a column when one of its values is modified since it will now be invalid. --- dlls/msi/table.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/dlls/msi/table.c b/dlls/msi/table.c index 1f8e118..2e83477 100644 --- a/dlls/msi/table.c +++ b/dlls/msi/table.c @@ -996,6 +996,9 @@ static UINT TABLE_set_int( MSITABLEVIEW *tv, UINT row, UINT col, UINT val ) return ERROR_FUNCTION_FAILED; } + msi_free( tv->columns[col-1].hash_table ); + tv->columns[col-1].hash_table = NULL; + n = bytes_per_column( &tv->columns[col-1] ); switch( n ) {
1
0
0
0
Rob Shearman : msi: Cleanup unneeded string table functions.
by Alexandre Julliard
24 Apr '07
24 Apr '07
Module: wine Branch: master Commit: e261d602fb2db22f0532e45252298f3b23b8c070 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=e261d602fb2db22f0532e4525…
Author: Rob Shearman <rob(a)codeweavers.com> Date: Mon Apr 23 08:18:27 2007 +0100 msi: Cleanup unneeded string table functions. Make string table functions that aren't used outside of string.c static. --- dlls/msi/msipriv.h | 6 ------ dlls/msi/string.c | 44 +++++++++++++------------------------------- 2 files changed, 13 insertions(+), 37 deletions(-) diff --git a/dlls/msi/msipriv.h b/dlls/msi/msipriv.h index 670719c..713ae7f 100644 --- a/dlls/msi/msipriv.h +++ b/dlls/msi/msipriv.h @@ -546,21 +546,15 @@ enum StringPersistence StringNonPersistent = 1 }; -extern BOOL msi_addstring( string_table *st, UINT string_no, const CHAR *data, int len, UINT refcount, enum StringPersistence persistence ); extern BOOL msi_addstringW( string_table *st, UINT string_no, const WCHAR *data, int len, UINT refcount, enum StringPersistence persistence ); extern UINT msi_id2stringW( string_table *st, UINT string_no, LPWSTR buffer, UINT *sz ); extern UINT msi_id2stringA( string_table *st, UINT string_no, LPSTR buffer, UINT *sz ); extern UINT msi_string2idW( string_table *st, LPCWSTR buffer, UINT *id ); extern UINT msi_string2idA( string_table *st, LPCSTR str, UINT *id ); -extern string_table *msi_init_stringtable( int entries, UINT codepage ); extern VOID msi_destroy_stringtable( string_table *st ); -extern UINT msi_string_count( string_table *st ); -extern UINT msi_id_persistent_refcount( string_table *st, UINT i ); -extern UINT msi_string_totalsize( string_table *st, UINT *datasize, UINT *poolsize ); extern UINT msi_strcmp( string_table *st, UINT lval, UINT rval, UINT *res ); extern const WCHAR *msi_string_lookup_id( string_table *st, UINT id ); -extern UINT msi_string_get_codepage( string_table *st ); extern HRESULT msi_init_string_table( IStorage *stg ); extern string_table *msi_load_string_table( IStorage *stg ); extern UINT msi_save_string_table( string_table *st, IStorage *storage ); diff --git a/dlls/msi/string.c b/dlls/msi/string.c index 21b10ee..ef6d7c7 100644 --- a/dlls/msi/string.c +++ b/dlls/msi/string.c @@ -1,7 +1,8 @@ /* - * Implementation of the Microsoft Installer (msi.dll) + * String Table Functions * * Copyright 2002-2004, Mike McCormack for CodeWeavers + * Copyright 2007 Robert Shearman for CodeWeavers * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -74,7 +75,7 @@ static UINT msistring_makehash( const WCHAR *str ) return hash % HASH_SIZE; } -string_table *msi_init_stringtable( int entries, UINT codepage ) +static string_table *init_stringtable( int entries, UINT codepage ) { string_table *st; int i; @@ -171,7 +172,7 @@ static void set_st_entry( string_table *st, UINT n, LPWSTR str, UINT refcount, e st->freeslot = n + 1; } -int msi_addstring( string_table *st, UINT n, const CHAR *data, int len, UINT refcount, enum StringPersistence persistence ) +static int msi_addstring( string_table *st, UINT n, const CHAR *data, int len, UINT refcount, enum StringPersistence persistence ) { LPWSTR str; int sz; @@ -448,19 +449,7 @@ UINT msi_strcmp( string_table *st, UINT lval, UINT rval, UINT *res ) return ERROR_SUCCESS; } -UINT msi_string_count( string_table *st ) -{ - return st->maxcount; -} - -UINT msi_id_persistent_refcount( string_table *st, UINT i ) -{ - if( i >= st->maxcount ) - return 0; - return st->strings[i].persistent_refcount; -} - -UINT msi_string_totalsize( string_table *st, UINT *datasize, UINT *poolsize ) +static void string_totalsize( string_table *st, UINT *datasize, UINT *poolsize ) { UINT i, len, max, holesize; @@ -493,12 +482,6 @@ UINT msi_string_totalsize( string_table *st, UINT *datasize, UINT *poolsize ) holesize += 4; } TRACE("data %u pool %u codepage %x\n", *datasize, *poolsize, st->codepage ); - return max; -} - -UINT msi_string_get_codepage( string_table *st ) -{ - return st->codepage; } static const WCHAR szStringData[] = { @@ -544,7 +527,7 @@ string_table *msi_load_string_table( IStorage *stg ) codepage = pool[0] | ( pool[1] << 16 ); else codepage = CP_ACP; - st = msi_init_stringtable( count, codepage ); + st = init_stringtable( count, codepage ); offset = 0; n = 1; @@ -605,7 +588,7 @@ end: UINT msi_save_string_table( string_table *st, IStorage *storage ) { - UINT i, count, datasize = 0, poolsize = 0, sz, used, r, codepage, n; + UINT i, datasize = 0, poolsize = 0, sz, used, r, codepage, n; UINT ret = ERROR_FUNCTION_FAILED; CHAR *data = NULL; USHORT *pool = NULL; @@ -613,9 +596,9 @@ UINT msi_save_string_table( string_table *st, IStorage *storage ) TRACE("\n"); /* construct the new table in memory first */ - count = msi_string_totalsize( st, &datasize, &poolsize ); + string_totalsize( st, &datasize, &poolsize ); - TRACE("%u %u %u\n", count, datasize, poolsize ); + TRACE("%u %u %u\n", st->maxcount, datasize, poolsize ); pool = msi_alloc( poolsize ); if( ! pool ) @@ -631,14 +614,13 @@ UINT msi_save_string_table( string_table *st, IStorage *storage ) } used = 0; - codepage = msi_string_get_codepage( st ); + codepage = st->codepage; pool[0]=codepage&0xffff; pool[1]=(codepage>>16); n = 1; - for( i=1; i<count; i++ ) + for( i=1; i<st->maxcount; i++ ) { - UINT refcount = msi_id_persistent_refcount( st, i ); - if( !refcount ) + if( !st->strings[i].persistent_refcount ) continue; sz = datasize - used; r = msi_id2stringA( st, i, data+used, &sz ); @@ -651,7 +633,7 @@ UINT msi_save_string_table( string_table *st, IStorage *storage ) sz--; if (sz) - pool[ n*2 + 1 ] = refcount; + pool[ n*2 + 1 ] = st->strings[i].persistent_refcount; else pool[ n*2 + 1 ] = 0; if (sz < 0x10000)
1
0
0
0
Rob Shearman : msi: Move string loading and saving to string.c.
by Alexandre Julliard
24 Apr '07
24 Apr '07
Module: wine Branch: master Commit: 37b11baaa3448df1662ca6a970f56dc4f0ce3523 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=37b11baaa3448df1662ca6a97…
Author: Rob Shearman <rob(a)codeweavers.com> Date: Mon Apr 23 08:17:40 2007 +0100 msi: Move string loading and saving to string.c. --- dlls/msi/database.c | 4 +- dlls/msi/msipriv.h | 9 ++- dlls/msi/string.c | 200 ++++++++++++++++++++++++++++++++++++++++++ dlls/msi/table.c | 242 +++------------------------------------------------ 4 files changed, 222 insertions(+), 233 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=37b11baaa3448df1662ca…
1
0
0
0
Rob Shearman : msi: Add support for non-persistent strings.
by Alexandre Julliard
24 Apr '07
24 Apr '07
Module: wine Branch: master Commit: 2e3289ca6c76627073f8960057a599452654c646 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=2e3289ca6c76627073f896005…
Author: Rob Shearman <rob(a)codeweavers.com> Date: Mon Apr 23 08:17:00 2007 +0100 msi: Add support for non-persistent strings. Store the loaded refcount in the string table. --- dlls/msi/msipriv.h | 12 +++++++-- dlls/msi/string.c | 63 ++++++++++++++++++++++++++++++++++++--------------- dlls/msi/table.c | 9 +++++-- 3 files changed, 59 insertions(+), 25 deletions(-) diff --git a/dlls/msi/msipriv.h b/dlls/msi/msipriv.h index b160443..b8a4bef 100644 --- a/dlls/msi/msipriv.h +++ b/dlls/msi/msipriv.h @@ -542,8 +542,14 @@ extern HRESULT init_string_table( IStorage *stg ); /* string table functions */ -extern BOOL msi_addstring( string_table *st, UINT string_no, const CHAR *data, int len, UINT refcount ); -extern BOOL msi_addstringW( string_table *st, UINT string_no, const WCHAR *data, int len, UINT refcount ); +enum StringPersistence +{ + StringPersistent = 0, + StringNonPersistent = 1 +}; + +extern BOOL msi_addstring( string_table *st, UINT string_no, const CHAR *data, int len, UINT refcount, enum StringPersistence persistence ); +extern BOOL msi_addstringW( string_table *st, UINT string_no, const WCHAR *data, int len, UINT refcount, enum StringPersistence persistence ); extern UINT msi_id2stringW( string_table *st, UINT string_no, LPWSTR buffer, UINT *sz ); extern UINT msi_id2stringA( string_table *st, UINT string_no, LPSTR buffer, UINT *sz ); @@ -552,7 +558,7 @@ extern UINT msi_string2idA( string_table *st, LPCSTR str, UINT *id ); extern string_table *msi_init_stringtable( int entries, UINT codepage ); extern VOID msi_destroy_stringtable( string_table *st ); extern UINT msi_string_count( string_table *st ); -extern UINT msi_id_refcount( string_table *st, UINT i ); +extern UINT msi_id_persistent_refcount( string_table *st, UINT i ); extern UINT msi_string_totalsize( string_table *st, UINT *datasize, UINT *poolsize ); extern UINT msi_strcmp( string_table *st, UINT lval, UINT rval, UINT *res ); extern const WCHAR *msi_string_lookup_id( string_table *st, UINT id ); diff --git a/dlls/msi/string.c b/dlls/msi/string.c index 7a80663..16ed478 100644 --- a/dlls/msi/string.c +++ b/dlls/msi/string.c @@ -42,7 +42,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(msidb); typedef struct _msistring { int hash_next; - UINT refcount; + UINT persistent_refcount; + UINT nonpersistent_refcount; LPWSTR str; } msistring; @@ -103,7 +104,8 @@ VOID msi_destroy_stringtable( string_table *st ) for( i=0; i<st->maxcount; i++ ) { - if( st->strings[i].refcount ) + if( st->strings[i].persistent_refcount || + st->strings[i].nonpersistent_refcount ) msi_free( st->strings[i].str ); } msi_free( st->strings ); @@ -120,11 +122,13 @@ static int st_find_free_entry( string_table *st ) if( st->freeslot ) { for( i = st->freeslot; i < st->maxcount; i++ ) - if( !st->strings[i].refcount ) + if( !st->strings[i].persistent_refcount && + !st->strings[i].nonpersistent_refcount ) return i; } for( i = 1; i < st->maxcount; i++ ) - if( !st->strings[i].refcount ) + if( !st->strings[i].persistent_refcount && + !st->strings[i].nonpersistent_refcount ) return i; /* dynamically resize */ @@ -135,16 +139,27 @@ static int st_find_free_entry( string_table *st ) st->strings = p; st->freeslot = st->maxcount; st->maxcount = sz; - if( st->strings[st->freeslot].refcount ) + if( st->strings[st->freeslot].persistent_refcount || + st->strings[st->freeslot].nonpersistent_refcount ) ERR("oops. expected freeslot to be free...\n"); return st->freeslot; } -static void set_st_entry( string_table *st, UINT n, LPWSTR str ) +static void set_st_entry( string_table *st, UINT n, LPWSTR str, UINT refcount, enum StringPersistence persistence ) { UINT hash = msistring_makehash( str ); - st->strings[n].refcount = 1; + if (persistence == StringPersistent) + { + st->strings[n].persistent_refcount = refcount; + st->strings[n].nonpersistent_refcount = 0; + } + else + { + st->strings[n].persistent_refcount = 0; + st->strings[n].nonpersistent_refcount = refcount; + } + st->strings[n].str = str; st->strings[n].hash_next = st->hash[hash]; @@ -154,7 +169,7 @@ static void set_st_entry( string_table *st, UINT n, LPWSTR str ) st->freeslot = n + 1; } -int msi_addstring( string_table *st, UINT n, const CHAR *data, int len, UINT refcount ) +int msi_addstring( string_table *st, UINT n, const CHAR *data, int len, UINT refcount, enum StringPersistence persistence ) { LPWSTR str; int sz; @@ -165,14 +180,18 @@ int msi_addstring( string_table *st, UINT n, const CHAR *data, int len, UINT ref return 0; if( n > 0 ) { - if( st->strings[n].refcount ) + if( st->strings[n].persistent_refcount || + st->strings[n].nonpersistent_refcount ) return -1; } else { if( ERROR_SUCCESS == msi_string2idA( st, data, &n ) ) { - st->strings[n].refcount++; + if (persistence == StringPersistent) + st->strings[n].persistent_refcount += refcount; + else + st->strings[n].nonpersistent_refcount += refcount; return n; } n = st_find_free_entry( st ); @@ -196,12 +215,12 @@ int msi_addstring( string_table *st, UINT n, const CHAR *data, int len, UINT ref MultiByteToWideChar( st->codepage, 0, data, len, str, sz ); str[sz] = 0; - set_st_entry( st, n, str ); + set_st_entry( st, n, str, refcount, persistence ); return n; } -int msi_addstringW( string_table *st, UINT n, const WCHAR *data, int len, UINT refcount ) +int msi_addstringW( string_table *st, UINT n, const WCHAR *data, int len, UINT refcount, enum StringPersistence persistence ) { LPWSTR str; @@ -213,14 +232,18 @@ int msi_addstringW( string_table *st, UINT n, const WCHAR *data, int len, UINT r return 0; if( n > 0 ) { - if( st->strings[n].refcount ) + if( st->strings[n].persistent_refcount || + st->strings[n].nonpersistent_refcount ) return -1; } else { if( ERROR_SUCCESS == msi_string2idW( st, data, &n ) ) { - st->strings[n].refcount++; + if (persistence == StringPersistent) + st->strings[n].persistent_refcount += refcount; + else + st->strings[n].nonpersistent_refcount += refcount; return n; } n = st_find_free_entry( st ); @@ -246,7 +269,7 @@ int msi_addstringW( string_table *st, UINT n, const WCHAR *data, int len, UINT r memcpy( str, data, len*sizeof(WCHAR) ); str[len] = 0; - set_st_entry( st, n, str ); + set_st_entry( st, n, str, refcount, persistence ); return n; } @@ -261,7 +284,7 @@ const WCHAR *msi_string_lookup_id( string_table *st, UINT id ) if( id >= st->maxcount ) return NULL; - if( id && !st->strings[id].refcount ) + if( id && !st->strings[id].persistent_refcount && !st->strings[id].nonpersistent_refcount) return NULL; return st->strings[id].str; @@ -428,18 +451,18 @@ UINT msi_string_count( string_table *st ) return st->maxcount; } -UINT msi_id_refcount( string_table *st, UINT i ) +UINT msi_id_persistent_refcount( string_table *st, UINT i ) { if( i >= st->maxcount ) return 0; - return st->strings[i].refcount; + return st->strings[i].persistent_refcount; } UINT msi_string_totalsize( string_table *st, UINT *datasize, UINT *poolsize ) { UINT i, len, max, holesize; - if( st->strings[0].str || st->strings[0].refcount ) + if( st->strings[0].str || st->strings[0].persistent_refcount || st->strings[0].nonpersistent_refcount) ERR("oops. element 0 has a string\n"); *poolsize = 4; @@ -448,6 +471,8 @@ UINT msi_string_totalsize( string_table *st, UINT *datasize, UINT *poolsize ) holesize = 0; for( i=1; i<st->maxcount; i++ ) { + if( !st->strings[i].persistent_refcount ) + continue; if( st->strings[i].str ) { TRACE("[%u] = %s\n", i, debugstr_w(st->strings[i].str)); diff --git a/dlls/msi/table.c b/dlls/msi/table.c index ce5df79..f256726 100644 --- a/dlls/msi/table.c +++ b/dlls/msi/table.c @@ -743,7 +743,7 @@ string_table *load_string_table( IStorage *stg ) break; } - r = msi_addstring( st, n, data+offset, len, refs ); + r = msi_addstring( st, n, data+offset, len, refs, StringPersistent ); if( r != n ) ERR("Failed to add string %d\n", n ); n++; @@ -796,6 +796,9 @@ static UINT save_string_table( MSIDATABASE *db ) n = 1; for( i=1; i<count; i++ ) { + UINT refcount = msi_id_persistent_refcount( db->strings, i ); + if( !refcount ) + continue; sz = datasize - used; r = msi_id2stringA( db->strings, i, data+used, &sz ); if( r != ERROR_SUCCESS ) @@ -807,7 +810,7 @@ static UINT save_string_table( MSIDATABASE *db ) sz--; if (sz) - pool[ n*2 + 1 ] = msi_id_refcount( db->strings, i ); + pool[ n*2 + 1 ] = refcount; else pool[ n*2 + 1 ] = 0; if (sz < 0x10000) @@ -1258,7 +1261,7 @@ static UINT TABLE_set_row( struct tagMSIVIEW *view, UINT row, MSIRECORD *rec, UI else if ( tv->columns[i].type & MSITYPE_STRING ) { LPCWSTR sval = MSI_RecordGetString( rec, i + 1 ); - val = msi_addstringW( tv->db->strings, 0, sval, -1, 1 ); + val = msi_addstringW( tv->db->strings, 0, sval, -1, 1, StringPersistent ); } else if ( 2 == bytes_per_column( &tv->columns[ i ] ) ) {
1
0
0
0
← Newer
1
...
13
14
15
16
17
18
19
...
69
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
Results per page:
10
25
50
100
200