Misha Koshelev : msi: automation: Implement View::Execute, Fetch, and Close .

Alexandre Julliard julliard at wine.codeweavers.com
Wed May 2 08:14:52 CDT 2007


Module: wine
Branch: master
Commit: deabb2978eb7cf6d1df32914b112feda2290d0ad
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=deabb2978eb7cf6d1df32914b112feda2290d0ad

Author: Misha Koshelev <mk144210 at bcm.edu>
Date:   Mon Apr 30 20:54:02 2007 -0500

msi: automation: Implement View::Execute, Fetch, and Close.

---

 dlls/msi/automation.c |   69 +++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 69 insertions(+), 0 deletions(-)

diff --git a/dlls/msi/automation.c b/dlls/msi/automation.c
index afbeb25..ee1852d 100644
--- a/dlls/msi/automation.c
+++ b/dlls/msi/automation.c
@@ -535,3 +535,72 @@ static HRESULT WINAPI RecordImpl_Invoke(
 
     return S_OK;
 }
+
+static HRESULT WINAPI ViewImpl_Invoke(
+        AutomationObject* This,
+        DISPID dispIdMember,
+        REFIID riid,
+        LCID lcid,
+        WORD wFlags,
+        DISPPARAMS* pDispParams,
+        VARIANT* pVarResult,
+        EXCEPINFO* pExcepInfo,
+        UINT* puArgErr)
+{
+    MSIHANDLE msiHandle;
+    IDispatch *pDispatch = NULL;
+    UINT ret;
+    VARIANTARG varg0, varg1;
+    HRESULT hr;
+
+    VariantInit(&varg0);
+    VariantInit(&varg1);
+
+    switch (dispIdMember)
+    {
+	case DISPID_VIEW_EXECUTE:
+	    if (wFlags & DISPATCH_METHOD)
+	    {
+                hr = DispGetParam(pDispParams, 0, VT_DISPATCH, &varg0, puArgErr);
+                if (SUCCEEDED(hr) && V_DISPATCH(&varg0) != NULL)
+                    MsiViewExecute(This->msiHandle, ((AutomationObject *)V_DISPATCH(&varg0))->msiHandle);
+                else
+                    MsiViewExecute(This->msiHandle, 0);
+	    }
+	    break;
+
+	case DISPID_VIEW_FETCH:
+	    if (wFlags & DISPATCH_METHOD)
+	    {
+                V_VT(pVarResult) = VT_DISPATCH;
+                if ((ret = MsiViewFetch(This->msiHandle, &msiHandle)) == ERROR_SUCCESS)
+                {
+                    if (SUCCEEDED(create_automation_object(msiHandle, NULL, (LPVOID*)&pDispatch, &DIID_Record, RecordImpl_Invoke)))
+                    {
+                        IDispatch_AddRef(pDispatch);
+                        V_DISPATCH(pVarResult) = pDispatch;
+                    }
+                }
+		else if (ret == ERROR_NO_MORE_ITEMS)
+                    V_DISPATCH(pVarResult) = NULL;
+                else
+                {
+                    ERR("MsiViewFetch returned %d\n", ret);
+                    return DISP_E_EXCEPTION;
+                }
+	    }
+	    break;
+
+	case DISPID_VIEW_CLOSE:
+	    if (wFlags & DISPATCH_METHOD)
+	    {
+		MsiViewClose(This->msiHandle);
+	    }
+	    break;
+
+         default:
+            return DISP_E_MEMBERNOTFOUND;
+    }
+
+    return S_OK;
+}




More information about the wine-cvs mailing list