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;