I would like to know if the attached patch (which prevents DBGRID32.OCX from crashing, as well as adding additional debugging information when a reference is not found) would step on anybody's toes (especially Robert Shearman, since he is sending several oleaut32 patches himself). As of 2005-12-01 CVS, any VisualBasic application that tries to use DBGRID32.OCX will systematically crash unless the patch is applied. However, since Robert Shearman is sending oleaut32 fixes, I think he might implement some functionality that will, as a side effect, fix the DBGRID32.OCX bug.

Alex Villacís Lasso

--- wine-0.9.2-cvs/dlls/oleaut32/typelib.c	2005-12-01 10:15:14.000000000 -0500
+++ wine-0.9.2-cvs-patch/dlls/oleaut32/typelib.c	2005-12-02 11:48:11.000000000 -0500
@@ -5520,9 +5520,18 @@
     ITypeInfoImpl *This = (ITypeInfoImpl *)iface;
     HRESULT result = E_FAIL;
 
-    if (hRefType == -1 &&
-	(((ITypeInfoImpl*) This)->TypeAttr.typekind   == TKIND_DISPATCH) &&
-	(((ITypeInfoImpl*) This)->TypeAttr.wTypeFlags &  TYPEFLAG_FDUAL))
+    if (
+        (
+            hRefType == -1 &&
+            (This->TypeAttr.typekind   == TKIND_DISPATCH) &&
+            (This->TypeAttr.wTypeFlags &  TYPEFLAG_FDUAL)
+        )
+        ||
+        (
+            (This->TypeAttr.typekind   == TKIND_DISPATCH) &&
+            (This->TypeAttr.wTypeFlags &  TYPEFLAG_FDISPATCHABLE)
+	    )
+       )
     {
 	  /* when we meet a DUAL dispinterface, we must create the interface
 	  * version of it.
@@ -5551,8 +5560,47 @@
 	    if(pRefType->reference == hRefType)
 	        break;
 	}
-	if(!pRefType)
-	  FIXME("Can't find pRefType for ref %lx\n", hRefType);
+	if(!pRefType) {
+        static const char * descTKIND[TKIND_MAX] = {
+            "TKIND_ENUM",
+            "TKIND_RECORD",
+            "TKIND_MODULE",
+            "TKIND_INTERFACE",
+            "TKIND_DISPATCH",
+            "TKIND_COCLASS",
+            "TKIND_ALIAS",
+            "TKIND_UNION",            
+        };
+        static const char * descTypeFlags[15] = {
+            "TYPEFLAG_FAPPOBJECT",
+            "TYPEFLAG_FCANCREATE",
+            "TYPEFLAG_FLICENSED",
+            "TYPEFLAG_FPREDECLID",
+            "TYPEFLAG_FHIDDEN",
+            "TYPEFLAG_FCONTROL",
+            "TYPEFLAG_FDUAL",
+            "TYPEFLAG_FNONEXTENSIBLE",
+            "TYPEFLAG_FOLEAUTOMATION",
+            "TYPEFLAG_FRESTRICTED",
+            "TYPEFLAG_FAGGREGATABLE",
+            "TYPEFLAG_FREPLACEABLE",
+            "TYPEFLAG_FDISPATCHABLE",
+            "TYPEFLAG_FREVERSEBIND",
+            "TYPEFLAG_FPROXY",
+        };
+        int i;
+        
+        FIXME("Can't find pRefType for ref %lx\n", hRefType);
+        FIXME("\ttypekind is %s\n", descTKIND[This->TypeAttr.typekind]);
+        FIXME("\twTypeFlags are:");
+        for (i = 0; i < 15; i++) {
+            if (This->TypeAttr.wTypeFlags & (1 << i))
+                FIXME(" %s", descTypeFlags[i]);
+        }
+        if (This->TypeAttr.wTypeFlags & 0xFFFF8000)
+            FIXME(" %08x", This->TypeAttr.wTypeFlags & 0xFFFF8000);
+        FIXME("\n");
+	}
 	if(pRefType && hRefType != -1) {
             ITypeLib *pTLib = NULL;
 


Reply via email to