mono_image_build_metadata (mb);
}
+static gboolean
+get_caller (MonoMethod *m, gint32 no, gint32 ilo, gboolean managed, gpointer data)
+{
+ MonoMethod **dest = data;
+
+ /* skip unmanaged frames */
+ if (!managed)
+ return FALSE;
+
+ if (m == *dest) {
+ *dest = NULL;
+ return FALSE;
+ }
+ if (!(*dest)) {
+ *dest = m;
+ return TRUE;
+ }
+ return FALSE;
+}
+
static MonoReflectionType *
type_from_name (const char *str, MonoBoolean ignoreCase)
{
if (info.assembly.name) {
assembly = mono_assembly_load (&info.assembly, NULL, NULL);
} else {
- MonoReflectionAssembly *refass;
+ MonoMethod *m = mono_method_get_last_managed ();
+ MonoMethod *dest = m;
- refass = ves_icall_System_Reflection_Assembly_GetCallingAssembly ();
- assembly = refass->assembly;
+ mono_stack_walk_no_il (get_caller, &dest);
+ if (!dest)
+ dest = m;
+
+ /*
+ * FIXME: mono_method_get_last_managed() sometimes returns NULL, thus
+ * causing ves_icall_System_Reflection_Assembly_GetCallingAssembly()
+ * to crash. This only seems to happen in some strange remoting
+ * scenarios and I was unable to figure out what's happening there.
+ * Dec 10, 2005 - Martin.
+ */
+
+ if (dest)
+ assembly = dest->klass->image->assembly;
+ else {
+ g_warning (G_STRLOC);
+ }
}
if (assembly)
compare_func = (ignore_case) ? g_strcasecmp : strcmp;
}
+ mono_class_setup_vtable (klass);
+
if (klass->vtable_size >= sizeof (method_slots_default) * 8) {
method_slots = g_new0 (guint32, klass->vtable_size / 32 + 1);
} else {
gchar *str;
MonoType *type = NULL;
MonoTypeNameParse info;
- gboolean type_resolve = FALSE;
+ gboolean type_resolve;
MONO_ARCH_SAVE_REGS;
+ /* On MS.NET, this does not fire a TypeResolve event */
+ type_resolve = TRUE;
str = mono_string_to_utf8 (name);
/*g_print ("requested type %s in %s\n", str, assembly->assembly->aname.name);*/
if (!mono_reflection_parse_type (str, &info)) {
}
-static gboolean
-get_caller (MonoMethod *m, gint32 no, gint32 ilo, gboolean managed, gpointer data)
-{
- MonoMethod **dest = data;
-
- /* skip unmanaged frames */
- if (!managed)
- return FALSE;
-
- if (m == *dest) {
- *dest = NULL;
- return FALSE;
- }
- if (!(*dest)) {
- *dest = m;
- return TRUE;
- }
- return FALSE;
-}
-
static MonoReflectionAssembly*
ves_icall_System_Reflection_Assembly_GetEntryAssembly (void)
{
return mono_assembly_get_object (domain, domain->entry_assembly);
}
-
static MonoReflectionAssembly*
ves_icall_System_Reflection_Assembly_GetCallingAssembly (void)
{
if (!name)
return NULL;
+ if (full_name && (object->type->type == MONO_TYPE_VAR || object->type->type == MONO_TYPE_MVAR))
+ return NULL;
+
res = mono_string_new (domain, name);
g_free (name);
static const IcallEntry mutex_icalls [] = {
{"CreateMutex_internal(bool,string,bool&)", ves_icall_System_Threading_Mutex_CreateMutex_internal},
+ {"OpenMutex_internal(string,System.Security.AccessControl.MutexRights,System.IO.MonoIOError&)", ves_icall_System_Threading_Mutex_OpenMutex_internal},
{"ReleaseMutex_internal(intptr)", ves_icall_System_Threading_Mutex_ReleaseMutex_internal}
};
static const IcallEntry semaphore_icalls [] = {
{"CreateSemaphore_internal(int,int,string,bool&)", ves_icall_System_Threading_Semaphore_CreateSemaphore_internal},
+ {"OpenSemaphore_internal(string,System.Security.AccessControl.SemaphoreRights,System.IO.MonoIOError&)", ves_icall_System_Threading_Semaphore_OpenSemaphore_internal},
{"ReleaseSemaphore_internal(intptr,int,bool&)", ves_icall_System_Threading_Semaphore_ReleaseSemaphore_internal}
};
static const IcallEntry nativeevents_icalls [] = {
{"CloseEvent_internal", ves_icall_System_Threading_Events_CloseEvent_internal},
- {"CreateEvent_internal", ves_icall_System_Threading_Events_CreateEvent_internal},
+ {"CreateEvent_internal(bool,bool,string,bool&)", ves_icall_System_Threading_Events_CreateEvent_internal},
+ {"OpenEvent_internal(string,System.Security.AccessControl.EventWaitHandleRights,System.IO.MonoIOError&)", ves_icall_System_Threading_Events_OpenEvent_internal},
{"ResetEvent_internal", ves_icall_System_Threading_Events_ResetEvent_internal},
{"SetEvent_internal", ves_icall_System_Threading_Events_SetEvent_internal}
};