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
3b0179cb
Commit
3b0179cb
authored
Nov 14, 2012
by
Nikolay Sivov
Committed by
Alexandre Julliard
Nov 15, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Remove unnecessary casts and argument from script site creation helper.
parent
194c30d1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
19 deletions
+20
-19
script.c
dlls/msi/script.c
+20
-19
No files found.
dlls/msi/script.c
View file @
3b0179cb
...
...
@@ -59,8 +59,8 @@ static const WCHAR szSession[] = {'S','e','s','s','i','o','n',0};
*/
typedef
struct
{
IActiveScriptSite
IActiveScriptSite_iface
;
IDispatch
*
pI
nstaller
;
IDispatch
*
pS
ession
;
IDispatch
*
i
nstaller
;
IDispatch
*
s
ession
;
LONG
ref
;
}
MsiActiveScriptSite
;
...
...
@@ -144,7 +144,7 @@ static HRESULT WINAPI MsiActiveScriptSite_GetItemInfo(IActiveScriptSite* iface,
return
hr
;
}
else
if
(
dwReturnMask
&
SCRIPTINFO_IUNKNOWN
)
{
IDispatch_QueryInterface
(
This
->
pS
ession
,
&
IID_IUnknown
,
(
void
**
)
ppiunkItem
);
IDispatch_QueryInterface
(
This
->
s
ession
,
&
IID_IUnknown
,
(
void
**
)
ppiunkItem
);
return
S_OK
;
}
}
...
...
@@ -251,23 +251,24 @@ static const struct IActiveScriptSiteVtbl activescriptsitevtbl =
MsiActiveScriptSite_OnLeaveScript
};
static
HRESULT
create_
ActiveScriptSite
(
IUnknown
*
outer
,
void
**
obj
)
static
HRESULT
create_
activescriptsite
(
MsiActiveScriptSite
**
obj
)
{
MsiActiveScriptSite
*
object
;
TRACE
(
"(%p
,%p)
\n
"
,
outer
,
obj
);
TRACE
(
"(%p
)
\n
"
,
obj
);
if
(
outer
)
return
CLASS_E_NOAGGREGATION
;
*
obj
=
NULL
;
object
=
msi_alloc
(
sizeof
(
MsiActiveScriptSite
)
);
if
(
!
object
)
return
E_OUTOFMEMORY
;
object
->
IActiveScriptSite_iface
.
lpVtbl
=
&
activescriptsitevtbl
;
object
->
ref
=
1
;
object
->
pI
nstaller
=
NULL
;
object
->
pS
ession
=
NULL
;
object
->
i
nstaller
=
NULL
;
object
->
s
ession
=
NULL
;
*
obj
=
&
object
->
IActiveScriptSite_iface
;
*
obj
=
object
;
return
S_OK
;
}
...
...
@@ -280,7 +281,7 @@ DWORD call_script(MSIHANDLE hPackage, INT type, LPCWSTR script, LPCWSTR function
HRESULT
hr
;
IActiveScript
*
pActiveScript
=
NULL
;
IActiveScriptParse
*
pActiveScriptParse
=
NULL
;
MsiActiveScriptSite
*
pActiveScriptSite
=
NULL
;
MsiActiveScriptSite
*
scriptsite
;
IDispatch
*
pDispatch
=
NULL
;
DISPPARAMS
dispparamsNoArgs
=
{
NULL
,
NULL
,
0
,
0
};
DISPID
dispid
;
...
...
@@ -291,15 +292,15 @@ DWORD call_script(MSIHANDLE hPackage, INT type, LPCWSTR script, LPCWSTR function
CoInitialize
(
NULL
);
/* Create MsiActiveScriptSite object */
hr
=
create_
ActiveScriptSite
(
NULL
,
(
void
**
)
&
pActiveScriptS
ite
);
hr
=
create_
activescriptsite
(
&
scripts
ite
);
if
(
hr
!=
S_OK
)
goto
done
;
/* Create an installer object */
hr
=
create_msiserver
(
NULL
,
(
LPVOID
*
)
&
pActiveScriptSite
->
pI
nstaller
);
hr
=
create_msiserver
(
NULL
,
(
void
**
)
&
scriptsite
->
i
nstaller
);
if
(
hr
!=
S_OK
)
goto
done
;
/* Create a session object */
hr
=
create_session
(
hPackage
,
pActiveScriptSite
->
pInstaller
,
&
pActiveScriptSite
->
pS
ession
);
hr
=
create_session
(
hPackage
,
scriptsite
->
installer
,
&
scriptsite
->
s
ession
);
if
(
hr
!=
S_OK
)
goto
done
;
/* Create the scripting engine */
...
...
@@ -325,7 +326,7 @@ DWORD call_script(MSIHANDLE hPackage, INT type, LPCWSTR script, LPCWSTR function
hr
=
IActiveScript_QueryInterface
(
pActiveScript
,
&
IID_IActiveScriptParse
,
(
void
**
)
&
pActiveScriptParse
);
if
(
FAILED
(
hr
))
goto
done
;
hr
=
IActiveScript_SetScriptSite
(
pActiveScript
,
(
IActiveScriptSite
*
)
pActiveScriptSit
e
);
hr
=
IActiveScript_SetScriptSite
(
pActiveScript
,
&
scriptsite
->
IActiveScriptSite_ifac
e
);
if
(
FAILED
(
hr
))
goto
done
;
hr
=
IActiveScriptParse_InitNew
(
pActiveScriptParse
);
...
...
@@ -372,11 +373,11 @@ done:
if
(
pDispatch
)
IDispatch_Release
(
pDispatch
);
if
(
pActiveScript
)
IActiveScript_Release
(
pActiveScript
);
if
(
pActiveScriptParse
)
IActiveScriptParse_Release
(
pActiveScriptParse
);
if
(
pActiveScriptS
ite
)
if
(
scripts
ite
)
{
if
(
pActiveScriptSite
->
pSession
)
IDispatch_Release
(
pActiveScriptSite
->
pS
ession
);
if
(
pActiveScriptSite
->
pInstaller
)
IDispatch_Release
(
pActiveScriptSite
->
pI
nstaller
);
IActiveScriptSite_Release
(
(
IActiveScriptSite
*
)
pActiveScriptSit
e
);
if
(
scriptsite
->
session
)
IDispatch_Release
(
scriptsite
->
s
ession
);
if
(
scriptsite
->
installer
)
IDispatch_Release
(
scriptsite
->
i
nstaller
);
IActiveScriptSite_Release
(
&
scriptsite
->
IActiveScriptSite_ifac
e
);
}
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