[Mono-dev] COM Interop - Object marshalling

Jon Chambers joncham at gmail.com
Thu Jul 27 23:16:20 EDT 2006


This patch should provide most of the remaining functionality of RCWs. This
allows methods/properties to have object parameters (i.e. MarshalAs
Interface, IUnknown, and IDispatch). It fixes a warning or two, and also
implements two more COM related methods in the Marshal class. Additional
tests were also added. I modified it so the previously disabled tests now
run only on windows. Theoretically, they should run on all x86/x86-64 OSes I
believe but I could not find an easy way to enable that.

What's left? I need to handle the LCIDConversionAttribute, support object
marshalling in variants, and handle connection point interfaces among other
things. I also need to work on the custom marshallers for enumerator
support.

Some highlights. There is a bunch of logic in __ComObject and
ComInteropProxy to ensure identity of RCWs. Equality checks should work
correctly for RCWs. Basically, a RCW is only created once for each COM
object, no matter how many times it is marshalled into managed code from
unmanaged code. There is a managed reference count of how many times this
occurs. Marshal.ReleaseComObject can then be called that many times before
the RCW releases all references to the unmanaged COM object and becomes
invalid. This matches MS behavior.

Thanks,
Jonathan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20060727/b84c43ed/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cominterop.diff
Type: text/x-patch
Size: 29738 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20060727/b84c43ed/attachment.bin 


More information about the Mono-devel-list mailing list