ReactOS.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
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
List overview
Download
Ros-diffs
March 2022
----- 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
ros-diffs@reactos.org
20 participants
436 discussions
Start a n
N
ew thread
[reactos] 191/360: [WINESYNC] msi: Factor out msi_view_refresh_row().
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=bef9fb024537aeed662a0…
commit bef9fb024537aeed662a0ef9652db6bda916300a Author: winesync <ros-dev(a)reactos.org> AuthorDate: Sun Mar 13 00:16:38 2022 +0100 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Sun Mar 20 19:28:11 2022 +0100 [WINESYNC] msi: Factor out msi_view_refresh_row(). Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id 31628cee6e2ba63a1a08672d89ccd8d10836bf7e by Zebediah Figura <z.figura12(a)gmail.com> --- dll/win32/msi/msiquery.c | 47 ++++++++++++++++++++++++++++++----------------- 1 file changed, 30 insertions(+), 17 deletions(-) diff --git a/dll/win32/msi/msiquery.c b/dll/win32/msi/msiquery.c index 94e99b69005..50cc97745b6 100644 --- a/dll/win32/msi/msiquery.c +++ b/dll/win32/msi/msiquery.c @@ -287,7 +287,7 @@ UINT WINAPI MsiDatabaseOpenViewW(MSIHANDLE hdb, return ret; } -UINT msi_view_get_row(MSIDATABASE *db, MSIVIEW *view, UINT row, MSIRECORD **rec) +UINT msi_view_refresh_row(MSIDATABASE *db, MSIVIEW *view, UINT row, MSIRECORD *rec) { UINT row_count = 0, col_count = 0, i, ival, ret, type; @@ -300,13 +300,6 @@ UINT msi_view_get_row(MSIDATABASE *db, MSIVIEW *view, UINT row, MSIRECORD **rec) if (!col_count) return ERROR_INVALID_PARAMETER; - if (row >= row_count) - return ERROR_NO_MORE_ITEMS; - - *rec = MSI_CreateRecord(col_count); - if (!*rec) - return ERROR_FUNCTION_FAILED; - for (i = 1; i <= col_count; i++) { ret = view->ops->get_column_info(view, i, NULL, &type, NULL, NULL); @@ -323,7 +316,7 @@ UINT msi_view_get_row(MSIDATABASE *db, MSIVIEW *view, UINT row, MSIRECORD **rec) ret = view->ops->fetch_stream(view, row, i, &stm); if ((ret == ERROR_SUCCESS) && stm) { - MSI_RecordSetIStream(*rec, i, stm); + MSI_RecordSetIStream(rec, i, stm); IStream_Release(stm); } else @@ -342,28 +335,48 @@ UINT msi_view_get_row(MSIDATABASE *db, MSIVIEW *view, UINT row, MSIRECORD **rec) if (! (type & MSITYPE_VALID)) ERR("Invalid type!\n"); - /* check if it's nul (0) - if so, don't set anything */ - if (!ival) - continue; - if (type & MSITYPE_STRING) { int len; - const WCHAR *sval = msi_string_lookup( db->strings, ival, &len ); - msi_record_set_string( *rec, i, sval, len ); + const WCHAR *sval = msi_string_lookup(db->strings, ival, &len); + msi_record_set_string(rec, i, sval, len); } else { if ((type & MSI_DATASIZEMASK) == 2) - MSI_RecordSetInteger(*rec, i, ival - (1<<15)); + MSI_RecordSetInteger(rec, i, ival ? ival - (1<<15) : MSI_NULL_INTEGER); else - MSI_RecordSetInteger(*rec, i, ival - (1u<<31)); + MSI_RecordSetInteger(rec, i, ival - (1u<<31)); } } return ERROR_SUCCESS; } +UINT msi_view_get_row(MSIDATABASE *db, MSIVIEW *view, UINT row, MSIRECORD **rec) +{ + UINT row_count = 0, col_count = 0, r; + MSIRECORD *object; + + TRACE("view %p, row %u, rec %p.\n", view, row, rec); + + if ((r = view->ops->get_dimensions(view, &row_count, &col_count))) + return r; + + if (row >= row_count) + return ERROR_NO_MORE_ITEMS; + + if (!(object = MSI_CreateRecord( col_count ))) + return ERROR_OUTOFMEMORY; + + if ((r = msi_view_refresh_row(db, view, row, object))) + msiobj_release( &object->hdr ); + else + *rec = object; + + return r; +} + UINT MSI_ViewFetch(MSIQUERY *query, MSIRECORD **prec) { MSIVIEW *view;
2 years, 9 months
1
0
0
0
[reactos] 190/360: [WINESYNC] msi: Implement UPDATE queries using msi_select_update().
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=6425c406fb28c4da1ab78…
commit 6425c406fb28c4da1ab784b97c483e81cc7c9532 Author: winesync <ros-dev(a)reactos.org> AuthorDate: Sun Mar 13 00:16:38 2022 +0100 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Sun Mar 20 19:28:11 2022 +0100 [WINESYNC] msi: Implement UPDATE queries using msi_select_update(). Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id 40a08f8362c191b51db07a483c4f41fa61158c76 by Zebediah Figura <z.figura12(a)gmail.com> --- dll/win32/msi/query.h | 2 ++ dll/win32/msi/select.c | 2 +- dll/win32/msi/update.c | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/dll/win32/msi/query.h b/dll/win32/msi/query.h index 063fbb97496..d79c14fd42e 100644 --- a/dll/win32/msi/query.h +++ b/dll/win32/msi/query.h @@ -151,4 +151,6 @@ MSIRECORD *msi_query_merge_record( UINT fields, const column_info *vl, MSIRECORD UINT msi_create_table( MSIDATABASE *db, LPCWSTR name, column_info *col_info, MSICONDITION persistent ) DECLSPEC_HIDDEN; +UINT msi_select_update( MSIVIEW *view, MSIRECORD *rec, UINT row ) DECLSPEC_HIDDEN; + #endif /* __WINE_MSI_QUERY_H */ diff --git a/dll/win32/msi/select.c b/dll/win32/msi/select.c index 9d3d887f56b..ef16e5d09f7 100644 --- a/dll/win32/msi/select.c +++ b/dll/win32/msi/select.c @@ -230,7 +230,7 @@ static UINT SELECT_get_column_info( struct tagMSIVIEW *view, UINT n, LPCWSTR *na type, temporary, table_name ); } -static UINT msi_select_update(struct tagMSIVIEW *view, MSIRECORD *rec, UINT row) +UINT msi_select_update(MSIVIEW *view, MSIRECORD *rec, UINT row) { MSISELECTVIEW *sv = (MSISELECTVIEW*)view; UINT r, i, col, type, val; diff --git a/dll/win32/msi/update.c b/dll/win32/msi/update.c index e61342d11e4..4aa03443f0c 100644 --- a/dll/win32/msi/update.c +++ b/dll/win32/msi/update.c @@ -113,7 +113,7 @@ static UINT UPDATE_execute( struct tagMSIVIEW *view, MSIRECORD *record ) for ( i=0; i<row_count; i++ ) { - r = wv->ops->set_row( wv, i, values, (1 << col_count) - 1 ); + r = msi_select_update( wv, values, i ); if (r != ERROR_SUCCESS) break; }
2 years, 9 months
1
0
0
0
[reactos] 189/360: [WINESYNC] msi: Support setting streams in msi_select_update().
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=580d3e1be0bde532af3f4…
commit 580d3e1be0bde532af3f4f3a2192045945ce7bdc Author: winesync <ros-dev(a)reactos.org> AuthorDate: Sun Mar 13 00:16:38 2022 +0100 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Sun Mar 20 19:28:10 2022 +0100 [WINESYNC] msi: Support setting streams in msi_select_update(). Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id 044c1dd23b307a0b7f2188855d5bf6e479cefd5e by Zebediah Figura <z.figura12(a)gmail.com> --- dll/win32/msi/alter.c | 1 + dll/win32/msi/create.c | 1 + dll/win32/msi/delete.c | 1 + dll/win32/msi/distinct.c | 1 + dll/win32/msi/drop.c | 1 + dll/win32/msi/insert.c | 1 + dll/win32/msi/msipriv.h | 7 +++++++ dll/win32/msi/select.c | 7 +++++-- dll/win32/msi/storages.c | 41 +++++++++++++++++++++++++++++++++++++++++ dll/win32/msi/streams.c | 14 ++++++++++++++ dll/win32/msi/table.c | 17 +++++++++++++++++ dll/win32/msi/update.c | 1 + dll/win32/msi/where.c | 21 +++++++++++++++++++++ 13 files changed, 112 insertions(+), 2 deletions(-) diff --git a/dll/win32/msi/alter.c b/dll/win32/msi/alter.c index d1a481ebfc9..5c5893c8248 100644 --- a/dll/win32/msi/alter.c +++ b/dll/win32/msi/alter.c @@ -221,6 +221,7 @@ static const MSIVIEWOPS alter_ops = NULL, NULL, NULL, + NULL, ALTER_execute, ALTER_close, ALTER_get_dimensions, diff --git a/dll/win32/msi/create.c b/dll/win32/msi/create.c index 3c00b70c531..2777954aa7d 100644 --- a/dll/win32/msi/create.c +++ b/dll/win32/msi/create.c @@ -131,6 +131,7 @@ static const MSIVIEWOPS create_ops = NULL, NULL, NULL, + NULL, CREATE_execute, CREATE_close, CREATE_get_dimensions, diff --git a/dll/win32/msi/delete.c b/dll/win32/msi/delete.c index e2e0e34678b..81bd9d7db2f 100644 --- a/dll/win32/msi/delete.c +++ b/dll/win32/msi/delete.c @@ -173,6 +173,7 @@ static const MSIVIEWOPS delete_ops = NULL, NULL, NULL, + NULL, DELETE_execute, DELETE_close, DELETE_get_dimensions, diff --git a/dll/win32/msi/distinct.c b/dll/win32/msi/distinct.c index 5bd5bf8676d..e102adb3de2 100644 --- a/dll/win32/msi/distinct.c +++ b/dll/win32/msi/distinct.c @@ -256,6 +256,7 @@ static const MSIVIEWOPS distinct_ops = NULL, NULL, NULL, + NULL, DISTINCT_execute, DISTINCT_close, DISTINCT_get_dimensions, diff --git a/dll/win32/msi/drop.c b/dll/win32/msi/drop.c index 60a92021060..89fac9dfc7c 100644 --- a/dll/win32/msi/drop.c +++ b/dll/win32/msi/drop.c @@ -94,6 +94,7 @@ static UINT DROP_delete( struct tagMSIVIEW *view ) static const MSIVIEWOPS drop_ops = { + NULL, NULL, NULL, NULL, diff --git a/dll/win32/msi/insert.c b/dll/win32/msi/insert.c index ed913c034c1..f1185eebaeb 100644 --- a/dll/win32/msi/insert.c +++ b/dll/win32/msi/insert.c @@ -327,6 +327,7 @@ static const MSIVIEWOPS insert_ops = NULL, NULL, NULL, + NULL, INSERT_execute, INSERT_close, INSERT_get_dimensions, diff --git a/dll/win32/msi/msipriv.h b/dll/win32/msi/msipriv.h index 8bf0385a440..2177aa6f10e 100644 --- a/dll/win32/msi/msipriv.h +++ b/dll/win32/msi/msipriv.h @@ -256,6 +256,13 @@ typedef struct tagMSIVIEWOPS */ UINT (*set_string)( struct tagMSIVIEW *view, UINT row, UINT col, const WCHAR *val, int len ); + /* + * set_stream - set the stream value at {row, col} + * This function has undefined behaviour if the column does not contain + * streams. + */ + UINT (*set_stream)( struct tagMSIVIEW *view, UINT row, UINT col, IStream *stream ); + /* * set_row - sets values in a row as specified by mask * diff --git a/dll/win32/msi/select.c b/dll/win32/msi/select.c index c6e7b209033..9d3d887f56b 100644 --- a/dll/win32/msi/select.c +++ b/dll/win32/msi/select.c @@ -234,6 +234,7 @@ static UINT msi_select_update(struct tagMSIVIEW *view, MSIRECORD *rec, UINT row) { MSISELECTVIEW *sv = (MSISELECTVIEW*)view; UINT r, i, col, type, val; + IStream *stream; LPCWSTR str; for (i = 0; i < sv->num_cols; i++) @@ -249,8 +250,9 @@ static UINT msi_select_update(struct tagMSIVIEW *view, MSIRECORD *rec, UINT row) if (MSITYPE_IS_BINARY(type)) { - ERR("Cannot modify binary data!\n"); - return ERROR_FUNCTION_FAILED; + if (MSI_RecordGetIStream(rec, i + 1, &stream)) + return ERROR_FUNCTION_FAILED; + r = sv->table->ops->set_stream(sv->table, row, col, stream); } else if (type & MSITYPE_STRING) { @@ -311,6 +313,7 @@ static const MSIVIEWOPS select_ops = SELECT_fetch_stream, NULL, NULL, + NULL, SELECT_set_row, SELECT_insert_row, NULL, diff --git a/dll/win32/msi/storages.c b/dll/win32/msi/storages.c index 76a0e2e03f8..521b6e89e83 100644 --- a/dll/win32/msi/storages.c +++ b/dll/win32/msi/storages.c @@ -153,6 +153,46 @@ done: return hr; } +static UINT STORAGES_set_stream( MSIVIEW *view, UINT row, UINT col, IStream *stream ) +{ + MSISTORAGESVIEW *sv = (MSISTORAGESVIEW *)view; + IStorage *stg, *substg, *prev; + const WCHAR *name; + HRESULT hr; + UINT r; + + TRACE("view %p, row %u, col %u, stream %p.\n", view, row, col, stream); + + if ((r = stream_to_storage(stream, &stg))) + return r; + + name = msi_string_lookup(sv->db->strings, sv->storages[row].str_index, NULL); + + hr = IStorage_CreateStorage(sv->db->storage, name, + STGM_WRITE | STGM_SHARE_EXCLUSIVE, + 0, 0, &substg); + if (FAILED(hr)) + { + IStorage_Release(stg); + return ERROR_FUNCTION_FAILED; + } + + hr = IStorage_CopyTo(stg, 0, NULL, NULL, substg); + if (FAILED(hr)) + { + IStorage_Release(substg); + IStorage_Release(stg); + return ERROR_FUNCTION_FAILED; + } + IStorage_Release(substg); + + prev = sv->storages[row].storage; + sv->storages[row].storage = stg; + if (prev) IStorage_Release(prev); + + return ERROR_SUCCESS; +} + static UINT STORAGES_set_row(struct tagMSIVIEW *view, UINT row, MSIRECORD *rec, UINT mask) { MSISTORAGESVIEW *sv = (MSISTORAGESVIEW *)view; @@ -404,6 +444,7 @@ static const MSIVIEWOPS storages_ops = STORAGES_fetch_stream, NULL, STORAGES_set_string, + STORAGES_set_stream, STORAGES_set_row, STORAGES_insert_row, STORAGES_delete_row, diff --git a/dll/win32/msi/streams.c b/dll/win32/msi/streams.c index 150e9288682..6565b3d4c40 100644 --- a/dll/win32/msi/streams.c +++ b/dll/win32/msi/streams.c @@ -110,6 +110,19 @@ static UINT STREAMS_set_string( struct tagMSIVIEW *view, UINT row, UINT col, con return ERROR_FUNCTION_FAILED; } +static UINT STREAMS_set_stream( MSIVIEW *view, UINT row, UINT col, IStream *stream ) +{ + MSISTREAMSVIEW *sv = (MSISTREAMSVIEW *)view; + IStream *prev; + + TRACE("view %p, row %u, col %u, stream %p.\n", view, row, col, stream); + + prev = sv->db->streams[row].stream; + IStream_AddRef(sv->db->streams[row].stream = stream); + if (prev) IStream_Release(prev); + return ERROR_SUCCESS; +} + static UINT STREAMS_set_row(struct tagMSIVIEW *view, UINT row, MSIRECORD *rec, UINT mask) { MSISTREAMSVIEW *sv = (MSISTREAMSVIEW *)view; @@ -364,6 +377,7 @@ static const MSIVIEWOPS streams_ops = STREAMS_fetch_stream, NULL, STREAMS_set_string, + STREAMS_set_stream, STREAMS_set_row, STREAMS_insert_row, STREAMS_delete_row, diff --git a/dll/win32/msi/table.c b/dll/win32/msi/table.c index f26ab9f5b45..a2b83e27de2 100644 --- a/dll/win32/msi/table.c +++ b/dll/win32/msi/table.c @@ -1357,6 +1357,22 @@ done: return r; } +static UINT TABLE_set_stream( MSIVIEW *view, UINT row, UINT col, IStream *stream ) +{ + MSITABLEVIEW *tv = (MSITABLEVIEW *)view; + WCHAR *name; + UINT r; + + TRACE("row %u, col %u, stream %p.\n", row, col, stream); + + if ((r = get_stream_name( tv, row - 1, &name ))) + return r; + + r = add_stream( tv->db, name, stream ); + msi_free( name ); + return r; +} + static UINT get_table_value_from_record( MSITABLEVIEW *tv, MSIRECORD *rec, UINT iField, UINT *pvalue ) { MSICOLUMNINFO columninfo; @@ -2126,6 +2142,7 @@ static const MSIVIEWOPS table_ops = TABLE_fetch_stream, TABLE_set_int, TABLE_set_string, + TABLE_set_stream, TABLE_set_row, TABLE_insert_row, TABLE_delete_row, diff --git a/dll/win32/msi/update.c b/dll/win32/msi/update.c index af629d2236c..e61342d11e4 100644 --- a/dll/win32/msi/update.c +++ b/dll/win32/msi/update.c @@ -204,6 +204,7 @@ static const MSIVIEWOPS update_ops = NULL, NULL, NULL, + NULL, UPDATE_execute, UPDATE_close, UPDATE_get_dimensions, diff --git a/dll/win32/msi/where.c b/dll/win32/msi/where.c index eaadac4310c..66de85bec94 100644 --- a/dll/win32/msi/where.c +++ b/dll/win32/msi/where.c @@ -299,6 +299,26 @@ static UINT WHERE_set_string(struct tagMSIVIEW *view, UINT row, UINT col, const return table->view->ops->set_string(table->view, rows[table->table_index], col, val, len); } +static UINT WHERE_set_stream(MSIVIEW *view, UINT row, UINT col, IStream *stream) +{ + MSIWHEREVIEW *wv = (MSIWHEREVIEW*)view; + JOINTABLE *table; + UINT *rows; + UINT r; + + TRACE("view %p, row %u, col %u, stream %p.\n", wv, row, col, stream); + + r = find_row(wv, row, &rows); + if (r != ERROR_SUCCESS) + return r; + + table = find_table(wv, col, &col); + if (!table) + return ERROR_FUNCTION_FAILED; + + return table->view->ops->set_stream(table->view, rows[table->table_index], col, stream); +} + static UINT WHERE_set_row( struct tagMSIVIEW *view, UINT row, MSIRECORD *rec, UINT mask ) { MSIWHEREVIEW *wv = (MSIWHEREVIEW*)view; @@ -1098,6 +1118,7 @@ static const MSIVIEWOPS where_ops = WHERE_fetch_stream, WHERE_set_int, WHERE_set_string, + WHERE_set_stream, WHERE_set_row, NULL, WHERE_delete_row,
2 years, 9 months
1
0
0
0
[reactos] 188/360: [WINESYNC] msi: Store the IStorage list as an array of STORAGE structures.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=e734a9189b275fa3c8182…
commit e734a9189b275fa3c8182afa410e79759f58b40f Author: winesync <ros-dev(a)reactos.org> AuthorDate: Sun Mar 13 00:16:35 2022 +0100 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Sun Mar 20 19:28:10 2022 +0100 [WINESYNC] msi: Store the IStorage list as an array of STORAGE structures. Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id 33045101ca657b2b09a53e14711b3f6bcacbafe2 by Zebediah Figura <z.figura12(a)gmail.com> --- dll/win32/msi/storages.c | 62 ++++++++++++++++-------------------------------- 1 file changed, 20 insertions(+), 42 deletions(-) diff --git a/dll/win32/msi/storages.c b/dll/win32/msi/storages.c index 9e161c9e1bd..76a0e2e03f8 100644 --- a/dll/win32/msi/storages.c +++ b/dll/win32/msi/storages.c @@ -50,7 +50,7 @@ typedef struct tagMSISTORAGESVIEW { MSIVIEW view; MSIDATABASE *db; - STORAGE **storages; + STORAGE *storages; UINT max_storages; UINT num_rows; UINT row_size; @@ -61,7 +61,7 @@ static BOOL storages_set_table_size(MSISTORAGESVIEW *sv, UINT size) if (size >= sv->max_storages) { sv->max_storages *= 2; - sv->storages = msi_realloc(sv->storages, sv->max_storages * sizeof(STORAGE *)); + sv->storages = msi_realloc(sv->storages, sv->max_storages * sizeof(*sv->storages)); if (!sv->storages) return FALSE; } @@ -69,23 +69,6 @@ static BOOL storages_set_table_size(MSISTORAGESVIEW *sv, UINT size) return TRUE; } -static STORAGE *create_storage(MSISTORAGESVIEW *sv, LPCWSTR name, IStorage *stg) -{ - STORAGE *storage; - - storage = msi_alloc(sizeof(STORAGE)); - if (!storage) - return NULL; - - storage->str_index = msi_add_string(sv->db->strings, name, -1, FALSE); - storage->storage = stg; - - if (storage->storage) - IStorage_AddRef(storage->storage); - - return storage; -} - static UINT STORAGES_fetch_int(struct tagMSIVIEW *view, UINT row, UINT col, UINT *val) { MSISTORAGESVIEW *sv = (MSISTORAGESVIEW *)view; @@ -98,7 +81,7 @@ static UINT STORAGES_fetch_int(struct tagMSIVIEW *view, UINT row, UINT col, UINT if (row >= sv->num_rows) return ERROR_NO_MORE_ITEMS; - *val = sv->storages[row]->str_index; + *val = sv->storages[row].str_index; return ERROR_SUCCESS; } @@ -173,7 +156,7 @@ done: static UINT STORAGES_set_row(struct tagMSIVIEW *view, UINT row, MSIRECORD *rec, UINT mask) { MSISTORAGESVIEW *sv = (MSISTORAGESVIEW *)view; - IStorage *stg, *substg = NULL; + IStorage *stg, *substg = NULL, *prev; IStream *stm; LPWSTR name = NULL; HRESULT hr; @@ -181,7 +164,7 @@ static UINT STORAGES_set_row(struct tagMSIVIEW *view, UINT row, MSIRECORD *rec, TRACE("(%p, %p)\n", view, rec); - if (row > sv->num_rows) + if (row >= sv->num_rows) return ERROR_FUNCTION_FAILED; r = MSI_RecordGetIStream(rec, 2, &stm); @@ -218,9 +201,11 @@ static UINT STORAGES_set_row(struct tagMSIVIEW *view, UINT row, MSIRECORD *rec, goto done; } - sv->storages[row] = create_storage(sv, name, stg); - if (!sv->storages[row]) - r = ERROR_FUNCTION_FAILED; + prev = sv->storages[row].storage; + sv->storages[row].str_index = msi_add_string(sv->db->strings, name, -1, FALSE); + IStorage_AddRef(stg); + sv->storages[row].storage = stg; + if (prev) IStorage_Release(prev); done: msi_free(name); @@ -242,6 +227,8 @@ static UINT STORAGES_insert_row(struct tagMSIVIEW *view, MSIRECORD *rec, UINT ro if (row == -1) row = sv->num_rows - 1; + memset(&sv->storages[row], 0, sizeof(sv->storages[row])); + /* FIXME have to readjust rows */ return STORAGES_set_row(view, row, rec, 0); @@ -400,9 +387,8 @@ static UINT STORAGES_delete(struct tagMSIVIEW *view) for (i = 0; i < sv->num_rows; i++) { - if (sv->storages[i]->storage) - IStorage_Release(sv->storages[i]->storage); - msi_free(sv->storages[i]); + if (sv->storages[i].storage) + IStorage_Release(sv->storages[i].storage); } msi_free(sv->storages); @@ -436,7 +422,6 @@ static const MSIVIEWOPS storages_ops = static INT add_storages_to_table(MSISTORAGESVIEW *sv) { - STORAGE *storage = NULL; IEnumSTATSTG *stgenum = NULL; STATSTG stat; HRESULT hr; @@ -447,7 +432,7 @@ static INT add_storages_to_table(MSISTORAGESVIEW *sv) return -1; sv->max_storages = 1; - sv->storages = msi_alloc(sizeof(STORAGE *)); + sv->storages = msi_alloc(sizeof(*sv->storages)); if (!sv->storages) return -1; @@ -466,26 +451,19 @@ static INT add_storages_to_table(MSISTORAGESVIEW *sv) TRACE("enumerated storage %s\n", debugstr_w(stat.pwcsName)); - storage = create_storage(sv, stat.pwcsName, NULL); - if (!storage) + if (!storages_set_table_size(sv, ++count)) { count = -1; - CoTaskMemFree(stat.pwcsName); break; } + sv->storages[count - 1].str_index = msi_add_string(sv->db->strings, stat.pwcsName, -1, FALSE); + sv->storages[count - 1].storage = NULL; + IStorage_OpenStorage(sv->db->storage, stat.pwcsName, NULL, STGM_READ | STGM_SHARE_EXCLUSIVE, NULL, 0, - &storage->storage); + &sv->storages[count - 1].storage); CoTaskMemFree(stat.pwcsName); - - if (!storages_set_table_size(sv, ++count)) - { - count = -1; - break; - } - - sv->storages[count - 1] = storage; } IEnumSTATSTG_Release(stgenum);
2 years, 9 months
1
0
0
0
[reactos] 187/360: [WINESYNC] msi: Remove an unnecessary call to SELECT_get_dimensions().
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=01a3611583da1fba4a2b8…
commit 01a3611583da1fba4a2b88683bf09fe7523fa762 Author: winesync <ros-dev(a)reactos.org> AuthorDate: Sun Mar 13 00:16:35 2022 +0100 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Sun Mar 20 19:28:10 2022 +0100 [WINESYNC] msi: Remove an unnecessary call to SELECT_get_dimensions(). Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id 7728acd1b6994c553a046e3ff9ee1aebc20c38b6 by Zebediah Figura <z.figura12(a)gmail.com> --- dll/win32/msi/select.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/dll/win32/msi/select.c b/dll/win32/msi/select.c index 99339c24b89..c6e7b209033 100644 --- a/dll/win32/msi/select.c +++ b/dll/win32/msi/select.c @@ -233,14 +233,10 @@ static UINT SELECT_get_column_info( struct tagMSIVIEW *view, UINT n, LPCWSTR *na static UINT msi_select_update(struct tagMSIVIEW *view, MSIRECORD *rec, UINT row) { MSISELECTVIEW *sv = (MSISELECTVIEW*)view; - UINT r, i, num_columns, col, type, val; + UINT r, i, col, type, val; LPCWSTR str; - r = SELECT_get_dimensions(view, NULL, &num_columns); - if (r != ERROR_SUCCESS) - return r; - - for (i = 0; i < num_columns; i++) + for (i = 0; i < sv->num_cols; i++) { col = sv->cols[i];
2 years, 9 months
1
0
0
0
[reactos] 186/360: [WINESYNC] msi: Get rid of the get_row() view operation.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=f6659d1de9b9ca1cc1406…
commit f6659d1de9b9ca1cc140643c755afe41755c0130 Author: winesync <ros-dev(a)reactos.org> AuthorDate: Sun Mar 13 00:16:35 2022 +0100 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Sun Mar 20 19:28:10 2022 +0100 [WINESYNC] msi: Get rid of the get_row() view operation. Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id 7c28a1dbddc012d497988f638b7ecb70e75b17c3 by Zebediah Figura <z.figura12(a)gmail.com> --- dll/win32/msi/alter.c | 10 ---------- dll/win32/msi/create.c | 1 - dll/win32/msi/delete.c | 1 - dll/win32/msi/distinct.c | 1 - dll/win32/msi/drop.c | 1 - dll/win32/msi/insert.c | 1 - dll/win32/msi/msipriv.h | 6 ------ dll/win32/msi/select.c | 13 ------------- dll/win32/msi/storages.c | 10 ---------- dll/win32/msi/streams.c | 10 ---------- dll/win32/msi/table.c | 1 - dll/win32/msi/update.c | 1 - dll/win32/msi/where.c | 13 ------------- 13 files changed, 69 deletions(-) diff --git a/dll/win32/msi/alter.c b/dll/win32/msi/alter.c index 96ff284a3df..d1a481ebfc9 100644 --- a/dll/win32/msi/alter.c +++ b/dll/win32/msi/alter.c @@ -61,15 +61,6 @@ static UINT ALTER_fetch_stream( struct tagMSIVIEW *view, UINT row, UINT col, ISt return ERROR_FUNCTION_FAILED; } -static UINT ALTER_get_row( struct tagMSIVIEW *view, UINT row, MSIRECORD **rec ) -{ - MSIALTERVIEW *av = (MSIALTERVIEW*)view; - - TRACE("%p %d %p\n", av, row, rec ); - - return av->table->ops->get_row(av->table, row, rec); -} - static UINT ITERATE_columns(MSIRECORD *row, LPVOID param) { (*(UINT *)param)++; @@ -225,7 +216,6 @@ static const MSIVIEWOPS alter_ops = { ALTER_fetch_int, ALTER_fetch_stream, - ALTER_get_row, NULL, NULL, NULL, diff --git a/dll/win32/msi/create.c b/dll/win32/msi/create.c index 2777954aa7d..3c00b70c531 100644 --- a/dll/win32/msi/create.c +++ b/dll/win32/msi/create.c @@ -131,7 +131,6 @@ static const MSIVIEWOPS create_ops = NULL, NULL, NULL, - NULL, CREATE_execute, CREATE_close, CREATE_get_dimensions, diff --git a/dll/win32/msi/delete.c b/dll/win32/msi/delete.c index 81bd9d7db2f..e2e0e34678b 100644 --- a/dll/win32/msi/delete.c +++ b/dll/win32/msi/delete.c @@ -173,7 +173,6 @@ static const MSIVIEWOPS delete_ops = NULL, NULL, NULL, - NULL, DELETE_execute, DELETE_close, DELETE_get_dimensions, diff --git a/dll/win32/msi/distinct.c b/dll/win32/msi/distinct.c index e102adb3de2..5bd5bf8676d 100644 --- a/dll/win32/msi/distinct.c +++ b/dll/win32/msi/distinct.c @@ -256,7 +256,6 @@ static const MSIVIEWOPS distinct_ops = NULL, NULL, NULL, - NULL, DISTINCT_execute, DISTINCT_close, DISTINCT_get_dimensions, diff --git a/dll/win32/msi/drop.c b/dll/win32/msi/drop.c index 89fac9dfc7c..60a92021060 100644 --- a/dll/win32/msi/drop.c +++ b/dll/win32/msi/drop.c @@ -94,7 +94,6 @@ static UINT DROP_delete( struct tagMSIVIEW *view ) static const MSIVIEWOPS drop_ops = { - NULL, NULL, NULL, NULL, diff --git a/dll/win32/msi/insert.c b/dll/win32/msi/insert.c index f1185eebaeb..ed913c034c1 100644 --- a/dll/win32/msi/insert.c +++ b/dll/win32/msi/insert.c @@ -327,7 +327,6 @@ static const MSIVIEWOPS insert_ops = NULL, NULL, NULL, - NULL, INSERT_execute, INSERT_close, INSERT_get_dimensions, diff --git a/dll/win32/msi/msipriv.h b/dll/win32/msi/msipriv.h index 9677d046452..8bf0385a440 100644 --- a/dll/win32/msi/msipriv.h +++ b/dll/win32/msi/msipriv.h @@ -242,12 +242,6 @@ typedef struct tagMSIVIEWOPS */ UINT (*fetch_stream)( struct tagMSIVIEW *view, UINT row, UINT col, IStream **stm ); - /* - * get_row - gets values from a row - * - */ - UINT (*get_row)( struct tagMSIVIEW *view, UINT row, MSIRECORD **rec ); - /* * set_int - set the integer value at {row, col} * This function has undefined behaviour if the column does not contain diff --git a/dll/win32/msi/select.c b/dll/win32/msi/select.c index 91765c8ec3b..99339c24b89 100644 --- a/dll/win32/msi/select.c +++ b/dll/win32/msi/select.c @@ -90,18 +90,6 @@ static UINT SELECT_fetch_stream( struct tagMSIVIEW *view, UINT row, UINT col, IS return sv->table->ops->fetch_stream( sv->table, row, col, stm ); } -static UINT SELECT_get_row( struct tagMSIVIEW *view, UINT row, MSIRECORD **rec ) -{ - MSISELECTVIEW *sv = (MSISELECTVIEW *)view; - - TRACE("%p %d %p\n", sv, row, rec ); - - if( !sv->table ) - return ERROR_FUNCTION_FAILED; - - return msi_view_get_row(sv->db, view, row, rec); -} - static UINT SELECT_set_row( struct tagMSIVIEW *view, UINT row, MSIRECORD *rec, UINT mask ) { MSISELECTVIEW *sv = (MSISELECTVIEW*)view; @@ -325,7 +313,6 @@ static const MSIVIEWOPS select_ops = { SELECT_fetch_int, SELECT_fetch_stream, - SELECT_get_row, NULL, NULL, SELECT_set_row, diff --git a/dll/win32/msi/storages.c b/dll/win32/msi/storages.c index ad020dec55e..9e161c9e1bd 100644 --- a/dll/win32/msi/storages.c +++ b/dll/win32/msi/storages.c @@ -115,15 +115,6 @@ static UINT STORAGES_fetch_stream(struct tagMSIVIEW *view, UINT row, UINT col, I return ERROR_INVALID_DATA; } -static UINT STORAGES_get_row( struct tagMSIVIEW *view, UINT row, MSIRECORD **rec ) -{ - MSISTORAGESVIEW *sv = (MSISTORAGESVIEW *)view; - - FIXME("%p %d %p\n", sv, row, rec); - - return ERROR_CALL_NOT_IMPLEMENTED; -} - static UINT STORAGES_set_string( struct tagMSIVIEW *view, UINT row, UINT col, const WCHAR *val, int len ) { ERR("Cannot modify primary key.\n"); @@ -425,7 +416,6 @@ static const MSIVIEWOPS storages_ops = { STORAGES_fetch_int, STORAGES_fetch_stream, - STORAGES_get_row, NULL, STORAGES_set_string, STORAGES_set_row, diff --git a/dll/win32/msi/streams.c b/dll/win32/msi/streams.c index ec34e34a85e..150e9288682 100644 --- a/dll/win32/msi/streams.c +++ b/dll/win32/msi/streams.c @@ -110,15 +110,6 @@ static UINT STREAMS_set_string( struct tagMSIVIEW *view, UINT row, UINT col, con return ERROR_FUNCTION_FAILED; } -static UINT STREAMS_get_row( struct tagMSIVIEW *view, UINT row, MSIRECORD **rec ) -{ - MSISTREAMSVIEW *sv = (MSISTREAMSVIEW *)view; - - TRACE("%p %d %p\n", sv, row, rec); - - return msi_view_get_row( sv->db, view, row, rec ); -} - static UINT STREAMS_set_row(struct tagMSIVIEW *view, UINT row, MSIRECORD *rec, UINT mask) { MSISTREAMSVIEW *sv = (MSISTREAMSVIEW *)view; @@ -371,7 +362,6 @@ static const MSIVIEWOPS streams_ops = { STREAMS_fetch_int, STREAMS_fetch_stream, - STREAMS_get_row, NULL, STREAMS_set_string, STREAMS_set_row, diff --git a/dll/win32/msi/table.c b/dll/win32/msi/table.c index a5de8ccf59c..f26ab9f5b45 100644 --- a/dll/win32/msi/table.c +++ b/dll/win32/msi/table.c @@ -2124,7 +2124,6 @@ static const MSIVIEWOPS table_ops = { TABLE_fetch_int, TABLE_fetch_stream, - TABLE_get_row, TABLE_set_int, TABLE_set_string, TABLE_set_row, diff --git a/dll/win32/msi/update.c b/dll/win32/msi/update.c index e61342d11e4..af629d2236c 100644 --- a/dll/win32/msi/update.c +++ b/dll/win32/msi/update.c @@ -204,7 +204,6 @@ static const MSIVIEWOPS update_ops = NULL, NULL, NULL, - NULL, UPDATE_execute, UPDATE_close, UPDATE_get_dimensions, diff --git a/dll/win32/msi/where.c b/dll/win32/msi/where.c index 6a10a049a63..eaadac4310c 100644 --- a/dll/win32/msi/where.c +++ b/dll/win32/msi/where.c @@ -259,18 +259,6 @@ static UINT WHERE_fetch_stream( struct tagMSIVIEW *view, UINT row, UINT col, ISt return table->view->ops->fetch_stream( table->view, rows[table->table_index], col, stm ); } -static UINT WHERE_get_row( struct tagMSIVIEW *view, UINT row, MSIRECORD **rec ) -{ - MSIWHEREVIEW *wv = (MSIWHEREVIEW *)view; - - TRACE("%p %d %p\n", wv, row, rec ); - - if (!wv->tables) - return ERROR_FUNCTION_FAILED; - - return msi_view_get_row( wv->db, view, row, rec ); -} - static UINT WHERE_set_int(struct tagMSIVIEW *view, UINT row, UINT col, int val) { MSIWHEREVIEW *wv = (MSIWHEREVIEW*)view; @@ -1108,7 +1096,6 @@ static const MSIVIEWOPS where_ops = { WHERE_fetch_int, WHERE_fetch_stream, - WHERE_get_row, WHERE_set_int, WHERE_set_string, WHERE_set_row,
2 years, 9 months
1
0
0
0
[reactos] 185/360: [WINESYNC] msi: Set table values directly in msi_select_update().
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=97918c366e8fe3f75bb34…
commit 97918c366e8fe3f75bb34dd125b21d36ab740627 Author: winesync <ros-dev(a)reactos.org> AuthorDate: Sun Mar 13 00:16:33 2022 +0100 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Sun Mar 20 19:28:10 2022 +0100 [WINESYNC] msi: Set table values directly in msi_select_update(). In order to avoid the need to create a temporary record and copy values back and forth. Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id f45a7b04a6caca4eed1d08f4e69884b119f3aa17 by Zebediah Figura <z.figura12(a)gmail.com> --- dll/win32/msi/alter.c | 2 ++ dll/win32/msi/create.c | 2 ++ dll/win32/msi/delete.c | 2 ++ dll/win32/msi/distinct.c | 2 ++ dll/win32/msi/drop.c | 2 ++ dll/win32/msi/insert.c | 2 ++ dll/win32/msi/msipriv.h | 14 ++++++++++ dll/win32/msi/select.c | 26 ++++++------------ dll/win32/msi/storages.c | 8 ++++++ dll/win32/msi/streams.c | 8 ++++++ dll/win32/msi/table.c | 71 ++++++++++++++++++++++++++++++++++++++++++++++-- dll/win32/msi/update.c | 2 ++ dll/win32/msi/where.c | 42 ++++++++++++++++++++++++++++ 13 files changed, 164 insertions(+), 19 deletions(-) diff --git a/dll/win32/msi/alter.c b/dll/win32/msi/alter.c index 011a2dcfb81..96ff284a3df 100644 --- a/dll/win32/msi/alter.c +++ b/dll/win32/msi/alter.c @@ -229,6 +229,8 @@ static const MSIVIEWOPS alter_ops = NULL, NULL, NULL, + NULL, + NULL, ALTER_execute, ALTER_close, ALTER_get_dimensions, diff --git a/dll/win32/msi/create.c b/dll/win32/msi/create.c index dd4739df12f..2777954aa7d 100644 --- a/dll/win32/msi/create.c +++ b/dll/win32/msi/create.c @@ -130,6 +130,8 @@ static const MSIVIEWOPS create_ops = NULL, NULL, NULL, + NULL, + NULL, CREATE_execute, CREATE_close, CREATE_get_dimensions, diff --git a/dll/win32/msi/delete.c b/dll/win32/msi/delete.c index 468115186b6..81bd9d7db2f 100644 --- a/dll/win32/msi/delete.c +++ b/dll/win32/msi/delete.c @@ -172,6 +172,8 @@ static const MSIVIEWOPS delete_ops = NULL, NULL, NULL, + NULL, + NULL, DELETE_execute, DELETE_close, DELETE_get_dimensions, diff --git a/dll/win32/msi/distinct.c b/dll/win32/msi/distinct.c index b1945a15465..e102adb3de2 100644 --- a/dll/win32/msi/distinct.c +++ b/dll/win32/msi/distinct.c @@ -255,6 +255,8 @@ static const MSIVIEWOPS distinct_ops = NULL, NULL, NULL, + NULL, + NULL, DISTINCT_execute, DISTINCT_close, DISTINCT_get_dimensions, diff --git a/dll/win32/msi/drop.c b/dll/win32/msi/drop.c index 3179f14219e..89fac9dfc7c 100644 --- a/dll/win32/msi/drop.c +++ b/dll/win32/msi/drop.c @@ -94,6 +94,8 @@ static UINT DROP_delete( struct tagMSIVIEW *view ) static const MSIVIEWOPS drop_ops = { + NULL, + NULL, NULL, NULL, NULL, diff --git a/dll/win32/msi/insert.c b/dll/win32/msi/insert.c index a5333c9cdc6..f1185eebaeb 100644 --- a/dll/win32/msi/insert.c +++ b/dll/win32/msi/insert.c @@ -326,6 +326,8 @@ static const MSIVIEWOPS insert_ops = NULL, NULL, NULL, + NULL, + NULL, INSERT_execute, INSERT_close, INSERT_get_dimensions, diff --git a/dll/win32/msi/msipriv.h b/dll/win32/msi/msipriv.h index 16b02ae86eb..9677d046452 100644 --- a/dll/win32/msi/msipriv.h +++ b/dll/win32/msi/msipriv.h @@ -248,6 +248,20 @@ typedef struct tagMSIVIEWOPS */ UINT (*get_row)( struct tagMSIVIEW *view, UINT row, MSIRECORD **rec ); + /* + * set_int - set the integer value at {row, col} + * This function has undefined behaviour if the column does not contain + * integers. + */ + UINT (*set_int)( struct tagMSIVIEW *view, UINT row, UINT col, int val ); + + /* + * set_string - set the string value at {row, col} + * This function has undefined behaviour if the column does not contain + * strings. + */ + UINT (*set_string)( struct tagMSIVIEW *view, UINT row, UINT col, const WCHAR *val, int len ); + /* * set_row - sets values in a row as specified by mask * diff --git a/dll/win32/msi/select.c b/dll/win32/msi/select.c index e17cbbbdf25..91765c8ec3b 100644 --- a/dll/win32/msi/select.c +++ b/dll/win32/msi/select.c @@ -247,16 +247,11 @@ static UINT msi_select_update(struct tagMSIVIEW *view, MSIRECORD *rec, UINT row) MSISELECTVIEW *sv = (MSISELECTVIEW*)view; UINT r, i, num_columns, col, type, val; LPCWSTR str; - MSIRECORD *mod; r = SELECT_get_dimensions(view, NULL, &num_columns); if (r != ERROR_SUCCESS) return r; - r = sv->table->ops->get_row(sv->table, row, &mod); - if (r != ERROR_SUCCESS) - return r; - for (i = 0; i < num_columns; i++) { col = sv->cols[i]; @@ -265,39 +260,34 @@ static UINT msi_select_update(struct tagMSIVIEW *view, MSIRECORD *rec, UINT row) if (r != ERROR_SUCCESS) { ERR("Failed to get column information: %d\n", r); - goto done; + return r; } if (MSITYPE_IS_BINARY(type)) { ERR("Cannot modify binary data!\n"); - r = ERROR_FUNCTION_FAILED; - goto done; + return ERROR_FUNCTION_FAILED; } else if (type & MSITYPE_STRING) { int len; - str = msi_record_get_string( rec, i + 1, &len ); - r = msi_record_set_string( mod, col, str, len ); + str = msi_record_get_string(rec, i + 1, &len); + r = sv->table->ops->set_string(sv->table, row, col, str, len); } else { val = MSI_RecordGetInteger(rec, i + 1); - r = MSI_RecordSetInteger(mod, col, val); + r = sv->table->ops->set_int(sv->table, row, col, val); } if (r != ERROR_SUCCESS) { ERR("Failed to modify record: %d\n", r); - goto done; + return r; } } - r = sv->table->ops->modify(sv->table, MSIMODIFY_UPDATE, mod, row); - -done: - msiobj_release(&mod->hdr); - return r; + return ERROR_SUCCESS; } static UINT SELECT_modify( struct tagMSIVIEW *view, MSIMODIFY eModifyMode, @@ -336,6 +326,8 @@ static const MSIVIEWOPS select_ops = SELECT_fetch_int, SELECT_fetch_stream, SELECT_get_row, + NULL, + NULL, SELECT_set_row, SELECT_insert_row, NULL, diff --git a/dll/win32/msi/storages.c b/dll/win32/msi/storages.c index 4379ae268b2..ad020dec55e 100644 --- a/dll/win32/msi/storages.c +++ b/dll/win32/msi/storages.c @@ -124,6 +124,12 @@ static UINT STORAGES_get_row( struct tagMSIVIEW *view, UINT row, MSIRECORD **rec return ERROR_CALL_NOT_IMPLEMENTED; } +static UINT STORAGES_set_string( struct tagMSIVIEW *view, UINT row, UINT col, const WCHAR *val, int len ) +{ + ERR("Cannot modify primary key.\n"); + return ERROR_FUNCTION_FAILED; +} + static HRESULT stream_to_storage(IStream *stm, IStorage **stg) { ILockBytes *lockbytes = NULL; @@ -420,6 +426,8 @@ static const MSIVIEWOPS storages_ops = STORAGES_fetch_int, STORAGES_fetch_stream, STORAGES_get_row, + NULL, + STORAGES_set_string, STORAGES_set_row, STORAGES_insert_row, STORAGES_delete_row, diff --git a/dll/win32/msi/streams.c b/dll/win32/msi/streams.c index 845c3f2608e..ec34e34a85e 100644 --- a/dll/win32/msi/streams.c +++ b/dll/win32/msi/streams.c @@ -104,6 +104,12 @@ static UINT STREAMS_fetch_stream(struct tagMSIVIEW *view, UINT row, UINT col, IS return ERROR_SUCCESS; } +static UINT STREAMS_set_string( struct tagMSIVIEW *view, UINT row, UINT col, const WCHAR *val, int len ) +{ + ERR("Cannot modify primary key.\n"); + return ERROR_FUNCTION_FAILED; +} + static UINT STREAMS_get_row( struct tagMSIVIEW *view, UINT row, MSIRECORD **rec ) { MSISTREAMSVIEW *sv = (MSISTREAMSVIEW *)view; @@ -366,6 +372,8 @@ static const MSIVIEWOPS streams_ops = STREAMS_fetch_int, STREAMS_fetch_stream, STREAMS_get_row, + NULL, + STREAMS_set_string, STREAMS_set_row, STREAMS_insert_row, STREAMS_delete_row, diff --git a/dll/win32/msi/table.c b/dll/win32/msi/table.c index e4f6b56f18a..a5de8ccf59c 100644 --- a/dll/win32/msi/table.c +++ b/dll/win32/msi/table.c @@ -1164,7 +1164,8 @@ static UINT TABLE_fetch_stream( struct tagMSIVIEW *view, UINT row, UINT col, ISt return r; } -static UINT TABLE_set_int( MSITABLEVIEW *tv, UINT row, UINT col, UINT val ) +/* Set a table value, i.e. preadjusted integer or string ID. */ +static UINT table_set_bytes( MSITABLEVIEW *tv, UINT row, UINT col, UINT val ) { UINT offset, n, i; @@ -1221,6 +1222,70 @@ static UINT int_to_table_storage( const MSITABLEVIEW *tv, UINT col, int val, UIN return ERROR_SUCCESS; } +static UINT TABLE_set_int( MSIVIEW *view, UINT row, UINT col, int val ) +{ + MSITABLEVIEW *tv = (MSITABLEVIEW *)view; + UINT r, table_int; + + TRACE("row %u, col %u, val %d.\n", row, col, val); + + if ((r = int_to_table_storage( tv, col, val, &table_int ))) + return r; + + if (tv->columns[col-1].type & MSITYPE_KEY) + { + UINT key; + + if ((r = TABLE_fetch_int( view, row, col, &key ))) + return r; + if (key != table_int) + { + ERR("Cannot modify primary key %s.%s.\n", + debugstr_w(tv->table->name), debugstr_w(tv->columns[col-1].colname)); + return ERROR_FUNCTION_FAILED; + } + } + + return table_set_bytes( tv, row, col, table_int ); +} + +static UINT TABLE_set_string( MSIVIEW *view, UINT row, UINT col, const WCHAR *val, int len ) +{ + MSITABLEVIEW *tv = (MSITABLEVIEW *)view; + BOOL persistent; + UINT id, r; + + TRACE("row %u, col %u, val %s.\n", row, col, debugstr_wn(val, len)); + + persistent = (tv->table->persistent != MSICONDITION_FALSE) + && tv->table->data_persistent[row]; + + if (val) + { + r = msi_string2id( tv->db->strings, val, len, &id ); + if (r != ERROR_SUCCESS) + id = msi_add_string( tv->db->strings, val, len, persistent ); + } + else + id = 0; + + if (tv->columns[col-1].type & MSITYPE_KEY) + { + UINT key; + + if ((r = TABLE_fetch_int( view, row, col, &key ))) + return r; + if (key != id) + { + ERR("Cannot modify primary key %s.%s.\n", + debugstr_w(tv->table->name), debugstr_w(tv->columns[col-1].colname)); + return ERROR_FUNCTION_FAILED; + } + } + + return table_set_bytes( tv, row, col, id ); +} + static UINT TABLE_get_row( struct tagMSIVIEW *view, UINT row, MSIRECORD **rec ) { MSITABLEVIEW *tv = (MSITABLEVIEW *)view; @@ -1402,7 +1467,7 @@ static UINT TABLE_set_row( struct tagMSIVIEW *view, UINT row, MSIRECORD *rec, UI } } - r = TABLE_set_int( tv, row, i+1, val ); + r = table_set_bytes( tv, row, i+1, val ); if ( r != ERROR_SUCCESS ) break; } @@ -2060,6 +2125,8 @@ static const MSIVIEWOPS table_ops = TABLE_fetch_int, TABLE_fetch_stream, TABLE_get_row, + TABLE_set_int, + TABLE_set_string, TABLE_set_row, TABLE_insert_row, TABLE_delete_row, diff --git a/dll/win32/msi/update.c b/dll/win32/msi/update.c index ff4e1abf5f5..e61342d11e4 100644 --- a/dll/win32/msi/update.c +++ b/dll/win32/msi/update.c @@ -203,6 +203,8 @@ static const MSIVIEWOPS update_ops = NULL, NULL, NULL, + NULL, + NULL, UPDATE_execute, UPDATE_close, UPDATE_get_dimensions, diff --git a/dll/win32/msi/where.c b/dll/win32/msi/where.c index 234ba5e0084..6a10a049a63 100644 --- a/dll/win32/msi/where.c +++ b/dll/win32/msi/where.c @@ -271,6 +271,46 @@ static UINT WHERE_get_row( struct tagMSIVIEW *view, UINT row, MSIRECORD **rec ) return msi_view_get_row( wv->db, view, row, rec ); } +static UINT WHERE_set_int(struct tagMSIVIEW *view, UINT row, UINT col, int val) +{ + MSIWHEREVIEW *wv = (MSIWHEREVIEW*)view; + JOINTABLE *table; + UINT *rows; + UINT r; + + TRACE("view %p, row %u, col %u, val %d.\n", wv, row, col, val ); + + r = find_row(wv, row, &rows); + if (r != ERROR_SUCCESS) + return r; + + table = find_table(wv, col, &col); + if (!table) + return ERROR_FUNCTION_FAILED; + + return table->view->ops->set_int(table->view, rows[table->table_index], col, val); +} + +static UINT WHERE_set_string(struct tagMSIVIEW *view, UINT row, UINT col, const WCHAR *val, int len) +{ + MSIWHEREVIEW *wv = (MSIWHEREVIEW*)view; + JOINTABLE *table; + UINT *rows; + UINT r; + + TRACE("view %p, row %u, col %u, val %s.\n", wv, row, col, debugstr_wn(val, len)); + + r = find_row(wv, row, &rows); + if (r != ERROR_SUCCESS) + return r; + + table = find_table(wv, col, &col); + if (!table) + return ERROR_FUNCTION_FAILED; + + return table->view->ops->set_string(table->view, rows[table->table_index], col, val, len); +} + static UINT WHERE_set_row( struct tagMSIVIEW *view, UINT row, MSIRECORD *rec, UINT mask ) { MSIWHEREVIEW *wv = (MSIWHEREVIEW*)view; @@ -1069,6 +1109,8 @@ static const MSIVIEWOPS where_ops = WHERE_fetch_int, WHERE_fetch_stream, WHERE_get_row, + WHERE_set_int, + WHERE_set_string, WHERE_set_row, NULL, WHERE_delete_row,
2 years, 9 months
1
0
0
0
[reactos] 184/360: [WINESYNC] msi: Factor out int_to_table_storage().
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=0e83dd032c7c76e368c3a…
commit 0e83dd032c7c76e368c3aeb45771d9a048e864b0 Author: winesync <ros-dev(a)reactos.org> AuthorDate: Sun Mar 13 00:16:30 2022 +0100 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Sun Mar 20 19:28:09 2022 +0100 [WINESYNC] msi: Factor out int_to_table_storage(). Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id 99425f272f7807aea068629ef3e5fda6640b2845 by Zebediah Figura <z.figura12(a)gmail.com> --- dll/win32/msi/table.c | 53 +++++++++++++++++++++++++-------------------------- 1 file changed, 26 insertions(+), 27 deletions(-) diff --git a/dll/win32/msi/table.c b/dll/win32/msi/table.c index b507268eb7c..e4f6b56f18a 100644 --- a/dll/win32/msi/table.c +++ b/dll/win32/msi/table.c @@ -1201,6 +1201,26 @@ static UINT TABLE_set_int( MSITABLEVIEW *tv, UINT row, UINT col, UINT val ) return ERROR_SUCCESS; } +static UINT int_to_table_storage( const MSITABLEVIEW *tv, UINT col, int val, UINT *ret ) +{ + if ((tv->columns[col-1].type & MSI_DATASIZEMASK) == 2) + { + if (val == MSI_NULL_INTEGER) + *ret = 0; + else if ((val + 0x8000) & 0xffff0000) + { + ERR("value %d out of range\n", val); + return ERROR_FUNCTION_FAILED; + } + else + *ret = val + 0x8000; + } + else + *ret = val ^ 0x80000000; + + return ERROR_SUCCESS; +} + static UINT TABLE_get_row( struct tagMSIVIEW *view, UINT row, MSIRECORD **rec ) { MSITABLEVIEW *tv = (MSITABLEVIEW *)view; @@ -1276,7 +1296,6 @@ static UINT get_table_value_from_record( MSITABLEVIEW *tv, MSIRECORD *rec, UINT { MSICOLUMNINFO columninfo; UINT r; - int ival; if (!iField || iField > tv->num_cols || MSI_RecordIsNull( rec, iField )) return ERROR_FUNCTION_FAILED; @@ -1299,25 +1318,8 @@ static UINT get_table_value_from_record( MSITABLEVIEW *tv, MSIRECORD *rec, UINT } else *pvalue = 0; } - else if ( bytes_per_column( tv->db, &columninfo, LONG_STR_BYTES ) == 2 ) - { - ival = MSI_RecordGetInteger( rec, iField ); - if (ival == 0x80000000) *pvalue = 0x8000; - else - { - *pvalue = 0x8000 + MSI_RecordGetInteger( rec, iField ); - if (*pvalue & 0xffff0000) - { - ERR("field %u value %d out of range\n", iField, *pvalue - 0x8000); - return ERROR_FUNCTION_FAILED; - } - } - } else - { - ival = MSI_RecordGetInteger( rec, iField ); - *pvalue = ival ^ 0x80000000; - } + return int_to_table_storage( tv, iField, MSI_RecordGetInteger( rec, iField ), pvalue ); return ERROR_SUCCESS; } @@ -2370,14 +2372,11 @@ static UINT* msi_record_to_row( const MSITABLEVIEW *tv, MSIRECORD *rec ) } else { - data[i] = MSI_RecordGetInteger( rec, i+1 ); - - if (data[i] == MSI_NULL_INTEGER) - data[i] = 0; - else if ((tv->columns[i].type&0xff) == 2) - data[i] += 0x8000; - else - data[i] += 0x80000000; + if (int_to_table_storage( tv, i + 1, MSI_RecordGetInteger( rec, i + 1 ), &data[i] )) + { + msi_free( data ); + return NULL; + } } } return data;
2 years, 9 months
1
0
0
0
[reactos] 183/360: [WINESYNC] msi: Use 0-indexed row numbers in the modify() view operation.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=def8c91e2a70ed22405aa…
commit def8c91e2a70ed22405aab265f8b1a86d49d800d Author: winesync <ros-dev(a)reactos.org> AuthorDate: Sun Mar 13 00:16:30 2022 +0100 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Sun Mar 20 19:28:09 2022 +0100 [WINESYNC] msi: Use 0-indexed row numbers in the modify() view operation. For consistency with other operations. Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id 8aefa871ad3fcd28b8bc7e5b79f2e661dbab9435 by Zebediah Figura <z.figura12(a)gmail.com> --- dll/win32/msi/msiquery.c | 2 +- dll/win32/msi/select.c | 2 +- dll/win32/msi/table.c | 4 ++-- dll/win32/msi/where.c | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/dll/win32/msi/msiquery.c b/dll/win32/msi/msiquery.c index 036328e0491..94e99b69005 100644 --- a/dll/win32/msi/msiquery.c +++ b/dll/win32/msi/msiquery.c @@ -696,7 +696,7 @@ UINT MSI_ViewModify( MSIQUERY *query, MSIMODIFY mode, MSIRECORD *rec ) if ( mode == MSIMODIFY_UPDATE && rec->cookie != (UINT64)(ULONG_PTR)query ) return ERROR_FUNCTION_FAILED; - r = view->ops->modify( view, mode, rec, query->row ); + r = view->ops->modify( view, mode, rec, query->row - 1 ); if (mode == MSIMODIFY_DELETE && r == ERROR_SUCCESS) query->row--; diff --git a/dll/win32/msi/select.c b/dll/win32/msi/select.c index 8bd4509c0e5..e17cbbbdf25 100644 --- a/dll/win32/msi/select.c +++ b/dll/win32/msi/select.c @@ -253,7 +253,7 @@ static UINT msi_select_update(struct tagMSIVIEW *view, MSIRECORD *rec, UINT row) if (r != ERROR_SUCCESS) return r; - r = sv->table->ops->get_row(sv->table, row - 1, &mod); + r = sv->table->ops->get_row(sv->table, row, &mod); if (r != ERROR_SUCCESS) return r; diff --git a/dll/win32/msi/table.c b/dll/win32/msi/table.c index dfa4469befd..b507268eb7c 100644 --- a/dll/win32/msi/table.c +++ b/dll/win32/msi/table.c @@ -1731,7 +1731,7 @@ static UINT msi_table_update(struct tagMSIVIEW *view, MSIRECORD *rec, UINT row) } /* the row cannot be changed */ - if (row != new_row + 1) + if (row != new_row) return ERROR_FUNCTION_FAILED; return TABLE_set_row(view, new_row, rec, (1 << tv->num_cols) - 1); @@ -1769,7 +1769,7 @@ static UINT msi_refresh_record( struct tagMSIVIEW *view, MSIRECORD *rec, UINT ro MSIRECORD *curr; UINT r, i, count; - r = TABLE_get_row(view, row - 1, &curr); + r = TABLE_get_row(view, row, &curr); if (r != ERROR_SUCCESS) return r; diff --git a/dll/win32/msi/where.c b/dll/win32/msi/where.c index 6c08471bbf7..234ba5e0084 100644 --- a/dll/win32/msi/where.c +++ b/dll/win32/msi/where.c @@ -944,8 +944,8 @@ static UINT WHERE_modify( struct tagMSIVIEW *view, MSIMODIFY eModifyMode, { UINT *rows; - if (find_row(wv, row - 1, &rows) == ERROR_SUCCESS) - row = rows[0] + 1; + if (find_row(wv, row, &rows) == ERROR_SUCCESS) + row = rows[0]; else row = -1;
2 years, 9 months
1
0
0
0
[reactos] 182/360: [WINESYNC] msi: Use a BOOL to track string persistence.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=211c4104969b2c9d23b40…
commit 211c4104969b2c9d23b40e43c05cd90ddf17f033 Author: winesync <ros-dev(a)reactos.org> AuthorDate: Sun Mar 13 00:16:29 2022 +0100 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Sun Mar 20 19:28:09 2022 +0100 [WINESYNC] msi: Use a BOOL to track string persistence. Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id a7f455b97fdd0ef07a15b66eea63f82522ff4f31 by Zebediah Figura <z.figura12(a)gmail.com> --- dll/win32/msi/msipriv.h | 8 +------- dll/win32/msi/storages.c | 2 +- dll/win32/msi/streams.c | 4 ++-- dll/win32/msi/string.c | 18 +++++++++--------- dll/win32/msi/table.c | 8 +++----- 5 files changed, 16 insertions(+), 24 deletions(-) diff --git a/dll/win32/msi/msipriv.h b/dll/win32/msi/msipriv.h index 90fd569aea8..16b02ae86eb 100644 --- a/dll/win32/msi/msipriv.h +++ b/dll/win32/msi/msipriv.h @@ -742,13 +742,7 @@ extern UINT msi_commit_streams( MSIDATABASE *db ) DECLSPEC_HIDDEN; /* string table functions */ -enum StringPersistence -{ - StringPersistent = 0, - StringNonPersistent = 1 -}; - -extern BOOL msi_add_string( string_table *st, const WCHAR *data, int len, enum StringPersistence persistence ) DECLSPEC_HIDDEN; +extern BOOL msi_add_string( string_table *st, const WCHAR *data, int len, BOOL persistent ) DECLSPEC_HIDDEN; extern UINT msi_string2id( const string_table *st, const WCHAR *data, int len, UINT *id ) DECLSPEC_HIDDEN; extern VOID msi_destroy_stringtable( string_table *st ) DECLSPEC_HIDDEN; extern const WCHAR *msi_string_lookup( const string_table *st, UINT id, int *len ) DECLSPEC_HIDDEN; diff --git a/dll/win32/msi/storages.c b/dll/win32/msi/storages.c index 9d262b78f72..4379ae268b2 100644 --- a/dll/win32/msi/storages.c +++ b/dll/win32/msi/storages.c @@ -77,7 +77,7 @@ static STORAGE *create_storage(MSISTORAGESVIEW *sv, LPCWSTR name, IStorage *stg) if (!storage) return NULL; - storage->str_index = msi_add_string(sv->db->strings, name, -1, StringNonPersistent); + storage->str_index = msi_add_string(sv->db->strings, name, -1, FALSE); storage->storage = stg; if (storage->storage) diff --git a/dll/win32/msi/streams.c b/dll/win32/msi/streams.c index 78d8aaa69c2..845c3f2608e 100644 --- a/dll/win32/msi/streams.c +++ b/dll/win32/msi/streams.c @@ -127,7 +127,7 @@ static UINT STREAMS_set_row(struct tagMSIVIEW *view, UINT row, MSIRECORD *rec, U const WCHAR *name = MSI_RecordGetString( rec, 1 ); if (!name) return ERROR_INVALID_PARAMETER; - sv->db->streams[row].str_index = msi_add_string( sv->db->strings, name, -1, StringNonPersistent ); + sv->db->streams[row].str_index = msi_add_string( sv->db->strings, name, -1, FALSE ); } if (mask & 2) { @@ -423,7 +423,7 @@ static UINT append_stream( MSIDATABASE *db, const WCHAR *name, IStream *stream ) if (!streams_resize_table( db, db->num_streams + 1 )) return ERROR_OUTOFMEMORY; - db->streams[i].str_index = msi_add_string( db->strings, name, -1, StringNonPersistent ); + db->streams[i].str_index = msi_add_string( db->strings, name, -1, FALSE ); db->streams[i].stream = stream; db->num_streams++; diff --git a/dll/win32/msi/string.c b/dll/win32/msi/string.c index 7383fddbed3..9dec32d73fe 100644 --- a/dll/win32/msi/string.c +++ b/dll/win32/msi/string.c @@ -209,9 +209,9 @@ static void insert_string_sorted( string_table *st, UINT string_id ) } static void set_st_entry( string_table *st, UINT n, WCHAR *str, int len, USHORT refcount, - enum StringPersistence persistence ) + BOOL persistent ) { - if (persistence == StringPersistent) + if (persistent) { st->strings[n].persistent_refcount = refcount; st->strings[n].nonpersistent_refcount = 0; @@ -257,7 +257,7 @@ static UINT string2id( const string_table *st, const char *buffer, UINT *id ) return r; } -static int add_string( string_table *st, UINT n, const char *data, UINT len, USHORT refcount, enum StringPersistence persistence ) +static int add_string( string_table *st, UINT n, const char *data, UINT len, USHORT refcount, BOOL persistent ) { LPWSTR str; int sz; @@ -274,7 +274,7 @@ static int add_string( string_table *st, UINT n, const char *data, UINT len, USH { if (string2id( st, data, &n ) == ERROR_SUCCESS) { - if (persistence == StringPersistent) + if (persistent) st->strings[n].persistent_refcount += refcount; else st->strings[n].nonpersistent_refcount += refcount; @@ -299,11 +299,11 @@ static int add_string( string_table *st, UINT n, const char *data, UINT len, USH MultiByteToWideChar( st->codepage, 0, data, len, str, sz ); str[sz] = 0; - set_st_entry( st, n, str, sz, refcount, persistence ); + set_st_entry( st, n, str, sz, refcount, persistent ); return n; } -int msi_add_string( string_table *st, const WCHAR *data, int len, enum StringPersistence persistence ) +int msi_add_string( string_table *st, const WCHAR *data, int len, BOOL persistent ) { UINT n; LPWSTR str; @@ -318,7 +318,7 @@ int msi_add_string( string_table *st, const WCHAR *data, int len, enum StringPer if (msi_string2id( st, data, len, &n) == ERROR_SUCCESS ) { - if (persistence == StringPersistent) + if (persistent) st->strings[n].persistent_refcount++; else st->strings[n].nonpersistent_refcount++; @@ -338,7 +338,7 @@ int msi_add_string( string_table *st, const WCHAR *data, int len, enum StringPer memcpy( str, data, len*sizeof(WCHAR) ); str[len] = 0; - set_st_entry( st, n, str, len, 1, persistence ); + set_st_entry( st, n, str, len, 1, persistent ); return n; } @@ -545,7 +545,7 @@ string_table *msi_load_string_table( IStorage *stg, UINT *bytes_per_strref ) break; } - r = add_string( st, n, data+offset, len, refs, StringPersistent ); + r = add_string( st, n, data+offset, len, refs, TRUE ); if( r != n ) ERR("Failed to add string %d\n", n ); n++; diff --git a/dll/win32/msi/table.c b/dll/win32/msi/table.c index 4a0633441f0..dfa4469befd 100644 --- a/dll/win32/msi/table.c +++ b/dll/win32/msi/table.c @@ -716,7 +716,6 @@ static UINT get_tablecolumns( MSIDATABASE *db, LPCWSTR szTableName, MSICOLUMNINF UINT msi_create_table( MSIDATABASE *db, LPCWSTR name, column_info *col_info, MSICONDITION persistent ) { - enum StringPersistence string_persistence = (persistent) ? StringPersistent : StringNonPersistent; UINT r, nField; MSIVIEW *tv = NULL; MSIRECORD *rec = NULL; @@ -756,8 +755,8 @@ UINT msi_create_table( MSIDATABASE *db, LPCWSTR name, column_info *col_info, for( i = 0, col = col_info; col; i++, col = col->next ) { - UINT table_id = msi_add_string( db->strings, col->table, -1, string_persistence ); - UINT col_id = msi_add_string( db->strings, col->column, -1, string_persistence ); + UINT table_id = msi_add_string( db->strings, col->table, -1, persistent ); + UINT col_id = msi_add_string( db->strings, col->column, -1, persistent ); table->colinfo[ i ].tablename = msi_string_lookup( db->strings, table_id, NULL ); table->colinfo[ i ].number = i + 1; @@ -1385,8 +1384,7 @@ static UINT TABLE_set_row( struct tagMSIVIEW *view, UINT row, MSIRECORD *rec, UI { int len; const WCHAR *sval = msi_record_get_string( rec, i + 1, &len ); - val = msi_add_string( tv->db->strings, sval, len, - persistent ? StringPersistent : StringNonPersistent ); + val = msi_add_string( tv->db->strings, sval, len, persistent ); } else {
2 years, 9 months
1
0
0
0
← Newer
1
...
19
20
21
22
23
24
25
...
44
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
Results per page:
10
25
50
100
200