PATCH: typelib

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

Changelog:
	Handle VT_I2 <-> VT_USERDEFINED/TKIND_ENUM conversions too.

Index: dlls/oleaut32/typelib.c
===================================================================
RCS file: /home/wine/wine/dlls/oleaut32/typelib.c,v
retrieving revision 1.95
diff -u -r1.95 typelib.c
--- dlls/oleaut32/typelib.c	13 May 2003 22:15:26 -0000	1.95
+++ dlls/oleaut32/typelib.c	15 May 2003 18:15:11 -0000
@@ -4232,12 +4232,18 @@
 	ITypeInfo_GetTypeAttr(tinfo2,&tattr);
 	switch (tattr->typekind) {
 	case TKIND_ENUM:
-	    if (V_VT(arg) == VT_I4) {
-		memcpy(argpos, &V_UNION(arg,iVal), 4);
-		return S_OK;
-	    }
-	    FIXME("vt 0x%x -> TKIND_ENUM unhandled.\n",V_VT(arg));
-	    break;
+          switch ( V_VT( arg ) ) {
+          case VT_I2:
+             *argpos = V_UNION(arg,iVal);
+             return S_OK;
+          case VT_I4:
+             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:
 	    tdesc = &(tattr->tdescAlias);
 	    hres = _copy_arg((ITypeInfo2*)tinfo2, tdesc, argpos, arg, tdesc->vt);
@@ -4432,6 +4438,9 @@
 		for (i=0;i<pFDesc->funcdesc.cParams-pDispParams->cArgs;i++) {
 		    int arglen = _argsize(pFDesc->funcdesc.lprgelemdescParam[i].tdesc.vt);
 		    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 ((tdesc->vt==VT_PTR)&&(tdesc->u.lptdesc->vt==VT_VARIANT))
 			continue;
@@ -4453,7 +4462,8 @@
 			ITypeInfo_GetTypeAttr(tinfo2,&tattr);
 			switch (tattr->typekind) {
 			case TKIND_ENUM:
-			    FIXME("TKIND_ENUM unhandled.\n");
+                           /* force the return type to be VT_I4 */
+                           tdesc = &i4_tdesc;
 			    break;
 			case TKIND_ALIAS:
 			    TRACE("TKIND_ALIAS to vt 0x%x\n",tattr->tdescAlias.vt);


[Index of Archives]     [Gimp for Windows]     [Red Hat]     [Samba]     [Yosemite Camping]     [Graphics Cards]     [Wine Home]

  Powered by Linux