Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
108d5927
Commit
108d5927
authored
Jul 27, 2012
by
Hans Leidekker
Committed by
Alexandre Julliard
Jul 27, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Use the right interface to call 32-bit and 64-bit custom action scripts.
parent
bdaf2e98
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
26 deletions
+41
-26
script.c
dlls/msi/script.c
+41
-26
No files found.
dlls/msi/script.c
View file @
108d5927
...
...
@@ -81,7 +81,8 @@ DWORD call_script(MSIHANDLE hPackage, INT type, LPCWSTR script, LPCWSTR function
{
HRESULT
hr
;
IActiveScript
*
pActiveScript
=
NULL
;
IActiveScriptParse
*
pActiveScriptParse
=
NULL
;
IActiveScriptParse32
*
pActiveScriptParse32
=
NULL
;
IActiveScriptParse64
*
pActiveScriptParse64
=
NULL
;
MsiActiveScriptSite
*
pActiveScriptSite
=
NULL
;
IDispatch
*
pDispatch
=
NULL
;
DISPPARAMS
dispparamsNoArgs
=
{
NULL
,
NULL
,
0
,
0
};
...
...
@@ -123,27 +124,41 @@ DWORD call_script(MSIHANDLE hPackage, INT type, LPCWSTR script, LPCWSTR function
goto
done
;
}
/* Get the IActiveScriptParse engine interface */
hr
=
IActiveScript_QueryInterface
(
pActiveScript
,
&
IID_IActiveScriptParse
,
(
void
**
)
&
pActiveScriptParse
);
if
(
FAILED
(
hr
))
goto
done
;
if
(
type
&
msidbCustomActionType64BitScript
)
{
hr
=
IActiveScript_QueryInterface
(
pActiveScript
,
&
IID_IActiveScriptParse64
,
(
void
**
)
&
pActiveScriptParse64
);
if
(
FAILED
(
hr
))
goto
done
;
/* Give our host to the engine */
hr
=
IActiveScript_SetScriptSite
(
pActiveScript
,
(
IActiveScriptSite
*
)
pActiveScriptSite
);
if
(
FAILED
(
hr
))
goto
done
;
hr
=
IActiveScript_SetScriptSite
(
pActiveScript
,
(
IActiveScriptSite
*
)
pActiveScriptSite
);
if
(
FAILED
(
hr
))
goto
done
;
/* Initialize the script engine */
hr
=
IActiveScriptParse64_InitNew
(
pActiveScriptParse
);
if
(
FAILED
(
hr
))
goto
done
;
hr
=
IActiveScriptParse64_InitNew
(
pActiveScriptParse64
);
if
(
FAILED
(
hr
))
goto
done
;
/* Add the session object */
hr
=
IActiveScript_AddNamedItem
(
pActiveScript
,
szSession
,
SCRIPTITEM_GLOBALMEMBERS
);
if
(
FAILED
(
hr
))
goto
done
;
hr
=
IActiveScript_AddNamedItem
(
pActiveScript
,
szSession
,
SCRIPTITEM_GLOBALMEMBERS
);
if
(
FAILED
(
hr
))
goto
done
;
/* Pass the script to the engine */
hr
=
IActiveScriptParse64_ParseScriptText
(
pActiveScriptParse
,
script
,
NULL
,
NULL
,
NULL
,
0
,
0
,
0L
,
NULL
,
NULL
);
if
(
FAILED
(
hr
))
goto
done
;
hr
=
IActiveScriptParse64_ParseScriptText
(
pActiveScriptParse64
,
script
,
NULL
,
NULL
,
NULL
,
0
,
0
,
0L
,
NULL
,
NULL
);
if
(
FAILED
(
hr
))
goto
done
;
}
else
{
hr
=
IActiveScript_QueryInterface
(
pActiveScript
,
&
IID_IActiveScriptParse32
,
(
void
**
)
&
pActiveScriptParse32
);
if
(
FAILED
(
hr
))
goto
done
;
hr
=
IActiveScript_SetScriptSite
(
pActiveScript
,
(
IActiveScriptSite
*
)
pActiveScriptSite
);
if
(
FAILED
(
hr
))
goto
done
;
hr
=
IActiveScriptParse32_InitNew
(
pActiveScriptParse32
);
if
(
FAILED
(
hr
))
goto
done
;
hr
=
IActiveScript_AddNamedItem
(
pActiveScript
,
szSession
,
SCRIPTITEM_GLOBALMEMBERS
);
if
(
FAILED
(
hr
))
goto
done
;
hr
=
IActiveScriptParse32_ParseScriptText
(
pActiveScriptParse32
,
script
,
NULL
,
NULL
,
NULL
,
0
,
0
,
0L
,
NULL
,
NULL
);
if
(
FAILED
(
hr
))
goto
done
;
}
/* Start processing the script */
hr
=
IActiveScript_SetScriptState
(
pActiveScript
,
SCRIPTSTATE_CONNECTED
);
if
(
FAILED
(
hr
))
goto
done
;
...
...
@@ -176,17 +191,17 @@ DWORD call_script(MSIHANDLE hPackage, INT type, LPCWSTR script, LPCWSTR function
done:
/* Free everything that needs to be freed */
if
(
pDispatch
)
IDispatch_Release
(
pDispatch
);
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
);
if
(
pActiveScript
)
IActiveScript_Release
(
pActiveScript
);
if
(
pActiveScriptParse32
)
IActiveScriptParse32_Release
(
pActiveScriptParse32
);
if
(
pActiveScriptParse64
)
IActiveScriptParse64_Release
(
pActiveScriptParse64
);
if
(
pActiveScriptSite
)
{
if
(
pActiveScriptSite
->
pSession
)
IDispatch_Release
(
pActiveScriptSite
->
pSession
);
if
(
pActiveScriptSite
->
pInstaller
)
IDispatch_Release
(
pActiveScriptSite
->
pInstaller
);
IActiveScriptSite_Release
((
IActiveScriptSite
*
)
pActiveScriptSite
);
}
CoUninitialize
();
/* must call even if CoInitialize failed */
return
ret
;
}
...
...
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