Hi,

The attached patches should only apply to COM interop.

They fix some inconsistencies that we found in mono dealing with
VARIANTs.  When an IUnknown (or IDispatch) object is passed as a
VARIANT to native code the vt field was different with mono.

There is not great documentation for this but what I was able to pull
together was the following.
When a native object is wrapped with a VARIANT a QI is performed to
determine if IDispatch is supported.  If so then VT_DISPATCH is the
value of vt otherwise VT_UNKNOWN.
Managed object are the same, but it is the question of when a managed
object supports Dispatch that is the tricky part.  From what I have
read and what I have observed a public object with the ComVisible
attribute set to true support IDispatch.  All others only support
IUnknown.

-bill


For CCW_Dispatch.diff
2008-12-09  Bill Holmes  <[EMAIL PROTECTED]>

        * object-internals.h : Adding a definition for
          MonoReflectionComVisibleAttribute.

        * marshal.c (cominterop_com_visible) :  Method added to check the
          ComVisible attribute of a class.

        * marshal.c (cominterop_raise_hr_exception, cominterop_get_interface) :
          cominterop_raise_hr_exception added to consolidate common code
          to raise hr exceptions.

        * marshal.c (cominterop_can_support_dispatch) :  Method added
to determine
          if a managed class should support IDispatch.

        * marshal.c
          (cominterop_get_idispatch_for_objec, cominterop_ccw_queryinterfacet) :
          Added additional checks for managed object when getting
          an IDispatch interface.

        Code is contributed under MIT/X11 license.


For VARIANT.diff
2008-12-09  Bill Holmes  <[EMAIL PROTECTED]>

        * Variant.cs (SetValue):   Changing the behavior for COM object in
          VARIANTs to match MS.  Also adding support for BStrWrapper,
          UnknownWrapper, and DispatchWrapper.

        Contributed under MIT/X11 license.

Attachment: CCW_Dispatch.diff
Description: Binary data

Attachment: VARIANT.diff
Description: Binary data

_______________________________________________
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list

Reply via email to