Module: wine
Branch: refs/heads/master
Commit: 30a9f99bb95707c68c9247cbfafd1d4a878b0f71
URL: http://source.winehq.org/git/?p=wine.git;a=commit;h=30a9f99bb95707c68c9247c…
Author: Robert Shearman <rob(a)codeweavers.com>
Date: Mon Dec 26 13:06:29 2005 +0100
widl: Better array support.
Treat variables with array indices the same as pointers when writing
out the proc & type format strings.
Fix a typo when writing out the proc format string where a non-return
type was written out for a return type and vice-versa.
---
tools/widl/typegen.c | 11 ++++++-----
1 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/tools/widl/typegen.c b/tools/widl/typegen.c
index 1e6581a..5724d96 100644
--- a/tools/widl/typegen.c
+++ b/tools/widl/typegen.c
@@ -59,7 +59,7 @@ static int print_file(FILE *file, int in
static size_t write_procformatstring_var(FILE *file, int indent, var_t *var, int is_return, unsigned int *type_offset)
{
size_t size;
- if (var->ptr_level == 0)
+ if (var->ptr_level == 0 && !var->array)
{
if (is_return)
print_file(file, indent, "0x53, /* FC_RETURN_PARAM_BASETYPE */\n");
@@ -97,9 +97,9 @@ static size_t write_procformatstring_var
else
{
if (is_return)
- print_file(file, indent, "0x4d, /* FC_IN_PARAM */\n");
- else
print_file(file, indent, "0x52, /* FC_RETURN_PARAM */\n");
+ else
+ print_file(file, indent, "0x4d, /* FC_IN_PARAM */\n");
print_file(file, indent, "0x01,\n");
print_file(file, indent, "NdrFcShort(0x%x),\n", *type_offset);
size = 4; /* includes param type prefix */
@@ -164,10 +164,11 @@ static size_t write_typeformatstring_var
int ptr_level = var->ptr_level;
/* basic types don't need a type format string */
- if (ptr_level == 0)
+ if (ptr_level == 0 && !var->array)
return 0;
- if (ptr_level == 1)
+ if (ptr_level == 1 ||
+ (var->ptr_level == 0 && var->array && !NEXT_LINK(var->array)))
{
switch (var->type->type)
{
Module: wine
Branch: refs/heads/master
Commit: e6fa361967ce788cd9fea6a38a92ec4b9d7e517a
URL: http://source.winehq.org/git/?p=wine.git;a=commit;h=e6fa361967ce788cd9fea6a…
Author: Robert Shearman <rob(a)codeweavers.com>
Date: Mon Dec 26 13:04:31 2005 +0100
oleaut: Small re-organisation of ITypeInfo::Invoke.
Only output the one function in the trace for ITypeInfo::Invoke.
Process the return value on output in ITypeInfo::Invoke, but only copy
it to pVarResult if pVarResult is not NULL.
---
dlls/oleaut32/typelib.c | 68 +++++++++++++++++++++++++----------------------
1 files changed, 36 insertions(+), 32 deletions(-)
diff --git a/dlls/oleaut32/typelib.c b/dlls/oleaut32/typelib.c
index 1c56c46..a3e9e86 100644
--- a/dlls/oleaut32/typelib.c
+++ b/dlls/oleaut32/typelib.c
@@ -5320,7 +5320,7 @@ static HRESULT WINAPI ITypeInfo_fnInvoke
if (TRACE_ON(ole))
{
TRACE("invoking:\n");
- dump_TLBFuncDesc(pFuncInfo);
+ dump_TLBFuncDescOne(pFuncInfo);
}
switch (func_desc->funckind) {
@@ -5430,39 +5430,43 @@ static HRESULT WINAPI ITypeInfo_fnInvoke
args
);
- if (pVarResult) {
- for (i = 0; i < func_desc->cParams; i++) {
- USHORT wParamFlags = func_desc->lprgelemdescParam[i].u.paramdesc.wParamFlags;
- if (wParamFlags & PARAMFLAG_FRETVAL) {
- ELEMDESC *elemdesc = &func_desc->lprgelemdescParam[i];
- TYPEDESC *tdesc = &elemdesc->tdesc;
- VARIANTARG varresult;
- V_VT(&varresult) = 0;
- hres = typedescvt_to_variantvt((ITypeInfo *)iface, tdesc, &V_VT(&varresult));
- if (hres)
- break;
- /* FIXME: this is really messy - we should keep the
- * args in VARIANTARGs rather than a DWORD array */
- memcpy(&V_UI4(&varresult), &args[i+1], sizeof(DWORD));
- if (TRACE_ON(ole))
- {
- TRACE("varresult: ");
- dump_Variant(&varresult);
- }
- hres = VariantCopyInd(pVarResult, &varresult);
- /* free data stored in varresult. Note that
- * VariantClear doesn't do what we want because we are
- * working with byref types. */
- /* FIXME: clear safearrays, bstrs, records and
- * variants here too */
- if ((V_VT(&varresult) == (VT_UNKNOWN | VT_BYREF)) ||
- (V_VT(&varresult) == (VT_DISPATCH | VT_BYREF)))
- {
- if(*V_UNKNOWNREF(&varresult))
- IUnknown_Release(*V_UNKNOWNREF(&varresult));
- }
+ for (i = 0; i < func_desc->cParams; i++)
+ {
+ USHORT wParamFlags = func_desc->lprgelemdescParam[i].u.paramdesc.wParamFlags;
+ if (wParamFlags & PARAMFLAG_FRETVAL)
+ {
+ ELEMDESC *elemdesc = &func_desc->lprgelemdescParam[i];
+ TYPEDESC *tdesc = &elemdesc->tdesc;
+ VARIANTARG varresult;
+ V_VT(&varresult) = 0;
+ hres = typedescvt_to_variantvt((ITypeInfo *)iface, tdesc, &V_VT(&varresult));
+ if (hres)
break;
+ /* FIXME: this is really messy - we should keep the
+ * args in VARIANTARGs rather than a DWORD array */
+ memcpy(&V_UI4(&varresult), &args[i+1], sizeof(DWORD));
+ if (TRACE_ON(ole))
+ {
+ TRACE("varresult: ");
+ dump_Variant(&varresult);
+ }
+
+ if (pVarResult)
+ /* deref return value */
+ hres = VariantCopyInd(pVarResult, &varresult);
+
+ /* free data stored in varresult. Note that
+ * VariantClear doesn't do what we want because we are
+ * working with byref types. */
+ /* FIXME: clear safearrays, bstrs, records and
+ * variants here too */
+ if ((V_VT(&varresult) == (VT_UNKNOWN | VT_BYREF)) ||
+ (V_VT(&varresult) == (VT_DISPATCH | VT_BYREF)))
+ {
+ if(*V_UNKNOWNREF(&varresult))
+ IUnknown_Release(*V_UNKNOWNREF(&varresult));
}
+ break;
}
}