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
0f8db3fe
Commit
0f8db3fe
authored
Jan 16, 2006
by
Robert Shearman
Committed by
Alexandre Julliard
Jan 16, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
oleaut: Simplify missing argument handling in ITypeInfo::Invoke.
Simplify missing argument handling by pre-allocating an array of the maximum number of missing arguments there could be.
parent
e7187ff3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
12 deletions
+4
-12
typelib.c
dlls/oleaut32/typelib.c
+4
-12
No files found.
dlls/oleaut32/typelib.c
View file @
0f8db3fe
...
...
@@ -5207,30 +5207,22 @@ static HRESULT WINAPI ITypeInfo_fnInvoke(
switch
(
func_desc
->
funckind
)
{
case
FUNC_PUREVIRTUAL
:
case
FUNC_VIRTUAL
:
{
VARIANTARG
*
rgvarg
=
NULL
;
VARIANTARG
*
rgvarg
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
rgvarg
)
*
func_desc
->
cParams
)
;
VARIANTARG
**
prgpvarg
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
*
prgpvarg
)
*
func_desc
->
cParams
);
VARTYPE
*
rgvt
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
rgvt
)
*
func_desc
->
cParams
);
VARIANTARG
*
missing_arg
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
*
missing_arg
)
*
func_desc
->
cParams
);
VARIANT
varresult
;
SHORT
missing_param_offset
=
func_desc
->
cParams
;
SHORT
missing_params
=
0
;
VARIANT
retval
;
/* pointer for storing byref retvals in */
hres
=
S_OK
;
for
(
i
=
0
;
i
<
func_desc
->
cParams
;
i
++
)
{
TYPEDESC
*
tdesc
=
&
func_desc
->
lprgelemdescParam
[
i
].
tdesc
;
USHORT
wParamFlags
=
func_desc
->
lprgelemdescParam
[
i
].
u
.
paramdesc
.
wParamFlags
;
hres
=
typedescvt_to_variantvt
((
ITypeInfo
*
)
iface
,
tdesc
,
&
rgvt
[
i
]);
if
(
FAILED
(
hres
))
goto
func_fail
;
if
((
i
>=
pDispParams
->
cArgs
)
&&
(
wParamFlags
&
PARAMFLAG_FOPT
)
&&
!
(
wParamFlags
&
PARAMFLAG_FHASDEFAULT
))
missing_params
++
;
}
rgvarg
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
rgvarg
)
*
(
func_desc
->
cParams
+
missing_params
));
TRACE
(
"changing args
\n
"
);
for
(
i
=
0
;
i
<
func_desc
->
cParams
;
i
++
)
{
...
...
@@ -5284,8 +5276,7 @@ static HRESULT WINAPI ITypeInfo_fnInvoke(
else
{
V_VT
(
arg
)
=
VT_VARIANT
|
VT_BYREF
;
V_VARIANTREF
(
arg
)
=
&
rgvarg
[
missing_param_offset
];
missing_param_offset
++
;
V_VARIANTREF
(
arg
)
=
&
missing_arg
[
i
];
V_VT
(
V_VARIANTREF
(
arg
))
=
VT_ERROR
;
V_ERROR
(
V_VARIANTREF
(
arg
))
=
DISP_E_PARAMNOTFOUND
;
}
...
...
@@ -5371,6 +5362,7 @@ static HRESULT WINAPI ITypeInfo_fnInvoke(
}
func_fail:
HeapFree
(
GetProcessHeap
(),
0
,
missing_arg
);
HeapFree
(
GetProcessHeap
(),
0
,
prgpvarg
);
HeapFree
(
GetProcessHeap
(),
0
,
rgvarg
);
HeapFree
(
GetProcessHeap
(),
0
,
rgvt
);
...
...
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