Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
8ba0b3c7
Commit
8ba0b3c7
authored
May 04, 2007
by
Misha Koshelev
Committed by
Alexandre Julliard
May 07, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: automation: Store parent Installer object in Session.
parent
4a5a90b0
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
5 deletions
+21
-5
automation.c
dlls/msi/automation.c
+10
-3
msipriv.h
dlls/msi/msipriv.h
+1
-1
script.c
dlls/msi/script.c
+10
-1
No files found.
dlls/msi/automation.c
View file @
8ba0b3c7
...
...
@@ -61,6 +61,9 @@ interface AutomationObject {
/* The MSI handle of the current object */
MSIHANDLE
msiHandle
;
/* The parent Installer object (only used in the Session object) */
IDispatch
*
pInstaller
;
/* A function that is called from AutomationObject::Invoke, specific to this type of object. */
HRESULT
(
STDMETHODCALLTYPE
*
funcInvoke
)(
AutomationObject
*
This
,
...
...
@@ -134,6 +137,7 @@ HRESULT create_automation_object(MSIHANDLE msiHandle, IUnknown *pUnkOuter, LPVOI
object
->
msiHandle
=
msiHandle
;
object
->
clsid
=
(
LPCLSID
)
clsid
;
object
->
funcInvoke
=
funcInvoke
;
object
->
pInstaller
=
NULL
;
/* Load our TypeInfo so we don't have to process GetIDsOfNames */
object
->
iTypeInfo
=
NULL
;
...
...
@@ -894,7 +898,7 @@ static HRESULT WINAPI InstallerImpl_Invoke(
V_VT
(
pVarResult
)
=
VT_DISPATCH
;
if
((
ret
=
MsiOpenPackageExW
(
V_BSTR
(
&
varg0
),
V_I4
(
&
varg1
),
&
msiHandle
))
==
ERROR_SUCCESS
)
{
if
(
SUCCEEDED
(
create_
automation_object
(
msiHandle
,
NULL
,
(
LPVOID
*
)
&
pDispatch
,
&
DIID_Session
,
SessionImpl_Invoke
)))
if
(
SUCCEEDED
(
create_
session
(
msiHandle
,
(
IDispatch
*
)
This
,
&
pDispatch
)))
{
IDispatch_AddRef
(
pDispatch
);
V_DISPATCH
(
pVarResult
)
=
pDispatch
;
...
...
@@ -922,7 +926,10 @@ HRESULT create_msiserver(IUnknown *pOuter, LPVOID *ppObj)
}
/* Wrapper around create_automation_object to create a session object. */
HRESULT
create_session
(
MSIHANDLE
msiHandle
,
IDispatch
**
pDispatch
)
HRESULT
create_session
(
MSIHANDLE
msiHandle
,
IDispatch
*
pInstaller
,
IDispatch
*
*
pDispatch
)
{
return
create_automation_object
(
msiHandle
,
NULL
,
(
LPVOID
)
pDispatch
,
&
DIID_Session
,
SessionImpl_Invoke
);
HRESULT
hr
=
create_automation_object
(
msiHandle
,
NULL
,
(
LPVOID
)
pDispatch
,
&
DIID_Session
,
SessionImpl_Invoke
);
if
(
SUCCEEDED
(
hr
)
&&
pDispatch
&&
*
pDispatch
)
((
AutomationObject
*
)
*
pDispatch
)
->
pInstaller
=
(
IDispatch
*
)
pInstaller
;
return
hr
;
}
dlls/msi/msipriv.h
View file @
8ba0b3c7
...
...
@@ -793,7 +793,7 @@ extern VOID ControlEvent_UnSubscribeToEvent( MSIPACKAGE *package, LPCWSTR event,
/* OLE automation */
extern
HRESULT
create_msiserver
(
IUnknown
*
pOuter
,
LPVOID
*
ppObj
);
extern
HRESULT
create_session
(
MSIHANDLE
msiHandle
,
IDispatch
**
pDispatch
);
extern
HRESULT
create_session
(
MSIHANDLE
msiHandle
,
IDispatch
*
pInstaller
,
IDispatch
*
*
pDispatch
);
extern
HRESULT
load_type_info
(
IDispatch
*
iface
,
ITypeInfo
**
pptinfo
,
REFIID
clsid
,
LCID
lcid
);
/* Scripting */
...
...
dlls/msi/script.c
View file @
8ba0b3c7
...
...
@@ -46,6 +46,7 @@ static const WCHAR szSession[] = {'S','e','s','s','i','o','n',0};
typedef
struct
{
IActiveScriptSite
lpVtbl
;
IDispatch
*
pInstaller
;
IDispatch
*
pSession
;
LONG
ref
;
}
MsiActiveScriptSite
;
...
...
@@ -65,6 +66,7 @@ static HRESULT create_ActiveScriptSite(IUnknown *pUnkOuter, LPVOID *ppObj)
object
->
lpVtbl
.
lpVtbl
=
&
ASS_Vtbl
;
object
->
ref
=
1
;
object
->
pInstaller
=
NULL
;
object
->
pSession
=
NULL
;
*
ppObj
=
object
;
...
...
@@ -97,8 +99,13 @@ DWORD call_script(MSIHANDLE hPackage, INT type, LPCWSTR script, LPCWSTR function
hr
=
create_ActiveScriptSite
(
NULL
,
(
void
**
)
&
pActiveScriptSite
);
if
(
hr
!=
S_OK
)
goto
done
;
/* Create an installer object */
hr
=
create_msiserver
(
NULL
,
(
LPVOID
*
)
&
pActiveScriptSite
->
pInstaller
);
if
(
hr
!=
S_OK
)
goto
done
;
IUnknown_AddRef
((
IUnknown
*
)
pActiveScriptSite
->
pInstaller
);
/* Create a session object */
hr
=
create_session
(
hPackage
,
&
pActiveScriptSite
->
pSession
);
hr
=
create_session
(
hPackage
,
pActiveScriptSite
->
pInstaller
,
&
pActiveScriptSite
->
pSession
);
if
(
hr
!=
S_OK
)
goto
done
;
IUnknown_AddRef
((
IUnknown
*
)
pActiveScriptSite
->
pSession
);
...
...
@@ -181,6 +188,8 @@ done:
if
(
pActiveScript
)
IActiveScriptSite_Release
(
pActiveScript
);
if
(
pActiveScriptSite
&&
pActiveScriptSite
->
pSession
)
IUnknown_Release
((
IUnknown
*
)
pActiveScriptSite
->
pSession
);
if
(
pActiveScriptSite
&&
pActiveScriptSite
->
pInstaller
)
IUnknown_Release
((
IUnknown
*
)
pActiveScriptSite
->
pInstaller
);
if
(
pActiveScriptSite
)
IUnknown_Release
((
IUnknown
*
)
pActiveScriptSite
);
CoUninitialize
();
/* must call even if CoInitialize failed */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment