msi: Use 0-indexed row numbers in the modify() view operation.

For consistency with other operations.

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
stable
Zebediah Figura 2019-01-24 00:07:33 -06:00 committed by Alexandre Julliard
parent a7f455b97f
commit 8aefa871ad
4 changed files with 6 additions and 6 deletions

View File

@ -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--;

View File

@ -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;

View File

@ -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;

View File

@ -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;