Hi,
Thanks for your input,
I have added it as a Bug,
https://bugzilla.novell.com/show_bug.cgi?id=463843
On Tue, 2009-01-06 at 10:06 -0500, Bill Holmes wrote:
> Tom,
>
> I agree with Kornél. Please add mono_init_com_types to
> GetIUnknownForObjectInternal and GetIDispatchForObjectInternal. I do
> not understand why it would be needed in QueryInterfaceInternal. Even
> if the object is managed, cominterop_ccw_queryinterface would need the
> mono_init_com_types call, but that should have been called from
> GetIUnknownForObjectInternal (when you add it.)
>
> Another way to put it is, what are you calling QueryInterface on that
> needs the types initialized from mono_init_com_types?
yep I understand, I'm only passing objects to QueryInterfaceInternal
that have been retrieved by calling Get???ForObjectInternal, and so
adding it to QueryInterfaceInternal isn't necessary.
>
> -bill
Attached is the patch which adds mono_init_com_types to suggested
functions.
Thanks,
Tom
Index: mono/metadata/marshal.c
===================================================================
--- mono/metadata/marshal.c (revision 121548)
+++ mono/metadata/marshal.c (working copy)
@@ -10733,6 +10733,8 @@
if (!object)
return NULL;
+ mono_init_com_types ();
+
if (cominterop_object_is_rcw (object)) {
MonoClass *klass = NULL;
MonoRealProxy* real_proxy = NULL;
@@ -10793,6 +10795,8 @@
ves_icall_System_Runtime_InteropServices_Marshal_GetIDispatchForObjectInternal (MonoObject* object)
{
#ifndef DISABLE_COM
+ mono_init_com_types ();
+
return cominterop_get_idispatch_for_object (object);
#else
g_assert_not_reached ();
_______________________________________________
Mono-devel-list mailing list
[email protected]
http://lists.ximian.com/mailman/listinfo/mono-devel-list