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
3909a499
Commit
3909a499
authored
May 08, 2007
by
Misha Koshelev
Committed by
Alexandre Julliard
May 08, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: automation: Move VariantClears out of specific case statements when possible.
parent
d3d344be
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
21 deletions
+29
-21
automation.c
dlls/msi/automation.c
+29
-21
No files found.
dlls/msi/automation.c
View file @
3909a499
...
...
@@ -560,10 +560,9 @@ static HRESULT WINAPI RecordImpl_Invoke(
if
(
FAILED
(
hr
))
return
hr
;
hr
=
DispGetParam
(
pDispParams
,
DISPID_PROPERTYPUT
,
VT_BSTR
,
&
varg1
,
puArgErr
);
if
(
FAILED
(
hr
))
return
hr
;
ret
=
MsiRecordSetStringW
(
This
->
msiHandle
,
V_I4
(
&
varg0
),
V_BSTR
(
&
varg1
));
VariantClear
(
&
varg1
);
if
(
ret
!=
ERROR_SUCCESS
)
if
((
ret
=
MsiRecordSetStringW
(
This
->
msiHandle
,
V_I4
(
&
varg0
),
V_BSTR
(
&
varg1
)))
!=
ERROR_SUCCESS
)
{
VariantClear
(
&
varg1
);
ERR
(
"MsiRecordSetString returned %d
\n
"
,
ret
);
return
DISP_E_EXCEPTION
;
}
...
...
@@ -574,6 +573,9 @@ static HRESULT WINAPI RecordImpl_Invoke(
return
DISP_E_MEMBERNOTFOUND
;
}
VariantClear
(
&
varg1
);
VariantClear
(
&
varg0
);
return
S_OK
;
}
...
...
@@ -618,6 +620,8 @@ static HRESULT WINAPI StringListImpl_Invoke(
return
DISP_E_MEMBERNOTFOUND
;
}
VariantClear
(
&
varg0
);
return
S_OK
;
}
...
...
@@ -699,6 +703,9 @@ static HRESULT WINAPI ViewImpl_Invoke(
return
DISP_E_MEMBERNOTFOUND
;
}
VariantClear
(
&
varg1
);
VariantClear
(
&
varg0
);
return
S_OK
;
}
...
...
@@ -730,9 +737,7 @@ static HRESULT WINAPI DatabaseImpl_Invoke(
hr
=
DispGetParam
(
pDispParams
,
0
,
VT_BSTR
,
&
varg0
,
puArgErr
);
if
(
FAILED
(
hr
))
return
hr
;
V_VT
(
pVarResult
)
=
VT_DISPATCH
;
ret
=
MsiDatabaseOpenViewW
(
This
->
msiHandle
,
V_BSTR
(
&
varg0
),
&
msiHandle
);
VariantClear
(
&
varg0
);
if
(
ret
==
ERROR_SUCCESS
)
if
((
ret
=
MsiDatabaseOpenViewW
(
This
->
msiHandle
,
V_BSTR
(
&
varg0
),
&
msiHandle
))
==
ERROR_SUCCESS
)
{
if
(
SUCCEEDED
(
hr
=
create_automation_object
(
msiHandle
,
NULL
,
(
LPVOID
*
)
&
pDispatch
,
&
DIID_View
,
ViewImpl_Invoke
,
NULL
,
0
)))
{
...
...
@@ -744,6 +749,7 @@ static HRESULT WINAPI DatabaseImpl_Invoke(
}
else
{
VariantClear
(
&
varg0
);
ERR
(
"MsiDatabaseOpenView returned %d
\n
"
,
ret
);
return
DISP_E_EXCEPTION
;
}
...
...
@@ -754,6 +760,9 @@ static HRESULT WINAPI DatabaseImpl_Invoke(
return
DISP_E_MEMBERNOTFOUND
;
}
VariantClear
(
&
varg1
);
VariantClear
(
&
varg0
);
return
S_OK
;
}
...
...
@@ -811,7 +820,6 @@ static HRESULT WINAPI SessionImpl_Invoke(
}
if
(
ret
!=
ERROR_SUCCESS
)
ERR
(
"MsiGetProperty returned %d
\n
"
,
ret
);
VariantClear
(
&
varg0
);
}
else
if
(
wFlags
&
DISPATCH_PROPERTYPUT
)
{
hr
=
DispGetParam
(
pDispParams
,
0
,
VT_BSTR
,
&
varg0
,
puArgErr
);
if
(
FAILED
(
hr
))
return
hr
;
...
...
@@ -820,11 +828,10 @@ static HRESULT WINAPI SessionImpl_Invoke(
VariantClear
(
&
varg0
);
return
hr
;
}
ret
=
MsiSetPropertyW
(
This
->
msiHandle
,
V_BSTR
(
&
varg0
),
V_BSTR
(
&
varg1
));
VariantClear
(
&
varg0
);
VariantClear
(
&
varg1
);
if
(
ret
!=
ERROR_SUCCESS
)
if
((
ret
=
MsiSetPropertyW
(
This
->
msiHandle
,
V_BSTR
(
&
varg0
),
V_BSTR
(
&
varg1
)))
!=
ERROR_SUCCESS
)
{
VariantClear
(
&
varg0
);
VariantClear
(
&
varg1
);
ERR
(
"MsiSetProperty returned %d
\n
"
,
ret
);
return
DISP_E_EXCEPTION
;
}
...
...
@@ -884,7 +891,6 @@ static HRESULT WINAPI SessionImpl_Invoke(
hr
=
DispGetParam
(
pDispParams
,
0
,
VT_BSTR
,
&
varg0
,
puArgErr
);
if
(
FAILED
(
hr
))
return
hr
;
ret
=
MsiDoActionW
(
This
->
msiHandle
,
V_BSTR
(
&
varg0
));
VariantClear
(
&
varg0
);
V_VT
(
pVarResult
)
=
VT_I4
;
switch
(
ret
)
{
...
...
@@ -913,6 +919,7 @@ static HRESULT WINAPI SessionImpl_Invoke(
V_I4
(
pVarResult
)
=
msiDoActionStatusBadActionData
;
break
;
default:
VariantClear
(
&
varg0
);
FIXME
(
"MsiDoAction returned unhandled value %d
\n
"
,
ret
);
return
DISP_E_EXCEPTION
;
}
...
...
@@ -941,7 +948,6 @@ static HRESULT WINAPI SessionImpl_Invoke(
ERR
(
"MsiGetFeatureState returned %d
\n
"
,
ret
);
V_I4
(
pVarResult
)
=
msiInstallStateUnknown
;
}
VariantClear
(
&
varg0
);
}
break
;
...
...
@@ -957,7 +963,6 @@ static HRESULT WINAPI SessionImpl_Invoke(
ERR
(
"MsiGetFeatureState returned %d
\n
"
,
ret
);
V_I4
(
pVarResult
)
=
msiInstallStateUnknown
;
}
VariantClear
(
&
varg0
);
}
else
if
(
wFlags
&
DISPATCH_PROPERTYPUT
)
{
hr
=
DispGetParam
(
pDispParams
,
0
,
VT_BSTR
,
&
varg0
,
puArgErr
);
if
(
FAILED
(
hr
))
return
hr
;
...
...
@@ -966,10 +971,9 @@ static HRESULT WINAPI SessionImpl_Invoke(
VariantClear
(
&
varg0
);
return
hr
;
}
ret
=
MsiSetFeatureStateW
(
This
->
msiHandle
,
V_BSTR
(
&
varg0
),
V_I4
(
&
varg1
));
VariantClear
(
&
varg0
);
if
(
ret
!=
ERROR_SUCCESS
)
if
((
ret
=
MsiSetFeatureStateW
(
This
->
msiHandle
,
V_BSTR
(
&
varg0
),
V_I4
(
&
varg1
)))
!=
ERROR_SUCCESS
)
{
VariantClear
(
&
varg0
);
ERR
(
"MsiSetFeatureState returned %d
\n
"
,
ret
);
return
DISP_E_EXCEPTION
;
}
...
...
@@ -980,6 +984,9 @@ static HRESULT WINAPI SessionImpl_Invoke(
return
DISP_E_MEMBERNOTFOUND
;
}
VariantClear
(
&
varg1
);
VariantClear
(
&
varg0
);
return
S_OK
;
}
...
...
@@ -1017,9 +1024,7 @@ static HRESULT WINAPI InstallerImpl_Invoke(
return
hr
;
}
V_VT
(
pVarResult
)
=
VT_DISPATCH
;
ret
=
MsiOpenPackageExW
(
V_BSTR
(
&
varg0
),
V_I4
(
&
varg1
),
&
msiHandle
);
VariantClear
(
&
varg0
);
if
(
ret
==
ERROR_SUCCESS
)
if
((
ret
=
MsiOpenPackageExW
(
V_BSTR
(
&
varg0
),
V_I4
(
&
varg1
),
&
msiHandle
))
==
ERROR_SUCCESS
)
{
if
(
SUCCEEDED
(
create_session
(
msiHandle
,
(
IDispatch
*
)
This
,
&
pDispatch
)))
{
...
...
@@ -1029,6 +1034,7 @@ static HRESULT WINAPI InstallerImpl_Invoke(
}
else
{
VariantClear
(
&
varg0
);
ERR
(
"MsiOpenPackageEx returned %d
\n
"
,
ret
);
return
DISP_E_EXCEPTION
;
}
...
...
@@ -1041,7 +1047,6 @@ static HRESULT WINAPI InstallerImpl_Invoke(
if
(
FAILED
(
hr
))
return
hr
;
V_VT
(
pVarResult
)
=
VT_I4
;
V_I4
(
pVarResult
)
=
MsiQueryProductStateW
(
V_BSTR
(
&
varg0
));
VariantClear
(
&
varg0
);
}
break
;
...
...
@@ -1089,6 +1094,9 @@ static HRESULT WINAPI InstallerImpl_Invoke(
return
DISP_E_MEMBERNOTFOUND
;
}
VariantClear
(
&
varg1
);
VariantClear
(
&
varg0
);
return
S_OK
;
}
...
...
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