- Fix VT_BYREF|VT_UNKNOWN return values by comparing the correct value

with VT_UNKNOWN and VT_DISPATCH.
- Better tracing.
This commit is contained in:
Robert Shearman 2005-07-19 20:02:38 +00:00 committed by Alexandre Julliard
parent 5550636044
commit 8b8c901a78
1 changed files with 14 additions and 3 deletions

View File

@ -4719,12 +4719,12 @@ static HRESULT userdefined_to_variantvt(ITypeInfo *tinfo, TYPEDESC *tdesc, VARTY
case TKIND_RECORD:
FIXME("TKIND_RECORD unhandled.\n");
hr = E_NOTIMPL;
break;
break;
case TKIND_UNION:
FIXME("TKIND_RECORD unhandled.\n");
hr = E_NOTIMPL;
break;
break;
default:
FIXME("TKIND %d unhandled.\n",tattr->typekind);
@ -4759,7 +4759,9 @@ static HRESULT typedescvt_to_variantvt(ITypeInfo *tinfo, TYPEDESC *tdesc, VARTYP
tdesc_userdefined = tdesc->u.lptdesc;
}
hr = userdefined_to_variantvt(tinfo, tdesc_userdefined, &vt_userdefined);
if (!hr && ((vt_userdefined == VT_UNKNOWN) || (vt_userdefined == VT_DISPATCH)))
if ((hr == S_OK) &&
(((vt_userdefined & VT_TYPEMASK) == VT_UNKNOWN) ||
((vt_userdefined & VT_TYPEMASK) == VT_DISPATCH)))
{
*vt |= vt_userdefined;
return S_OK;
@ -4776,6 +4778,10 @@ static HRESULT typedescvt_to_variantvt(ITypeInfo *tinfo, TYPEDESC *tdesc, VARTYP
case VT_USERDEFINED:
hr = userdefined_to_variantvt(tinfo, tdesc, vt);
break;
case VT_PTR:
ERR("cannot convert VT_PTR into variant VT\n");
hr = E_FAIL;
break;
default:
*vt |= tdesc->vt;
break;
@ -4978,6 +4984,11 @@ static HRESULT WINAPI ITypeInfo_fnInvoke(
/* 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);
break;
}