MonoDomain *domain = mono_domain_get ();
MonoClass *klass = mono_class_from_mono_type (handle);
- MONO_ARCH_SAVE_REGS;
-
mono_class_init (klass);
return mono_type_get_object (domain, handle);
}
static MonoClass* com_interop_proxy_class = NULL;
static MonoMethod* com_interop_proxy_get_proxy = NULL;
static MonoMethod* get_transparent_proxy = NULL;
- int real_proxy;
guint32 pos_null = 0, pos_ccw = 0, pos_end = 0;
MonoClass *klass = NULL;
get_transparent_proxy = mono_class_get_method_from_name (mono_defaults.real_proxy_class, "GetTransparentProxy", 0);
#endif
- real_proxy = mono_mb_add_local (mb, &com_interop_proxy_class->byval_arg);
+ mono_mb_add_local (mb, &com_interop_proxy_class->byval_arg);
mono_mb_emit_ldloc (mb, 0);
mono_mb_emit_byte (mb, CEE_LDIND_I);
MonoMethodSignature *sig;
MonoMethodBuilder *mb;
MonoMethod *res;
- int i, temp_obj;
+ int i;
GHashTable* cache = mono_marshal_get_cache (&method->klass->image->cominterop_invoke_cache, mono_aligned_addr_hash, NULL);
g_assert (method);
mb = mono_mb_new (method->klass, method->name, MONO_WRAPPER_COMINTEROP_INVOKE);
/* get real proxy object, which is a ComInteropProxy in this case*/
- temp_obj = mono_mb_add_local (mb, &mono_defaults.object_class->byval_arg);
+ mono_mb_add_local (mb, &mono_defaults.object_class->byval_arg);
mono_mb_emit_ldarg (mb, 0);
mono_mb_emit_ldflda (mb, MONO_STRUCT_OFFSET (MonoTransparentProxy, rp));
mono_mb_emit_byte (mb, CEE_LDIND_REF);
g_assert (type->type);
klass = mono_type_get_class (type->type);
g_assert (klass);
- if (!mono_class_init (klass))
- mono_raise_exception (mono_class_get_exception_for_failure (klass));
+ if (!mono_class_init (klass)) {
+ mono_set_pending_exception (mono_class_get_exception_for_failure (klass));
+ return NULL;
+ }
itf = cominterop_get_ccw (object, klass);
g_assert (itf);
guint32
ves_icall_System_Runtime_InteropServices_Marshal_GetComSlotForMethodInfoInternal (MonoReflectionMethod *m)
{
- MONO_ARCH_SAVE_REGS;
-
#ifndef DISABLE_COM
return cominterop_get_com_slot_for_method (m->method);
#else
MonoDomain *domain;
MonoObject *obj;
- MONO_ARCH_SAVE_REGS;
-
domain = mono_object_domain (type);
klass = mono_class_from_mono_type (type->type);
{
#ifndef DISABLE_COM
MonoClass *class = mono_type_get_class (type->type);
- if (!mono_class_init (class))
- mono_raise_exception (mono_class_get_exception_for_failure (class));
+ if (!mono_class_init (class)) {
+ mono_set_pending_exception (mono_class_get_exception_for_failure (class));
+ return NULL;
+ }
return cominterop_get_interface (obj, class, (gboolean)throw_exception);
#else
g_free (ccw_iter);
}
else
- ccw_list_item = g_list_next(ccw_list_item);
+ ccw_list_item = g_list_next (ccw_list_item);
}
/* if list is empty remove original address from hash */
if (g_list_length (ccw_list) == 0)
g_hash_table_remove (ccw_hash, GINT_TO_POINTER (mono_object_hash (object)));
-
+ else if (ccw_list != ccw_list_orig)
+ g_hash_table_insert (ccw_hash, GINT_TO_POINTER (mono_object_hash (object)), ccw_list);
return TRUE;
}
MonoString *
ves_icall_System_Runtime_InteropServices_Marshal_PtrToStringBSTR (gpointer ptr)
{
- MONO_ARCH_SAVE_REGS;
-
return mono_string_from_bstr(ptr);
}
gpointer
ves_icall_System_Runtime_InteropServices_Marshal_StringToBSTR (MonoString* ptr)
{
- MONO_ARCH_SAVE_REGS;
-
return mono_string_to_bstr(ptr);
}
void
ves_icall_System_Runtime_InteropServices_Marshal_FreeBSTR (gpointer ptr)
{
- MONO_ARCH_SAVE_REGS;
-
mono_free_bstr (ptr);
}