diff --git a/dlls/msi/msiquery.c b/dlls/msi/msiquery.c index 430ff52cbeb..0cfd05e8b1d 100644 --- a/dlls/msi/msiquery.c +++ b/dlls/msi/msiquery.c @@ -377,7 +377,10 @@ UINT MSI_ViewFetch(MSIQUERY *query, MSIRECORD **prec) r = msi_view_get_row(query->db, view, query->row, prec); if (r == ERROR_SUCCESS) + { query->row ++; + MSI_RecordSetInteger(*prec, 0, (int)query); + } return r; } @@ -597,6 +600,9 @@ UINT MSI_ViewModify( MSIQUERY *query, MSIMODIFY mode, MSIRECORD *rec ) if ( !view || !view->ops->modify) return ERROR_FUNCTION_FAILED; + if ( mode == MSIMODIFY_UPDATE && MSI_RecordGetInteger( rec, 0 ) != (int)query ) + return ERROR_FUNCTION_FAILED; + r = view->ops->modify( view, mode, rec, query->row ); if (mode == MSIMODIFY_DELETE && r == ERROR_SUCCESS) query->row--; diff --git a/dlls/msi/tests/db.c b/dlls/msi/tests/db.c index 7629bc3c0e5..bc7e513e8c6 100644 --- a/dlls/msi/tests/db.c +++ b/dlls/msi/tests/db.c @@ -321,10 +321,8 @@ static void test_msiinsert(void) r = MsiRecordGetFieldCount(hrec); ok(r == 3, "record count wrong\n"); - todo_wine { r = MsiRecordIsNull(hrec, 0); ok(r == FALSE, "field 0 not null\n"); - } r = MsiRecordGetInteger(hrec, 1); ok(r == 1, "field 1 contents wrong\n"); @@ -903,10 +901,7 @@ static void test_viewmodify(void) ok(r == ERROR_SUCCESS, "failed to set string\n"); r = MsiViewModify(hview, MSIMODIFY_UPDATE, hrec); - todo_wine - { - ok(r == ERROR_FUNCTION_FAILED, "MsiViewModify failed\n"); - } + ok(r == ERROR_FUNCTION_FAILED, "MsiViewModify failed\n"); r = MsiCloseHandle(hrec); ok(r == ERROR_SUCCESS, "failed to close record\n"); diff --git a/dlls/msi/tests/record.c b/dlls/msi/tests/record.c index 1b882393bed..8f2b963acd3 100644 --- a/dlls/msi/tests/record.c +++ b/dlls/msi/tests/record.c @@ -569,16 +569,10 @@ static void test_fieldzero(void) ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); r = MsiRecordGetInteger(rec, 0); - todo_wine - { - ok(r != MSI_NULL_INTEGER && r != 0, "Expected non-NULL value, got %d\n", r); - } + ok(r != MSI_NULL_INTEGER && r != 0, "Expected non-NULL value, got %d\n", r); r = MsiRecordIsNull(rec, 0); - todo_wine - { - ok(r == FALSE, "Expected FALSE, got %d\n", r); - } + ok(r == FALSE, "Expected FALSE, got %d\n", r); MsiCloseHandle(hdb); DeleteFileA(msifile);