msi: Make sure the view being updated is the same view the record was fetched from.

This commit is contained in:
James Hawkins 2009-02-25 19:44:46 -08:00 committed by Alexandre Julliard
parent e872681af7
commit 2f8c2a8d41
3 changed files with 9 additions and 14 deletions

View file

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

View file

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

View file

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