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
25d6e9ae
Commit
25d6e9ae
authored
Feb 02, 2012
by
Alessandro Pignotti
Committed by
Alexandre Julliard
Mar 16, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
oleaut32: Avoid converting variants if it is not needed.
parent
a1af8395
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
68 additions
and
61 deletions
+68
-61
typelib.c
dlls/oleaut32/typelib.c
+68
-61
No files found.
dlls/oleaut32/typelib.c
View file @
25d6e9ae
...
...
@@ -6427,83 +6427,90 @@ static HRESULT WINAPI ITypeInfo_fnInvoke(
{
dump_Variant
(
src_arg
);
if
(
rgvt
[
i
]
==
VT_VARIANT
)
hres
=
VariantCopy
(
&
rgvarg
[
i
],
src_arg
);
else
if
(
rgvt
[
i
]
==
(
VT_VARIANT
|
VT_BYREF
))
if
(
rgvt
[
i
]
!=
V_VT
(
src_arg
))
{
if
(
rgvt
[
i
]
==
V_VT
(
src_arg
))
V_VARIANTREF
(
&
rgvarg
[
i
])
=
V_VARIANTREF
(
src_arg
);
else
if
(
rgvt
[
i
]
==
VT_VARIANT
)
hres
=
VariantCopy
(
&
rgvarg
[
i
],
src_arg
);
else
if
(
rgvt
[
i
]
==
(
VT_VARIANT
|
VT_BYREF
))
{
if
(
rgvt
[
i
]
==
V_VT
(
src_arg
))
V_VARIANTREF
(
&
rgvarg
[
i
])
=
V_VARIANTREF
(
src_arg
);
else
{
VARIANTARG
*
missing_arg
=
INVBUF_GET_MISSING_ARG_ARRAY
(
buffer
,
func_desc
->
cParams
);
if
(
wParamFlags
&
PARAMFLAG_FIN
)
hres
=
VariantCopy
(
&
missing_arg
[
i
],
src_arg
);
V_VARIANTREF
(
&
rgvarg
[
i
])
=
&
missing_arg
[
i
];
}
V_VT
(
&
rgvarg
[
i
])
=
rgvt
[
i
];
}
else
if
(
rgvt
[
i
]
==
(
VT_VARIANT
|
VT_ARRAY
)
&&
func_desc
->
cParamsOpt
<
0
&&
i
==
func_desc
->
cParams
-
1
)
{
SAFEARRAY
*
a
;
SAFEARRAYBOUND
bound
;
VARIANT
*
v
;
LONG
j
;
bound
.
lLbound
=
0
;
bound
.
cElements
=
pDispParams
->
cArgs
-
i
;
if
(
!
(
a
=
SafeArrayCreate
(
VT_VARIANT
,
1
,
&
bound
)))
{
ERR
(
"SafeArrayCreate failed
\n
"
);
break
;
}
hres
=
SafeArrayAccessData
(
a
,
(
LPVOID
)
&
v
);
if
(
hres
!=
S_OK
)
{
ERR
(
"SafeArrayAccessData failed with %x
\n
"
,
hres
);
break
;
}
for
(
j
=
0
;
j
<
bound
.
cElements
;
j
++
)
VariantCopy
(
&
v
[
j
],
&
pDispParams
->
rgvarg
[
pDispParams
->
cArgs
-
1
-
i
-
j
]);
hres
=
SafeArrayUnaccessData
(
a
);
if
(
hres
!=
S_OK
)
{
ERR
(
"SafeArrayUnaccessData failed with %x
\n
"
,
hres
);
break
;
}
V_ARRAY
(
&
rgvarg
[
i
])
=
a
;
V_VT
(
&
rgvarg
[
i
])
=
rgvt
[
i
];
}
else
if
((
rgvt
[
i
]
&
VT_BYREF
)
&&
!
V_ISBYREF
(
src_arg
))
{
VARIANTARG
*
missing_arg
=
INVBUF_GET_MISSING_ARG_ARRAY
(
buffer
,
func_desc
->
cParams
);
if
(
wParamFlags
&
PARAMFLAG_FIN
)
hres
=
VariantCopy
(
&
missing_arg
[
i
],
src_arg
);
V_VARIANTREF
(
&
rgvarg
[
i
])
=
&
missing_arg
[
i
];
hres
=
VariantChangeType
(
&
missing_arg
[
i
],
src_arg
,
0
,
rgvt
[
i
]
&
~
VT_BYREF
);
else
V_VT
(
&
missing_arg
[
i
])
=
rgvt
[
i
]
&
~
VT_BYREF
;
V_BYREF
(
&
rgvarg
[
i
])
=
&
V_NONE
(
&
missing_arg
[
i
]);
V_VT
(
&
rgvarg
[
i
])
=
rgvt
[
i
];
}
V_VT
(
&
rgvarg
[
i
])
=
rgvt
[
i
];
}
else
if
(
rgvt
[
i
]
==
(
VT_VARIANT
|
VT_ARRAY
)
&&
func_desc
->
cParamsOpt
<
0
&&
i
==
func_desc
->
cParams
-
1
)
{
SAFEARRAY
*
a
;
SAFEARRAYBOUND
bound
;
VARIANT
*
v
;
LONG
j
;
bound
.
lLbound
=
0
;
bound
.
cElements
=
pDispParams
->
cArgs
-
i
;
if
(
!
(
a
=
SafeArrayCreate
(
VT_VARIANT
,
1
,
&
bound
)))
else
if
((
rgvt
[
i
]
&
VT_BYREF
)
&&
(
rgvt
[
i
]
==
V_VT
(
src_arg
)))
{
ERR
(
"SafeArrayCreate failed
\n
"
);
break
;
V_BYREF
(
&
rgvarg
[
i
])
=
V_BYREF
(
src_arg
);
V_VT
(
&
rgvarg
[
i
])
=
rgvt
[
i
]
;
}
hres
=
SafeArrayAccessData
(
a
,
(
LPVOID
)
&
v
);
if
(
hres
!=
S_OK
)
else
{
ERR
(
"SafeArrayAccessData failed with %x
\n
"
,
hres
);
break
;
/* FIXME: this doesn't work for VT_BYREF arguments if
* they are not the same type as in the paramdesc */
V_VT
(
&
rgvarg
[
i
])
=
V_VT
(
src_arg
);
hres
=
VariantChangeType
(
&
rgvarg
[
i
],
src_arg
,
0
,
rgvt
[
i
]);
V_VT
(
&
rgvarg
[
i
])
=
rgvt
[
i
];
}
for
(
j
=
0
;
j
<
bound
.
cElements
;
j
++
)
VariantCopy
(
&
v
[
j
],
&
pDispParams
->
rgvarg
[
pDispParams
->
cArgs
-
1
-
i
-
j
]);
hres
=
SafeArrayUnaccessData
(
a
);
if
(
hres
!=
S_OK
)
if
(
FAILED
(
hres
))
{
ERR
(
"SafeArrayUnaccessData failed with %x
\n
"
,
hres
);
ERR
(
"failed to convert param %d to %s%s from %s%s
\n
"
,
i
,
debugstr_vt
(
rgvt
[
i
]),
debugstr_vf
(
rgvt
[
i
]),
debugstr_VT
(
src_arg
),
debugstr_VF
(
src_arg
));
break
;
}
V_ARRAY
(
&
rgvarg
[
i
])
=
a
;
V_VT
(
&
rgvarg
[
i
])
=
rgvt
[
i
];
}
else
if
((
rgvt
[
i
]
&
VT_BYREF
)
&&
!
V_ISBYREF
(
src_arg
))
{
VARIANTARG
*
missing_arg
=
INVBUF_GET_MISSING_ARG_ARRAY
(
buffer
,
func_desc
->
cParams
);
if
(
wParamFlags
&
PARAMFLAG_FIN
)
hres
=
VariantChangeType
(
&
missing_arg
[
i
],
src_arg
,
0
,
rgvt
[
i
]
&
~
VT_BYREF
);
else
V_VT
(
&
missing_arg
[
i
])
=
rgvt
[
i
]
&
~
VT_BYREF
;
V_BYREF
(
&
rgvarg
[
i
])
=
&
V_NONE
(
&
missing_arg
[
i
]);
V_VT
(
&
rgvarg
[
i
])
=
rgvt
[
i
];
}
else
if
((
rgvt
[
i
]
&
VT_BYREF
)
&&
(
rgvt
[
i
]
==
V_VT
(
src_arg
)))
{
V_BYREF
(
&
rgvarg
[
i
])
=
V_BYREF
(
src_arg
);
V_VT
(
&
rgvarg
[
i
])
=
rgvt
[
i
];
prgpvarg
[
i
]
=
&
rgvarg
[
i
];
}
else
{
/* FIXME: this doesn't work for VT_BYREF arguments if
* they are not the same type as in the paramdesc */
V_VT
(
&
rgvarg
[
i
])
=
V_VT
(
src_arg
);
hres
=
VariantChangeType
(
&
rgvarg
[
i
],
src_arg
,
0
,
rgvt
[
i
]);
V_VT
(
&
rgvarg
[
i
])
=
rgvt
[
i
];
}
if
(
FAILED
(
hres
))
{
ERR
(
"failed to convert param %d to %s%s from %s%s
\n
"
,
i
,
debugstr_vt
(
rgvt
[
i
]),
debugstr_vf
(
rgvt
[
i
]),
debugstr_VT
(
src_arg
),
debugstr_VF
(
src_arg
));
break
;
prgpvarg
[
i
]
=
src_arg
;
}
prgpvarg
[
i
]
=
&
rgvarg
[
i
];
}
else
if
(
wParamFlags
&
PARAMFLAG_FOPT
)
{
...
...
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