Commit ec4edbfd authored by Hib Eris's avatar Hib Eris Committed by Alexandre Julliard

msi: Implement ASSIGN mode in MsiViewModify.

parent eaea537f
...@@ -1711,6 +1711,21 @@ static UINT msi_table_update(struct tagMSIVIEW *view, MSIRECORD *rec, UINT row) ...@@ -1711,6 +1711,21 @@ static UINT msi_table_update(struct tagMSIVIEW *view, MSIRECORD *rec, UINT row)
return TABLE_set_row(view, new_row, rec, (1 << tv->num_cols) - 1); return TABLE_set_row(view, new_row, rec, (1 << tv->num_cols) - 1);
} }
static UINT msi_table_assign(struct tagMSIVIEW *view, MSIRECORD *rec)
{
MSITABLEVIEW *tv = (MSITABLEVIEW *)view;
UINT r, row;
if (!tv->table)
return ERROR_INVALID_PARAMETER;
r = msi_table_find_row(tv, rec, &row);
if (r == ERROR_SUCCESS)
return TABLE_set_row(view, row, rec, (1 << tv->num_cols) - 1);
else
return TABLE_insert_row( view, rec, -1, FALSE );
}
static UINT modify_delete_row( struct tagMSIVIEW *view, MSIRECORD *rec ) static UINT modify_delete_row( struct tagMSIVIEW *view, MSIRECORD *rec )
{ {
MSITABLEVIEW *tv = (MSITABLEVIEW *)view; MSITABLEVIEW *tv = (MSITABLEVIEW *)view;
...@@ -1780,6 +1795,9 @@ static UINT TABLE_modify( struct tagMSIVIEW *view, MSIMODIFY eModifyMode, ...@@ -1780,6 +1795,9 @@ static UINT TABLE_modify( struct tagMSIVIEW *view, MSIMODIFY eModifyMode,
break; break;
case MSIMODIFY_ASSIGN: case MSIMODIFY_ASSIGN:
r = msi_table_assign( view, rec );
break;
case MSIMODIFY_REPLACE: case MSIMODIFY_REPLACE:
case MSIMODIFY_MERGE: case MSIMODIFY_MERGE:
case MSIMODIFY_VALIDATE: case MSIMODIFY_VALIDATE:
......
...@@ -4795,7 +4795,7 @@ static void test_viewmodify_assign(void) ...@@ -4795,7 +4795,7 @@ static void test_viewmodify_assign(void)
ok(r == ERROR_SUCCESS, "failed to set integer\n"); ok(r == ERROR_SUCCESS, "failed to set integer\n");
r = MsiViewModify(hview, MSIMODIFY_ASSIGN, hrec); r = MsiViewModify(hview, MSIMODIFY_ASSIGN, hrec);
todo_wine ok(r == ERROR_SUCCESS, "MsiViewModify failed: %d\n", r); ok(r == ERROR_SUCCESS, "MsiViewModify failed: %d\n", r);
r = MsiCloseHandle(hrec); r = MsiCloseHandle(hrec);
ok(r == ERROR_SUCCESS, "failed to close record\n"); ok(r == ERROR_SUCCESS, "failed to close record\n");
...@@ -4811,12 +4811,12 @@ static void test_viewmodify_assign(void) ...@@ -4811,12 +4811,12 @@ static void test_viewmodify_assign(void)
r = MsiViewExecute(hview, 0); r = MsiViewExecute(hview, 0);
ok(r == ERROR_SUCCESS, "MsiViewExecute failed\n"); ok(r == ERROR_SUCCESS, "MsiViewExecute failed\n");
r = MsiViewFetch(hview, &hrec); r = MsiViewFetch(hview, &hrec);
todo_wine ok(r == ERROR_SUCCESS, "MsiViewFetch failed\n"); ok(r == ERROR_SUCCESS, "MsiViewFetch failed\n");
r = MsiRecordGetInteger(hrec, 1); r = MsiRecordGetInteger(hrec, 1);
todo_wine ok(r == 1, "Expected 1, got %d\n", r); ok(r == 1, "Expected 1, got %d\n", r);
r = MsiRecordGetInteger(hrec, 2); r = MsiRecordGetInteger(hrec, 2);
todo_wine ok(r == 2, "Expected 2, got %d\n", r); ok(r == 2, "Expected 2, got %d\n", r);
r = MsiCloseHandle(hrec); r = MsiCloseHandle(hrec);
ok(r == ERROR_SUCCESS, "failed to close record\n"); ok(r == ERROR_SUCCESS, "failed to close record\n");
...@@ -4845,7 +4845,7 @@ static void test_viewmodify_assign(void) ...@@ -4845,7 +4845,7 @@ static void test_viewmodify_assign(void)
ok(r == ERROR_SUCCESS, "failed to set integer\n"); ok(r == ERROR_SUCCESS, "failed to set integer\n");
r = MsiViewModify(hview, MSIMODIFY_ASSIGN, hrec); r = MsiViewModify(hview, MSIMODIFY_ASSIGN, hrec);
todo_wine ok(r == ERROR_SUCCESS, "MsiViewModify failed: %d\n", r); ok(r == ERROR_SUCCESS, "MsiViewModify failed: %d\n", r);
r = MsiCloseHandle(hrec); r = MsiCloseHandle(hrec);
ok(r == ERROR_SUCCESS, "failed to close record\n"); ok(r == ERROR_SUCCESS, "failed to close record\n");
...@@ -4861,12 +4861,12 @@ static void test_viewmodify_assign(void) ...@@ -4861,12 +4861,12 @@ static void test_viewmodify_assign(void)
r = MsiViewExecute(hview, 0); r = MsiViewExecute(hview, 0);
ok(r == ERROR_SUCCESS, "MsiViewExecute failed\n"); ok(r == ERROR_SUCCESS, "MsiViewExecute failed\n");
r = MsiViewFetch(hview, &hrec); r = MsiViewFetch(hview, &hrec);
todo_wine ok(r == ERROR_SUCCESS, "MsiViewFetch failed\n"); ok(r == ERROR_SUCCESS, "MsiViewFetch failed\n");
r = MsiRecordGetInteger(hrec, 1); r = MsiRecordGetInteger(hrec, 1);
todo_wine ok(r == 1, "Expected 1, got %d\n", r); ok(r == 1, "Expected 1, got %d\n", r);
r = MsiRecordGetInteger(hrec, 2); r = MsiRecordGetInteger(hrec, 2);
todo_wine ok(r == 4, "Expected 4, got %d\n", r); ok(r == 4, "Expected 4, got %d\n", r);
r = MsiCloseHandle(hrec); r = MsiCloseHandle(hrec);
ok(r == ERROR_SUCCESS, "failed to close record\n"); ok(r == ERROR_SUCCESS, "failed to close record\n");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment