From 05976464556385e7a7ef5d04b2a56c4830ff33cf Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Mon, 28 Jan 2019 22:11:11 -0600 Subject: [PATCH] msi: Implement MSIMODIFY_REFRESH using msi_view_refresh_row(). Signed-off-by: Zebediah Figura Signed-off-by: Hans Leidekker Signed-off-by: Alexandre Julliard --- dlls/msi/query.h | 2 ++ dlls/msi/select.c | 15 ++++++++++----- dlls/msi/tests/db.c | 4 +++- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/dlls/msi/query.h b/dlls/msi/query.h index d79c14fd42e..c0144d30544 100644 --- a/dlls/msi/query.h +++ b/dlls/msi/query.h @@ -153,4 +153,6 @@ UINT msi_create_table( MSIDATABASE *db, LPCWSTR name, column_info *col_info, UINT msi_select_update( MSIVIEW *view, MSIRECORD *rec, UINT row ) DECLSPEC_HIDDEN; +UINT msi_view_refresh_row( MSIDATABASE *db, MSIVIEW *view, UINT row, MSIRECORD *rec ) DECLSPEC_HIDDEN; + #endif /* __WINE_MSI_QUERY_H */ diff --git a/dlls/msi/select.c b/dlls/msi/select.c index ef16e5d09f7..b38f339bd7a 100644 --- a/dlls/msi/select.c +++ b/dlls/msi/select.c @@ -276,20 +276,25 @@ UINT msi_select_update(MSIVIEW *view, MSIRECORD *rec, UINT row) return ERROR_SUCCESS; } -static UINT SELECT_modify( struct tagMSIVIEW *view, MSIMODIFY eModifyMode, +static UINT SELECT_modify( struct tagMSIVIEW *view, MSIMODIFY mode, MSIRECORD *rec, UINT row ) { MSISELECTVIEW *sv = (MSISELECTVIEW*)view; - TRACE("%p %d %p %d\n", sv, eModifyMode, rec, row ); + TRACE("view %p, mode %d, rec %p, row %u.\n", view, mode, rec, row); if( !sv->table ) return ERROR_FUNCTION_FAILED; - if (eModifyMode == MSIMODIFY_UPDATE) + switch (mode) + { + case MSIMODIFY_REFRESH: + return msi_view_refresh_row(sv->db, view, row, rec); + case MSIMODIFY_UPDATE: return msi_select_update(view, rec, row); - - return sv->table->ops->modify( sv->table, eModifyMode, rec, row ); + default: + return sv->table->ops->modify( sv->table, mode, rec, row ); + } } static UINT SELECT_delete( struct tagMSIVIEW *view ) diff --git a/dlls/msi/tests/db.c b/dlls/msi/tests/db.c index 09ba4b8293d..cbdfd3ce7de 100644 --- a/dlls/msi/tests/db.c +++ b/dlls/msi/tests/db.c @@ -3618,6 +3618,7 @@ static void test_join(void) r = MsiViewFetch(hview, &hrec); ok( r == ERROR_SUCCESS, "failed to fetch view: %d\n", r ); + check_record(hrec, 2, "alveolar", "procerus"); r = MsiRecordSetStringA( hrec, 1, "epicranius" ); ok( r == ERROR_SUCCESS, "failed to set string: %d\n", r ); @@ -3627,7 +3628,8 @@ static void test_join(void) /* try another valid operation for joins */ r = MsiViewModify(hview, MSIMODIFY_REFRESH, hrec); - todo_wine ok( r == ERROR_SUCCESS, "failed to refresh row: %d\n", r ); + ok( r == ERROR_SUCCESS, "failed to refresh row: %d\n", r ); + check_record(hrec, 2, "epicranius", "procerus"); /* try an invalid operation for joins */ r = MsiViewModify(hview, MSIMODIFY_DELETE, hrec);