Alex Villací­s Lasso wrote:

--- wine-20050830-cvs/dlls/oleaut32/typelib.c 2005-09-21 10:39:22.000000000 -0500 +++ wine-20050830-cvs-patch/dlls/oleaut32/typelib.c 2005-09-24 20:34:32.000000000 -0500
@@ -5207,9 +5207,11 @@
    ITypeInfoImpl *This = (ITypeInfoImpl *)iface;
    HRESULT result = E_FAIL;

-    if (hRefType == -1 &&
+    if ((hRefType == -1 &&
(((ITypeInfoImpl*) This)->TypeAttr.typekind == TKIND_DISPATCH) &&
-       (((ITypeInfoImpl*) This)->TypeAttr.wTypeFlags &  TYPEFLAG_FDUAL))
+ (((ITypeInfoImpl*) This)->TypeAttr.wTypeFlags & TYPEFLAG_FDUAL)) || + ((((ITypeInfoImpl*) This)->TypeAttr.typekind == TKIND_DISPATCH) && + (((ITypeInfoImpl*) This)->TypeAttr.wTypeFlags & TYPEFLAG_FDISPATCHABLE)))
    {
/* when we meet a DUAL dispinterface, we must create the interface
         * version of it.

This patch executes the "create interface" code when typekind == TKIND_DISPATCH and wTypeFlags has TYPEFLAG_FDISPATCHABLE, regardless of the value of hRefType, in addition to the previous condition. With this patch, the native oleaut32 requirement is removed. The typelib test still passes - not that it actually tests the change in code (more on this later).


This patch looks pretty good, but I can't see the difference between TKIND_DISPATCH and TYPEFLAG_FDISPATCHABLE on MSDN. They look like they mean the same thing. Have you seen a typelib with one and not the other? Also, you can remove all of the casts of This while you're changing that if statement because they are unnecessary.

UPDATE: The OleCreateDefaultHandler routine seems to be in error in returning the CLASS_E_NOAGGREGATION error in the DBGRID32.OCX case. If I read the comment
correctly (and *please* tell me so if I am not), the aggregation case
(pUnkOuter != NULL) is forbidden when riid is other than IID_IUnknown, and
therefore the test is reversed from what it should be:

--- wine-20050830-cvs/dlls/ole32/defaulthandler.c 2005-09-23 10:51:36.000000000 -0500 +++ wine-20050830-cvs-patch/dlls/ole32/defaulthandler.c 2005-09-25 19:19:31.000000000 -0500
@@ -1422,7 +1422,7 @@
   * This is necessary because it's the only time the non-delegating
   * IUnknown pointer can be returned to the outside.
   */
-  if (pUnkOuter && IsEqualIID(&IID_IUnknown, riid))
+  if (pUnkOuter && !IsEqualIID(&IID_IUnknown, riid))
    return CLASS_E_NOAGGREGATION;

  /*


This patch is obviously correct.


This patch allows the DBGrid test to move to the next error: the
DataCache_GetAdvise function crashes after the above patch is applied, because this->sinkInterface is NULL at the time of call, but it does not make any check
for it:

--- wine-20050830-cvs/dlls/ole32/datacache.c 2005-07-27 10:49:38.000000000 -0500 +++ wine-20050830-cvs-patch/dlls/ole32/datacache.c 2005-09-25 19:45:48.000000000 -0500
@@ -1390,9 +1390,11 @@

  if (ppAdvSink!=NULL)
  {
-    IAdviseSink_QueryInterface(this->sinkInterface,
+    if (this->sinkInterface != NULL)
+        IAdviseSink_QueryInterface(this->sinkInterface,
                   &IID_IAdviseSink,
                   (void**)ppAdvSink);
+    else *ppAdvSink = NULL;
  }

  return S_OK;

With the above two patches, the DBGrid test sheds all dependencies on native oleaut32 *and* ole32. In addition, the SIAP package is freed from the dependence on native ole32. I will try to investigate later the remaining dependency on
native oleaut32.


This patch is also correct.

Please send all of these patches to wine-patches.

--
Rob Shearman



Reply via email to