PAtCH: VT_USERDEFINED fix

Marcus Meissner marcus at jet.franken.de
Thu Dec 12 12:58:43 CST 2002


Hi,

I was mistaking TKIND_ for VT_ and so made things a bit worse in the
VT_USERDEFINED case. This fixes it and makes the Excel Agent starter
feel a bit better (aka not crash Excel).

Ciao, Marcus

Changelog:
	Reverted last VT_USERDEFINED patch (was broken).
	Marshal TKIND_DISPATCH interfaces just like TKIND_INTERFACE.

Index: tmarshal.c
===================================================================
RCS file: /home/wine/wine/dlls/oleaut32/tmarshal.c,v
retrieving revision 1.12
diff -u -u -r1.12 tmarshal.c
--- tmarshal.c	12 Dec 2002 02:15:46 -0000	1.12
+++ tmarshal.c	12 Dec 2002 18:57:29 -0000
@@ -508,6 +508,7 @@
 	}
 	ITypeInfo_GetTypeAttr(tinfo2,&tattr);
 	switch (tattr->typekind) {
+	case TKIND_DISPATCH:
 	case TKIND_INTERFACE:
 	    if (writeit)
 	       hres=_marshal_interface(buf,&(tattr->guid),(LPUNKNOWN)arg);
@@ -556,25 +557,11 @@
 	    if (debugout) MESSAGE("}");
 	    break;
 	}
-	default: {
-	    TYPEDESC tdesc2;
-
-	    if (debugout) MESSAGE("U{");
-	    memset(&tdesc2,0,sizeof(tdesc2));
-	    tdesc2.vt = tattr->typekind;
-	    hres = serialize_param(
-			tinfo2,
-			writeit,
-			debugout,
-			dealloc,
-			&tdesc2,
-			arg,
-			buf
-	    );
-	    if (debugout) MESSAGE("}");
+	default:
+	    FIXME("Unhandled typekind %d\n",tattr->typekind);
+	    hres = E_FAIL;
 	    break;
 	}
-	}
 	ITypeInfo_Release(tinfo2);
 	return hres;
     }
@@ -878,6 +865,7 @@
 		if (alloc)
 		    *arg = (DWORD)HeapAlloc(GetProcessHeap(),0,tattr->cbSizeInstance);
 		switch (tattr->typekind) {
+		case TKIND_DISPATCH:
 		case TKIND_INTERFACE:
 		    if (readit)
 			hres = _unmarshal_interface(buf,&(tattr->guid),(LPUNKNOWN*)arg);
@@ -910,24 +898,10 @@
 		    if (debugout) MESSAGE("}");
 		    break;
 		}
-		default: {
-		    TYPEDESC tdesc2;
-
-		    if (debugout) MESSAGE("U{");
-		    memset(&tdesc2,0,sizeof(tdesc2));
-		    tdesc2.vt = tattr->typekind;
-		    hres = deserialize_param(
-				tinfo2,
-				readit,
-				debugout,
-				alloc,
-				&tdesc2,
-				(DWORD*)*arg,
-				buf
-		    );
-		    if (debugout) MESSAGE("}");
+		default:
+		    ERR("Unhandled typekind %d\n",tattr->typekind);
+		    hres = E_FAIL;
 		    break;
-		}
 		}
 	    }
 	    if (hres)



More information about the wine-patches mailing list