Misha Koshelev : msi: automation: Expose Installer object.

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


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

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

msi: automation: Expose Installer object.

---

 dlls/msi/automation.c       |    6 ++++++
 dlls/msi/msi_main.c         |    6 ------
 dlls/msi/msipriv.h          |    3 +++
 dlls/msi/tests/automation.c |   34 +++++++++++++++++++++++-----------
 4 files changed, 32 insertions(+), 17 deletions(-)

diff --git a/dlls/msi/automation.c b/dlls/msi/automation.c
index d9ca76d..4afef02 100644
--- a/dlls/msi/automation.c
+++ b/dlls/msi/automation.c
@@ -914,3 +914,9 @@ static HRESULT WINAPI InstallerImpl_Invoke(
 
     return S_OK;
 }
+
+/* Wrapper around create_automation_object to create an installer object. */
+HRESULT create_msiserver(IUnknown *pOuter, LPVOID *ppObj)
+{
+    return create_automation_object(0, pOuter, ppObj, &DIID_Installer, InstallerImpl_Invoke);
+}
diff --git a/dlls/msi/msi_main.c b/dlls/msi/msi_main.c
index a3dac7f..402e173 100644
--- a/dlls/msi/msi_main.c
+++ b/dlls/msi/msi_main.c
@@ -115,12 +115,6 @@ ITypeLib *get_msi_typelib( LPWSTR *path )
     return msi_typelib;
 }
 
-static HRESULT create_msiserver( IUnknown *pOuter, LPVOID *ppObj )
-{
-    FIXME("\n");
-    return E_FAIL;
-}
-
 typedef struct tagIClassFactoryImpl {
     const IClassFactoryVtbl *lpVtbl;
     HRESULT (*create_object)( IUnknown*, LPVOID* );
diff --git a/dlls/msi/msipriv.h b/dlls/msi/msipriv.h
index a12a264..dc9f1d3 100644
--- a/dlls/msi/msipriv.h
+++ b/dlls/msi/msipriv.h
@@ -791,6 +791,9 @@ extern VOID ControlEvent_SubscribeToEvent(MSIPACKAGE *package, msi_dialog *dialo
 extern VOID ControlEvent_UnSubscribeToEvent( MSIPACKAGE *package, LPCWSTR event,
                                       LPCWSTR control, LPCWSTR attribute );
 
+/* OLE automation */
+extern HRESULT create_msiserver(IUnknown *pOuter, LPVOID *ppObj);
+
 /* User Interface messages from the actions */
 extern void ui_progress(MSIPACKAGE *, int, int, int, int);
 extern void ui_actiondata(MSIPACKAGE *, LPCWSTR, MSIRECORD *);
diff --git a/dlls/msi/tests/automation.c b/dlls/msi/tests/automation.c
index dcb3c7f..475eb3b 100644
--- a/dlls/msi/tests/automation.c
+++ b/dlls/msi/tests/automation.c
@@ -315,8 +315,19 @@ static WCHAR szSource[] = {'M','s','i',' ','A','P','I',' ','E','r','r','o','r',0
             ok_w2("Exception source was \"%s\" but expected to be \"%s\"\n", excepinfo.bstrSource, szSource); \
 \
         ok(excepinfo.bstrDescription != NULL, "Exception description was NULL\n"); \
-        if (excepinfo.bstrDescription)                                  \
-            ok_w2("Exception description was \"%s\" but expected to be \"%s\"\n", excepinfo.bstrDescription, szDescription); \
+        if (excepinfo.bstrDescription && lstrcmpW(excepinfo.bstrDescription, szDescription) != 0)                    \
+        {                                                               \
+            len = WideCharToMultiByte(CP_ACP, 0, excepinfo.bstrDescription, -1, string1, MAX_PATH, NULL, NULL); \
+            ok(len, "WideCharToMultiByteChar returned error %d\n", GetLastError()); \
+                                                                        \
+            len = WideCharToMultiByte(CP_ACP, 0, szDescription, -1, string2, MAX_PATH, NULL, NULL); \
+            ok(len, "WideCharToMultiByteChar returned error %d\n", GetLastError()); \
+                                                                        \
+            todo_wine {                                                 \
+                /* Our parameter names are different so the descriptions will not match */ \
+                ok(0, "Exception description was \"%s\" but expected to be \"%s\"\n", string1, string2);                        \
+            }                                                           \
+        }                                                               \
     }
 
 static DISPID get_dispid( IDispatch *disp, const char *name )
@@ -339,9 +350,10 @@ static DISPID get_dispid( IDispatch *disp, const char *name )
 
 static void test_dispid(void)
 {
+    ok( get_dispid( pInstaller, "OpenPackage" ) == 2, "dispid wrong\n");
+
     todo_wine {
     ok( get_dispid( pInstaller, "CreateRecord" ) == 1, "dispid wrong\n");
-    ok( get_dispid( pInstaller, "OpenPackage" ) == 2, "dispid wrong\n");
     ok( get_dispid( pInstaller, "OpenProduct" ) == 3, "dispid wrong\n");
     ok( get_dispid( pInstaller, "OpenDatabase" ) == 4, "dispid wrong\n");
     ok( get_dispid( pInstaller, "SummaryInformation" ) == 5, "dispid wrong\n");
@@ -514,14 +526,14 @@ static void test_dispatch(void)
 
     /* Try with NULL params */
     hr = IDispatch_Invoke(pInstaller, dispid, &IID_NULL, LOCALE_NEUTRAL, DISPATCH_METHOD, &dispparams, &varresult, &excepinfo, NULL);
-    ok(hr == DISP_E_TYPEMISMATCH, "IDispatch::Invoke returned 0x%08x\n", hr);
+    todo_wine ok(hr == DISP_E_TYPEMISMATCH, "IDispatch::Invoke returned 0x%08x\n", hr);
 
     /* Try one empty parameter */
     dispparams.rgvarg = vararg;
     dispparams.cArgs = 1;
     VariantInit(&vararg[0]);
     hr = IDispatch_Invoke(pInstaller, dispid, &IID_NULL, LOCALE_NEUTRAL, DISPATCH_METHOD, &dispparams, &varresult, &excepinfo, NULL);
-    ok(hr == DISP_E_TYPEMISMATCH, "IDispatch::Invoke returned 0x%08x\n", hr);
+    todo_wine ok(hr == DISP_E_TYPEMISMATCH, "IDispatch::Invoke returned 0x%08x\n", hr);
 
     /* Try one parameter, function requires two */
     VariantInit(&vararg[0]);
@@ -968,16 +980,16 @@ static void test_Session(IDispatch *pSession)
     /* Session::Mode, get */
     hr = Session_ModeGet(pSession, MSIRUNMODE_REBOOTATEND, &bool);
     ok(SUCCEEDED(hr), "Session_ModeGet failed, hresult 0x%08x\n", hr);
-    ok(!bool, "Reboot at end session mode is %d\n", bool);
+    todo_wine ok(!bool, "Reboot at end session mode is %d\n", bool);
 
     /* Session::Mode, put */
     hr = Session_ModePut(pSession, MSIRUNMODE_REBOOTATEND, TRUE);
-    ok(SUCCEEDED(hr), "Session_ModePut failed, hresult 0x%08x\n", hr);
+    todo_wine ok(SUCCEEDED(hr), "Session_ModePut failed, hresult 0x%08x\n", hr);
     hr = Session_ModeGet(pSession, MSIRUNMODE_REBOOTATEND, &bool);
     ok(SUCCEEDED(hr), "Session_ModeGet failed, hresult 0x%08x\n", hr);
     ok(bool, "Reboot at end session mode is %d, expected 1\n", bool);
     hr = Session_ModePut(pSession, MSIRUNMODE_REBOOTATEND, FALSE);  /* set it again so we don't reboot */
-    ok(SUCCEEDED(hr), "Session_ModePut failed, hresult 0x%08x\n", hr);
+    todo_wine ok(SUCCEEDED(hr), "Session_ModePut failed, hresult 0x%08x\n", hr);
 
     /* Session::Database, get */
     hr = Session_Database(pSession, &pDatabase);
@@ -1064,7 +1076,7 @@ START_TEST(automation)
     hr = CLSIDFromProgID(szProgId, &clsid);
     ok (SUCCEEDED(hr), "CLSIDFromProgID returned 0x%08x\n", hr);
     hr = CoCreateInstance(&clsid, NULL, CLSCTX_INPROC_SERVER, &IID_IUnknown, (void **)&pUnk);
-    todo_wine ok(SUCCEEDED(hr), "CoCreateInstance returned 0x%08x\n", hr);
+    ok(SUCCEEDED(hr), "CoCreateInstance returned 0x%08x\n", hr);
 
     if (pUnk)
     {
@@ -1073,8 +1085,8 @@ START_TEST(automation)
 
         test_dispid();
         test_createrecord_and_version();
-        todo_wine test_dispatch();
-        todo_wine test_Installer();
+        test_dispatch();
+        test_Installer();
 
         hr = IUnknown_Release(pUnk);
         ok (SUCCEEDED(hr), "IUnknown::Release returned 0x%08x\n", hr);




More information about the wine-cvs mailing list