[Mono-dev] COM Interop - Lazy Initialization Patch

Jon Chambers joncham at gmail.com
Mon Jan 15 13:58:27 EST 2007


Paolo,
     I removed the additional wrappers. For COM Interop methods, there will
either be two or three generated wrappers. For managed code calling an
unmanaged COM object there will be 3.

MONO_WRAPPER_COMINTEROP_INVOKE: This transitions the call made on the
TransparentProxy to the underlying __ComObject.
MONO_WRAPPER_COMINTEROP: This transitions the call made on the _ComObject to
the correct unmanaged signature just to remove the need for special case
logic in the current pinvoke marshalling code.
MONO_WRAPPER_MANAGED_TO_NATIVE: This marshals the arguments and makes the
call on the unmanaged function pointer.

For unmanaged code calling back into managed code there will be 2 wrapper
methods.

MONO_WRAPPER_NATIVE_TO_MANAGED: This marshals the arguments and makes the
call on the signature identical wrapper method.
MONO_WRAPPER_COMINTEROP: This transitions the call to the correct managed
signature and makes the all on the managed object.

So, right now I have two wrapper types to support COM Interop. If you think
one of the other wrapper types is appropriate to use for the
MONO_WRAPPER_COMINTEROP_INVOKE, let me know and I will use it.

Thanks,
Jonathan

On 1/15/07, Paolo Molaro <lupus at ximian.com> wrote:
>
> On 01/12/07 Jon Chambers wrote:
> >     This patch doesn't initialize COM types in the runtime until they
> are
> > needed, and also renames the COM wrapper methods to something more
> > understandable. I'll work on supporting the DISABLE_COM flag in the near
> > future.
>
> Do you really need all that many different wrapper type names?
> A diffrent wrapper type must be used only if needed for some
> semantic reason (like, it will be actually checked later at runtime
> for some reason). They are a scarce resource and we can't have more than
> 32 (we have been adding them too happily in the past and also some of
> the existing ones will go away).
> So, unless there is a really strong reason, do not add to the types
> (and if possible use a single type for it if one of the existing ones is
> not appropriate already).
>
> lupus
>
> --
> -----------------------------------------------------------------
> lupus at debian.org                                     debian/rules
> lupus at ximian.com                             Monkeys do it better
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20070115/01d8fd29/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: com_init.diff
Type: text/x-patch
Size: 8374 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20070115/01d8fd29/attachment.bin 


More information about the Mono-devel-list mailing list