Commit 9d234fcb authored by Misha Koshelev's avatar Misha Koshelev Committed by Alexandre Julliard

msi: automation: Implement View::Modify.

parent 854ca51a
...@@ -735,6 +735,24 @@ static HRESULT WINAPI ViewImpl_Invoke( ...@@ -735,6 +735,24 @@ static HRESULT WINAPI ViewImpl_Invoke(
else return DISP_E_MEMBERNOTFOUND; else return DISP_E_MEMBERNOTFOUND;
break; break;
case DISPID_VIEW_MODIFY:
if (wFlags & DISPATCH_METHOD)
{
hr = DispGetParam(pDispParams, 0, VT_I4, &varg0, puArgErr);
if (FAILED(hr)) return hr;
hr = DispGetParam(pDispParams, 1, VT_DISPATCH, &varg1, puArgErr);
if (FAILED(hr)) return hr;
if (!V_DISPATCH(&varg1)) return DISP_E_EXCEPTION;
if ((ret = MsiViewModify(This->msiHandle, V_I4(&varg0), ((AutomationObject *)V_DISPATCH(&varg1))->msiHandle)) != ERROR_SUCCESS)
{
VariantClear(&varg1);
ERR("MsiViewModify returned %d\n", ret);
return DISP_E_EXCEPTION;
}
}
else return DISP_E_MEMBERNOTFOUND;
break;
case DISPID_VIEW_CLOSE: case DISPID_VIEW_CLOSE:
if (wFlags & DISPATCH_METHOD) if (wFlags & DISPATCH_METHOD)
{ {
......
...@@ -124,6 +124,22 @@ library WindowsInstaller ...@@ -124,6 +124,22 @@ library WindowsInstaller
methods: methods:
} }
typedef enum {
msiViewModifySeek = -1,
msiViewModifyRefresh = 0,
msiViewModifyInsert = 1,
msiViewModifyUpdate = 2,
msiViewModifyAssign = 3,
msiViewModifyReplace = 4,
msiViewModifyMerge = 5,
msiViewModifyDelete = 6,
msiViewModifyInsertTemporary = 7,
msiViewModifyValidate = 8,
msiViewModifyValidateNew = 9,
msiViewModifyValidateField = 10,
msiViewModifyValidateDelete = 11,
} _MsiViewModify; /* Added underscore to avoid conflict with function name */
[ uuid(000C109C-0000-0000-C000-000000000046) ] [ uuid(000C109C-0000-0000-C000-000000000046) ]
dispinterface View dispinterface View
{ {
...@@ -133,6 +149,10 @@ library WindowsInstaller ...@@ -133,6 +149,10 @@ library WindowsInstaller
void Execute([in, optional, defaultvalue(0)] Record *Params); void Execute([in, optional, defaultvalue(0)] Record *Params);
[id(DISPID_VIEW_FETCH)] [id(DISPID_VIEW_FETCH)]
Record* Fetch(); Record* Fetch();
[id(DISPID_VIEW_MODIFY)]
void Modify(
[in] _MsiViewModify Mode,
Record *Record);
[id(DISPID_VIEW_CLOSE)] [id(DISPID_VIEW_CLOSE)]
void Close(); void Close();
} }
......
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
#define DISPID_VIEW_EXECUTE 1 #define DISPID_VIEW_EXECUTE 1
#define DISPID_VIEW_FETCH 2 #define DISPID_VIEW_FETCH 2
#define DISPID_VIEW_MODIFY 3
#define DISPID_VIEW_CLOSE 4 #define DISPID_VIEW_CLOSE 4
#define DISPID_DATABASE_OPENVIEW 3 #define DISPID_DATABASE_OPENVIEW 3
......
...@@ -1071,8 +1071,6 @@ static void test_Database(IDispatch *pDatabase) ...@@ -1071,8 +1071,6 @@ static void test_Database(IDispatch *pDatabase)
ok_exception(hr, szStringDataField); ok_exception(hr, szStringDataField);
/* View::Modify with incorrect parameters */ /* View::Modify with incorrect parameters */
todo_wine
{
hr = View_Modify(pView, -5, NULL); hr = View_Modify(pView, -5, NULL);
ok(hr == DISP_E_EXCEPTION, "View_Modify failed, hresult 0x%08x\n", hr); ok(hr == DISP_E_EXCEPTION, "View_Modify failed, hresult 0x%08x\n", hr);
ok_exception(hr, szModifyModeRecord); ok_exception(hr, szModifyModeRecord);
...@@ -1084,14 +1082,11 @@ static void test_Database(IDispatch *pDatabase) ...@@ -1084,14 +1082,11 @@ static void test_Database(IDispatch *pDatabase)
hr = View_Modify(pView, MSIMODIFY_REFRESH, NULL); hr = View_Modify(pView, MSIMODIFY_REFRESH, NULL);
ok(hr == DISP_E_EXCEPTION, "View_Modify failed, hresult 0x%08x\n", hr); ok(hr == DISP_E_EXCEPTION, "View_Modify failed, hresult 0x%08x\n", hr);
ok_exception(hr, szModifyModeRecord); ok_exception(hr, szModifyModeRecord);
}
/* View::Modify with MSIMODIFY_REFRESH should undo our changes */ /* View::Modify with MSIMODIFY_REFRESH should undo our changes */
todo_wine
{
hr = View_Modify(pView, MSIMODIFY_REFRESH, pRecord); hr = View_Modify(pView, MSIMODIFY_REFRESH, pRecord);
ok(SUCCEEDED(hr), "View_Modify failed, hresult 0x%08x\n", hr); /* Wine's MsiViewModify currently does not support MSIMODIFY_REFRESH */
} todo_wine ok(SUCCEEDED(hr), "View_Modify failed, hresult 0x%08x\n", hr);
/* Record::StringDataGet, confirm that the record is back to its unmodified value */ /* Record::StringDataGet, confirm that the record is back to its unmodified value */
memset(szString, 0, sizeof(szString)); memset(szString, 0, sizeof(szString));
......
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