Commit 144b0d15 authored by Marcus Meissner's avatar Marcus Meissner Committed by Alexandre Julliard

Handle VT_I2 <-> VT_USERDEFINED/TKIND_ENUM conversions too.

parent 1840e189
...@@ -4232,12 +4232,18 @@ _copy_arg( ITypeInfo2 *tinfo, TYPEDESC *tdesc, ...@@ -4232,12 +4232,18 @@ _copy_arg( ITypeInfo2 *tinfo, TYPEDESC *tdesc,
ITypeInfo_GetTypeAttr(tinfo2,&tattr); ITypeInfo_GetTypeAttr(tinfo2,&tattr);
switch (tattr->typekind) { switch (tattr->typekind) {
case TKIND_ENUM: case TKIND_ENUM:
if (V_VT(arg) == VT_I4) { switch ( V_VT( arg ) ) {
memcpy(argpos, &V_UNION(arg,iVal), 4); case VT_I2:
return S_OK; *argpos = V_UNION(arg,iVal);
} return S_OK;
FIXME("vt 0x%x -> TKIND_ENUM unhandled.\n",V_VT(arg)); case VT_I4:
break; memcpy(argpos, &V_UNION(arg,lVal), 4);
return S_OK;
default:
FIXME("vt 0x%x -> TKIND_ENUM unhandled.\n",V_VT(arg));
break;
}
case TKIND_ALIAS: case TKIND_ALIAS:
tdesc = &(tattr->tdescAlias); tdesc = &(tattr->tdescAlias);
hres = _copy_arg((ITypeInfo2*)tinfo2, tdesc, argpos, arg, tdesc->vt); hres = _copy_arg((ITypeInfo2*)tinfo2, tdesc, argpos, arg, tdesc->vt);
...@@ -4432,6 +4438,9 @@ static HRESULT WINAPI ITypeInfo_fnInvoke( ...@@ -4432,6 +4438,9 @@ static HRESULT WINAPI ITypeInfo_fnInvoke(
for (i=0;i<pFDesc->funcdesc.cParams-pDispParams->cArgs;i++) { for (i=0;i<pFDesc->funcdesc.cParams-pDispParams->cArgs;i++) {
int arglen = _argsize(pFDesc->funcdesc.lprgelemdescParam[i].tdesc.vt); int arglen = _argsize(pFDesc->funcdesc.lprgelemdescParam[i].tdesc.vt);
TYPEDESC *tdesc = &(pFDesc->funcdesc.lprgelemdescParam[i+pDispParams->cArgs].tdesc); TYPEDESC *tdesc = &(pFDesc->funcdesc.lprgelemdescParam[i+pDispParams->cArgs].tdesc);
TYPEDESC i4_tdesc;
i4_tdesc.vt = VT_I4;
/* If we are a pointer to a variant, we are done already */ /* If we are a pointer to a variant, we are done already */
if ((tdesc->vt==VT_PTR)&&(tdesc->u.lptdesc->vt==VT_VARIANT)) if ((tdesc->vt==VT_PTR)&&(tdesc->u.lptdesc->vt==VT_VARIANT))
continue; continue;
...@@ -4453,7 +4462,8 @@ static HRESULT WINAPI ITypeInfo_fnInvoke( ...@@ -4453,7 +4462,8 @@ static HRESULT WINAPI ITypeInfo_fnInvoke(
ITypeInfo_GetTypeAttr(tinfo2,&tattr); ITypeInfo_GetTypeAttr(tinfo2,&tattr);
switch (tattr->typekind) { switch (tattr->typekind) {
case TKIND_ENUM: case TKIND_ENUM:
FIXME("TKIND_ENUM unhandled.\n"); /* force the return type to be VT_I4 */
tdesc = &i4_tdesc;
break; break;
case TKIND_ALIAS: case TKIND_ALIAS:
TRACE("TKIND_ALIAS to vt 0x%x\n",tattr->tdescAlias.vt); TRACE("TKIND_ALIAS to vt 0x%x\n",tattr->tdescAlias.vt);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment