msi: Implement the MSIMODIFY_REFRESH command of MsiViewModify.
This commit is contained in:
parent
30e5321867
commit
40aa7df344
|
@ -1626,6 +1626,23 @@ static UINT modify_delete_row( struct tagMSIVIEW *view, MSIRECORD *rec )
|
|||
return TABLE_delete_row(view, row);
|
||||
}
|
||||
|
||||
static UINT msi_refresh_record( struct tagMSIVIEW *view, MSIRECORD *rec, UINT row )
|
||||
{
|
||||
MSIRECORD *curr;
|
||||
UINT r, i, count;
|
||||
|
||||
r = TABLE_get_row(view, row - 1, &curr);
|
||||
if (r != ERROR_SUCCESS)
|
||||
return r;
|
||||
|
||||
count = MSI_RecordGetFieldCount(rec);
|
||||
for (i = 0; i < count; i++)
|
||||
MSI_RecordCopyField(curr, i + 1, rec, i + 1);
|
||||
|
||||
msiobj_release(&curr->hdr);
|
||||
return ERROR_SUCCESS;
|
||||
}
|
||||
|
||||
static UINT TABLE_modify( struct tagMSIVIEW *view, MSIMODIFY eModifyMode,
|
||||
MSIRECORD *rec, UINT row)
|
||||
{
|
||||
|
@ -1657,11 +1674,14 @@ static UINT TABLE_modify( struct tagMSIVIEW *view, MSIMODIFY eModifyMode,
|
|||
r = TABLE_insert_row( view, rec, TRUE );
|
||||
break;
|
||||
|
||||
case MSIMODIFY_REFRESH:
|
||||
r = msi_refresh_record( view, rec, row );
|
||||
break;
|
||||
|
||||
case MSIMODIFY_UPDATE:
|
||||
r = msi_table_update( view, rec, row );
|
||||
break;
|
||||
|
||||
case MSIMODIFY_REFRESH:
|
||||
case MSIMODIFY_ASSIGN:
|
||||
case MSIMODIFY_REPLACE:
|
||||
case MSIMODIFY_MERGE:
|
||||
|
|
|
@ -1527,10 +1527,8 @@ static void test_Database(IDispatch *pDatabase, BOOL readonly)
|
|||
ok(hr == DISP_E_EXCEPTION, "View_Modify failed, hresult 0x%08x\n", hr);
|
||||
ok_exception(hr, szModifyModeRecord);
|
||||
|
||||
/* View::Modify with MSIMODIFY_REFRESH should undo our changes */
|
||||
hr = View_Modify(pView, MSIMODIFY_REFRESH, pRecord);
|
||||
/* Wine's MsiViewModify currently does not support MSIMODIFY_REFRESH */
|
||||
todo_wine ok(hr == S_OK, "View_Modify failed, hresult 0x%08x\n", hr);
|
||||
ok(hr == S_OK, "View_Modify failed, hresult 0x%08x\n", hr);
|
||||
|
||||
/* Record::StringDataGet, confirm that the record is back to its unmodified value */
|
||||
memset(szString, 0, sizeof(szString));
|
||||
|
|
|
@ -5762,10 +5762,7 @@ static void test_viewmodify_refresh(void)
|
|||
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
|
||||
|
||||
r = MsiViewModify(hview, MSIMODIFY_REFRESH, hrec);
|
||||
todo_wine
|
||||
{
|
||||
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
|
||||
}
|
||||
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
|
||||
|
||||
size = MAX_PATH;
|
||||
r = MsiRecordGetStringA(hrec, 1, buffer, &size);
|
||||
|
@ -5774,10 +5771,7 @@ static void test_viewmodify_refresh(void)
|
|||
ok(size == 2, "Expected 2, got %d\n", size);
|
||||
|
||||
r = MsiRecordGetInteger(hrec, 2);
|
||||
todo_wine
|
||||
{
|
||||
ok(r == 2, "Expected 2, got %d\n", r);
|
||||
}
|
||||
ok(r == 2, "Expected 2, got %d\n", r);
|
||||
|
||||
MsiCloseHandle(hrec);
|
||||
MsiViewClose(hview);
|
||||
|
@ -5805,10 +5799,7 @@ static void test_viewmodify_refresh(void)
|
|||
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
|
||||
|
||||
r = MsiViewModify(hview, MSIMODIFY_REFRESH, hrec);
|
||||
todo_wine
|
||||
{
|
||||
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
|
||||
}
|
||||
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
|
||||
|
||||
size = MAX_PATH;
|
||||
r = MsiRecordGetStringA(hrec, 1, buffer, &size);
|
||||
|
@ -5817,10 +5808,7 @@ static void test_viewmodify_refresh(void)
|
|||
ok(size == 5, "Expected 5, got %d\n", size);
|
||||
|
||||
r = MsiRecordGetInteger(hrec, 2);
|
||||
todo_wine
|
||||
{
|
||||
ok(r == 2, "Expected 2, got %d\n", r);
|
||||
}
|
||||
ok(r == 2, "Expected 2, got %d\n", r);
|
||||
|
||||
MsiCloseHandle(hrec);
|
||||
MsiViewClose(hview);
|
||||
|
|
|
@ -503,11 +503,17 @@ static UINT WHERE_modify( struct tagMSIVIEW *view, MSIMODIFY eModifyMode,
|
|||
MSIRECORD *rec, UINT row )
|
||||
{
|
||||
MSIWHEREVIEW *wv = (MSIWHEREVIEW*)view;
|
||||
UINT r;
|
||||
|
||||
TRACE("%p %d %p\n", wv, eModifyMode, rec );
|
||||
TRACE("%p %d %p\n", wv, eModifyMode, rec);
|
||||
|
||||
if( !wv->table )
|
||||
return ERROR_FUNCTION_FAILED;
|
||||
r = WHERE_execute(view, NULL);
|
||||
if (r != ERROR_SUCCESS)
|
||||
return r;
|
||||
|
||||
r = find_entry_in_hash(wv->reorder, row - 1, &row);
|
||||
if (r != ERROR_SUCCESS)
|
||||
return r;
|
||||
|
||||
return wv->table->ops->modify( wv->table, eModifyMode, rec, row );
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue