msi: automation: Expose Installer object.

This commit is contained in:
Misha Koshelev 2007-04-30 20:54:31 -05:00 committed by Alexandre Julliard
parent 8026c070bc
commit f217cacbc2
4 changed files with 32 additions and 17 deletions

View File

@ -914,3 +914,9 @@ static HRESULT WINAPI InstallerImpl_Invoke(
return S_OK; 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);
}

View File

@ -115,12 +115,6 @@ ITypeLib *get_msi_typelib( LPWSTR *path )
return msi_typelib; return msi_typelib;
} }
static HRESULT create_msiserver( IUnknown *pOuter, LPVOID *ppObj )
{
FIXME("\n");
return E_FAIL;
}
typedef struct tagIClassFactoryImpl { typedef struct tagIClassFactoryImpl {
const IClassFactoryVtbl *lpVtbl; const IClassFactoryVtbl *lpVtbl;
HRESULT (*create_object)( IUnknown*, LPVOID* ); HRESULT (*create_object)( IUnknown*, LPVOID* );

View File

@ -791,6 +791,9 @@ extern VOID ControlEvent_SubscribeToEvent(MSIPACKAGE *package, msi_dialog *dialo
extern VOID ControlEvent_UnSubscribeToEvent( MSIPACKAGE *package, LPCWSTR event, extern VOID ControlEvent_UnSubscribeToEvent( MSIPACKAGE *package, LPCWSTR event,
LPCWSTR control, LPCWSTR attribute ); LPCWSTR control, LPCWSTR attribute );
/* OLE automation */
extern HRESULT create_msiserver(IUnknown *pOuter, LPVOID *ppObj);
/* User Interface messages from the actions */ /* User Interface messages from the actions */
extern void ui_progress(MSIPACKAGE *, int, int, int, int); extern void ui_progress(MSIPACKAGE *, int, int, int, int);
extern void ui_actiondata(MSIPACKAGE *, LPCWSTR, MSIRECORD *); extern void ui_actiondata(MSIPACKAGE *, LPCWSTR, MSIRECORD *);

View File

@ -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_w2("Exception source was \"%s\" but expected to be \"%s\"\n", excepinfo.bstrSource, szSource); \
\ \
ok(excepinfo.bstrDescription != NULL, "Exception description was NULL\n"); \ ok(excepinfo.bstrDescription != NULL, "Exception description was NULL\n"); \
if (excepinfo.bstrDescription) \ if (excepinfo.bstrDescription && lstrcmpW(excepinfo.bstrDescription, szDescription) != 0) \
ok_w2("Exception description was \"%s\" but expected to be \"%s\"\n", excepinfo.bstrDescription, szDescription); \ { \
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 ) 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) static void test_dispid(void)
{ {
ok( get_dispid( pInstaller, "OpenPackage" ) == 2, "dispid wrong\n");
todo_wine { todo_wine {
ok( get_dispid( pInstaller, "CreateRecord" ) == 1, "dispid wrong\n"); 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, "OpenProduct" ) == 3, "dispid wrong\n");
ok( get_dispid( pInstaller, "OpenDatabase" ) == 4, "dispid wrong\n"); ok( get_dispid( pInstaller, "OpenDatabase" ) == 4, "dispid wrong\n");
ok( get_dispid( pInstaller, "SummaryInformation" ) == 5, "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 */ /* Try with NULL params */
hr = IDispatch_Invoke(pInstaller, dispid, &IID_NULL, LOCALE_NEUTRAL, DISPATCH_METHOD, &dispparams, &varresult, &excepinfo, NULL); 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 */ /* Try one empty parameter */
dispparams.rgvarg = vararg; dispparams.rgvarg = vararg;
dispparams.cArgs = 1; dispparams.cArgs = 1;
VariantInit(&vararg[0]); VariantInit(&vararg[0]);
hr = IDispatch_Invoke(pInstaller, dispid, &IID_NULL, LOCALE_NEUTRAL, DISPATCH_METHOD, &dispparams, &varresult, &excepinfo, NULL); 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 */ /* Try one parameter, function requires two */
VariantInit(&vararg[0]); VariantInit(&vararg[0]);
@ -968,16 +980,16 @@ static void test_Session(IDispatch *pSession)
/* Session::Mode, get */ /* Session::Mode, get */
hr = Session_ModeGet(pSession, MSIRUNMODE_REBOOTATEND, &bool); hr = Session_ModeGet(pSession, MSIRUNMODE_REBOOTATEND, &bool);
ok(SUCCEEDED(hr), "Session_ModeGet failed, hresult 0x%08x\n", hr); 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 */ /* Session::Mode, put */
hr = Session_ModePut(pSession, MSIRUNMODE_REBOOTATEND, TRUE); 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); hr = Session_ModeGet(pSession, MSIRUNMODE_REBOOTATEND, &bool);
ok(SUCCEEDED(hr), "Session_ModeGet failed, hresult 0x%08x\n", hr); ok(SUCCEEDED(hr), "Session_ModeGet failed, hresult 0x%08x\n", hr);
ok(bool, "Reboot at end session mode is %d, expected 1\n", bool); 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 */ 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 */ /* Session::Database, get */
hr = Session_Database(pSession, &pDatabase); hr = Session_Database(pSession, &pDatabase);
@ -1064,7 +1076,7 @@ START_TEST(automation)
hr = CLSIDFromProgID(szProgId, &clsid); hr = CLSIDFromProgID(szProgId, &clsid);
ok (SUCCEEDED(hr), "CLSIDFromProgID returned 0x%08x\n", hr); ok (SUCCEEDED(hr), "CLSIDFromProgID returned 0x%08x\n", hr);
hr = CoCreateInstance(&clsid, NULL, CLSCTX_INPROC_SERVER, &IID_IUnknown, (void **)&pUnk); 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) if (pUnk)
{ {
@ -1073,8 +1085,8 @@ START_TEST(automation)
test_dispid(); test_dispid();
test_createrecord_and_version(); test_createrecord_and_version();
todo_wine test_dispatch(); test_dispatch();
todo_wine test_Installer(); test_Installer();
hr = IUnknown_Release(pUnk); hr = IUnknown_Release(pUnk);
ok (SUCCEEDED(hr), "IUnknown::Release returned 0x%08x\n", hr); ok (SUCCEEDED(hr), "IUnknown::Release returned 0x%08x\n", hr);