Commit e726b54c authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

msi: Cache ITypeInfo instances for automation objects instead of reloading every time.

parent 55f0663e
......@@ -79,6 +79,7 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
msi_dialog_unregister_class();
msi_free_handle_table();
msi_free( gszLogFile );
release_typelib();
break;
}
return TRUE;
......
......@@ -1072,9 +1072,21 @@ extern VOID ControlEvent_SubscribeToEvent(MSIPACKAGE *package, msi_dialog *dialo
LPCWSTR event, LPCWSTR control, LPCWSTR attribute) DECLSPEC_HIDDEN;
/* OLE automation */
typedef enum tid_t {
Database_tid,
Installer_tid,
Record_tid,
Session_tid,
StringList_tid,
SummaryInfo_tid,
View_tid,
LAST_tid
} tid_t;
extern HRESULT create_msiserver(IUnknown *pOuter, LPVOID *ppObj) DECLSPEC_HIDDEN;
extern HRESULT create_session(MSIHANDLE msiHandle, IDispatch *pInstaller, IDispatch **pDispatch) DECLSPEC_HIDDEN;
extern HRESULT load_type_info(IDispatch *iface, ITypeInfo **pptinfo, REFIID clsid, LCID lcid) DECLSPEC_HIDDEN;
extern HRESULT get_typeinfo(tid_t tid, ITypeInfo **ti) DECLSPEC_HIDDEN;
extern void release_typelib(void) DECLSPEC_HIDDEN;
/* Scripting */
extern DWORD call_script(MSIHANDLE hPackage, INT type, LPCWSTR script, LPCWSTR function, LPCWSTR action) DECLSPEC_HIDDEN;
......
......@@ -268,8 +268,12 @@ static HRESULT WINAPI MsiActiveScriptSite_GetItemInfo(IActiveScriptSite* iface,
/* Are we looking for the session object? */
if (!strcmpW(szSession, pstrName)) {
if (dwReturnMask & SCRIPTINFO_ITYPEINFO)
return load_type_info(This->pSession, ppti, &DIID_Session, 0);
if (dwReturnMask & SCRIPTINFO_ITYPEINFO) {
HRESULT hr = get_typeinfo(Session_tid, ppti);
if (SUCCEEDED(hr))
ITypeInfo_AddRef(*ppti);
return hr;
}
else if (dwReturnMask & SCRIPTINFO_IUNKNOWN) {
IDispatch_QueryInterface(This->pSession, &IID_IUnknown, (void **)ppiunkItem);
return S_OK;
......
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