Another typelib fix

Huw D M Davies h.davies1 at physics.ox.ac.uk
Tue Oct 2 08:48:47 CDT 2001


	Huw D M Davies <hdavies at codeweavers.com>
	Long nameless args in SLTG apparently get denoted by 0xfffe.
-------------- next part --------------
Index: dlls/oleaut32/typelib.c
===================================================================
RCS file: /home/wine/wine/dlls/oleaut32/typelib.c,v
retrieving revision 1.47
diff -u -r1.47 typelib.c
--- dlls/oleaut32/typelib.c	2001/09/26 23:05:35	1.47
+++ dlls/oleaut32/typelib.c	2001/10/02 12:29:09
@@ -2480,20 +2480,29 @@
 
 	for(param = 0; param < (*ppFuncDesc)->funcdesc.cParams; param++) {
 	    char *paramName = pNameTable + *pArg;
-	    /* right, if the arg type follows then paramName points to the 2nd
-	       letter of the name (or there is no name), else if the next
-	       WORD is an offset to the arg type then paramName points to the
-	       first letter. So let's take one char off paramName and if we're
-	       pointing at an alpha-numeric char.  Got that? */
+	    BOOL HaveOffs;
+	    /* If arg type follows then paramName points to the 2nd
+	       letter of the name, else the next WORD is an offset to
+	       the arg type and paramName points to the first letter.
+	       So let's take one char off paramName and see if we're
+	       pointing at an alpha-numeric char.  However if *pArg is
+	       0xffff or 0xfffe then the param has no name, the former
+	       meaning that the next WORD is the type, the latter
+	       meaning the the next WORD is an offset to the type. */
 
-	    if(*pArg == 0xffff) /* If we don't have a name the type seems to
-				   always follow.  FIXME is this correct? */
-	      paramName = NULL;
+	    HaveOffs = FALSE;
+	    if(*pArg == 0xffff)
+	        paramName = NULL;
+	    else if(*pArg == 0xfffe) {
+	        paramName = NULL;
+		HaveOffs = TRUE;
+	    }
+	    else if(!isalnum(*(paramName-1)))
+	        HaveOffs = TRUE;
 
 	    pArg++;
 
-	    if(paramName && !isalnum(*(paramName-1))) { /* the next word is an
-							   offset to type */
+	    if(HaveOffs) { /* the next word is an offset to type */
 	        pType = (WORD*)(pFirstItem + *pArg);
 		SLTG_DoType(pType, pFirstItem,
 			    &(*ppFuncDesc)->funcdesc.lprgelemdescParam[param]);


More information about the wine-patches mailing list