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};
...
@@ -59,8 +59,8 @@ static const WCHAR szSession[] = {'S','e','s','s','i','o','n',0};
*/
*/
typedef
struct
{
typedef
struct
{
IActiveScriptSite
IActiveScriptSite_iface
;
IActiveScriptSite
IActiveScriptSite_iface
;
IDispatch
*
pI
nstaller
;
IDispatch
*
i
nstaller
;
IDispatch
*
pS
ession
;
IDispatch
*
s
ession
;
LONG
ref
;
LONG
ref
;
}
MsiActiveScriptSite
;
}
MsiActiveScriptSite
;
...
@@ -144,7 +144,7 @@ static HRESULT WINAPI MsiActiveScriptSite_GetItemInfo(IActiveScriptSite* iface,
...
@@ -144,7 +144,7 @@ static HRESULT WINAPI MsiActiveScriptSite_GetItemInfo(IActiveScriptSite* iface,
return
hr
;
return
hr
;
}
}
else
if
(
dwReturnMask
&
SCRIPTINFO_IUNKNOWN
)
{
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
;
return
S_OK
;
}
}
}
}
...
@@ -251,23 +251,24 @@ static const struct IActiveScriptSiteVtbl activescriptsitevtbl =
...
@@ -251,23 +251,24 @@ static const struct IActiveScriptSiteVtbl activescriptsitevtbl =
MsiActiveScriptSite_OnLeaveScript
MsiActiveScriptSite_OnLeaveScript
};
};
static
HRESULT
create_
ActiveScriptSite
(
IUnknown
*
outer
,
void
**
obj
)
static
HRESULT
create_
activescriptsite
(
MsiActiveScriptSite
**
obj
)
{
{
MsiActiveScriptSite
*
object
;
MsiActiveScriptSite
*
object
;
TRACE
(
"(%p
,%p)
\n
"
,
outer
,
obj
);
TRACE
(
"(%p
)
\n
"
,
obj
);
if
(
outer
)
*
obj
=
NULL
;
return
CLASS_E_NOAGGREGATION
;
object
=
msi_alloc
(
sizeof
(
MsiActiveScriptSite
)
);
object
=
msi_alloc
(
sizeof
(
MsiActiveScriptSite
)
);
if
(
!
object
)
return
E_OUTOFMEMORY
;
object
->
IActiveScriptSite_iface
.
lpVtbl
=
&
activescriptsitevtbl
;
object
->
IActiveScriptSite_iface
.
lpVtbl
=
&
activescriptsitevtbl
;
object
->
ref
=
1
;
object
->
ref
=
1
;
object
->
pI
nstaller
=
NULL
;
object
->
i
nstaller
=
NULL
;
object
->
pS
ession
=
NULL
;
object
->
s
ession
=
NULL
;
*
obj
=
&
object
->
IActiveScriptSite_iface
;
*
obj
=
object
;
return
S_OK
;
return
S_OK
;
}
}
...
@@ -280,7 +281,7 @@ DWORD call_script(MSIHANDLE hPackage, INT type, LPCWSTR script, LPCWSTR function
...
@@ -280,7 +281,7 @@ DWORD call_script(MSIHANDLE hPackage, INT type, LPCWSTR script, LPCWSTR function
HRESULT
hr
;
HRESULT
hr
;
IActiveScript
*
pActiveScript
=
NULL
;
IActiveScript
*
pActiveScript
=
NULL
;
IActiveScriptParse
*
pActiveScriptParse
=
NULL
;
IActiveScriptParse
*
pActiveScriptParse
=
NULL
;
MsiActiveScriptSite
*
pActiveScriptSite
=
NULL
;
MsiActiveScriptSite
*
scriptsite
;
IDispatch
*
pDispatch
=
NULL
;
IDispatch
*
pDispatch
=
NULL
;
DISPPARAMS
dispparamsNoArgs
=
{
NULL
,
NULL
,
0
,
0
};
DISPPARAMS
dispparamsNoArgs
=
{
NULL
,
NULL
,
0
,
0
};
DISPID
dispid
;
DISPID
dispid
;
...
@@ -291,15 +292,15 @@ DWORD call_script(MSIHANDLE hPackage, INT type, LPCWSTR script, LPCWSTR function
...
@@ -291,15 +292,15 @@ DWORD call_script(MSIHANDLE hPackage, INT type, LPCWSTR script, LPCWSTR function
CoInitialize
(
NULL
);
CoInitialize
(
NULL
);
/* Create MsiActiveScriptSite object */
/* Create MsiActiveScriptSite object */
hr
=
create_
ActiveScriptSite
(
NULL
,
(
void
**
)
&
pActiveScriptS
ite
);
hr
=
create_
activescriptsite
(
&
scripts
ite
);
if
(
hr
!=
S_OK
)
goto
done
;
if
(
hr
!=
S_OK
)
goto
done
;
/* Create an installer object */
/* 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
;
if
(
hr
!=
S_OK
)
goto
done
;
/* Create a session object */
/* 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
;
if
(
hr
!=
S_OK
)
goto
done
;
/* Create the scripting engine */
/* Create the scripting engine */
...
@@ -325,7 +326,7 @@ DWORD call_script(MSIHANDLE hPackage, INT type, LPCWSTR script, LPCWSTR function
...
@@ -325,7 +326,7 @@ DWORD call_script(MSIHANDLE hPackage, INT type, LPCWSTR script, LPCWSTR function
hr
=
IActiveScript_QueryInterface
(
pActiveScript
,
&
IID_IActiveScriptParse
,
(
void
**
)
&
pActiveScriptParse
);
hr
=
IActiveScript_QueryInterface
(
pActiveScript
,
&
IID_IActiveScriptParse
,
(
void
**
)
&
pActiveScriptParse
);
if
(
FAILED
(
hr
))
goto
done
;
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
;
if
(
FAILED
(
hr
))
goto
done
;
hr
=
IActiveScriptParse_InitNew
(
pActiveScriptParse
);
hr
=
IActiveScriptParse_InitNew
(
pActiveScriptParse
);
...
@@ -372,11 +373,11 @@ done:
...
@@ -372,11 +373,11 @@ done:
if
(
pDispatch
)
IDispatch_Release
(
pDispatch
);
if
(
pDispatch
)
IDispatch_Release
(
pDispatch
);
if
(
pActiveScript
)
IActiveScript_Release
(
pActiveScript
);
if
(
pActiveScript
)
IActiveScript_Release
(
pActiveScript
);
if
(
pActiveScriptParse
)
IActiveScriptParse_Release
(
pActiveScriptParse
);
if
(
pActiveScriptParse
)
IActiveScriptParse_Release
(
pActiveScriptParse
);
if
(
pActiveScriptS
ite
)
if
(
scripts
ite
)
{
{
if
(
pActiveScriptSite
->
pSession
)
IDispatch_Release
(
pActiveScriptSite
->
pS
ession
);
if
(
scriptsite
->
session
)
IDispatch_Release
(
scriptsite
->
s
ession
);
if
(
pActiveScriptSite
->
pInstaller
)
IDispatch_Release
(
pActiveScriptSite
->
pI
nstaller
);
if
(
scriptsite
->
installer
)
IDispatch_Release
(
scriptsite
->
i
nstaller
);
IActiveScriptSite_Release
(
(
IActiveScriptSite
*
)
pActiveScriptSit
e
);
IActiveScriptSite_Release
(
&
scriptsite
->
IActiveScriptSite_ifac
e
);
}
}
CoUninitialize
();
/* must call even if CoInitialize failed */
CoUninitialize
();
/* must call even if CoInitialize failed */
return
ret
;
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