* test-9.il: New test, test instaniating a class
[mono.git] / mono / metadata / icall.c
index 3164ece18506b9e04778e75036105752f152c4ff..594b1bbddb366cc5ae0f0e5cfb525a24d7681a79 100644 (file)
@@ -816,24 +816,6 @@ ves_icall_type_from_name (MonoString *name,
        if (!info.assembly.name && !type) /* try mscorlib */
                type = mono_reflection_get_type (NULL, &info, ignoreCase);
 
-       if (!type) {
-               MonoReflectionAssembly *assembly;
-               char *fullName;
-
-               if (info.name_space)
-                       fullName = g_strdup_printf ("%s.%s", info.name_space, info.name);
-               else
-                       fullName = g_strdup (info.name);
-               assembly = 
-                       mono_domain_try_type_resolve (
-                               mono_domain_get (),
-                               (MonoObject*)mono_string_new (mono_domain_get (), fullName));
-               if (assembly)
-                       type = mono_reflection_get_type (assembly->assembly->image, 
-                                                                                        &info, ignoreCase);
-               g_free (fullName);
-       }
-
        g_free (str);
        g_list_free (info.modifiers);
        g_list_free (info.nested);
@@ -2275,7 +2257,7 @@ static MonoObject*
 ves_icall_System_Reflection_Assembly_GetFilesInternal (MonoReflectionAssembly *assembly, MonoString *name) 
 {
        MonoTableInfo *table = &assembly->assembly->image->tables [MONO_TABLE_FILE];
-       MonoArray *result;
+       MonoArray *result = NULL;
        int i;
        const char *val;
        char *n;
@@ -3001,6 +2983,36 @@ ves_icall_IsTransparentProxy (MonoObject *proxy)
        return 0;
 }
 
+static void
+ves_icall_System_Runtime_Activation_ActivationServices_EnableProxyActivation (MonoReflectionType *type, MonoBoolean enable)
+{
+       MonoClass *klass;
+       MonoVTable* vtable;
+
+       MONO_ARCH_SAVE_REGS;
+
+       klass = mono_class_from_mono_type (type->type);
+       vtable = mono_class_vtable (mono_domain_get (), klass);
+
+       if (enable) vtable->remote = 1;
+       else vtable->remote = 0;
+}
+
+static MonoObject *
+ves_icall_System_Runtime_Activation_ActivationServices_AllocateUninitializedClassInstance (MonoReflectionType *type)
+{
+       MonoClass *klass;
+       MonoDomain *domain;
+       
+       MONO_ARCH_SAVE_REGS;
+
+       domain = mono_object_domain (type);
+       klass = mono_class_from_mono_type (type->type);
+
+       // Bypass remoting object creation check
+       return mono_object_new_alloc_specific (mono_class_vtable (domain, klass));
+}
+
 static MonoObject *
 ves_icall_System_Runtime_Serialization_FormatterServices_GetUninitializedObject_Internal (MonoReflectionType *type)
 {
@@ -3043,11 +3055,24 @@ char const * mono_cfg_dir = "";
 
 void    
 mono_install_get_config_dir (void)
-{       
+{
+#ifdef PLATFORM_WIN32
+  int i;
+#endif
+
   mono_cfg_dir = getenv ("MONO_CFG_DIR");
 
-  if (!mono_cfg_dir)
-    mono_cfg_dir = MONO_CFG_DIR; 
+  if (!mono_cfg_dir) {
+#ifndef PLATFORM_WIN32
+    mono_cfg_dir = MONO_CFG_DIR;
+#else
+    mono_cfg_dir = g_strdup (MONO_CFG_DIR);
+    for (i = strlen (mono_cfg_dir) - 1; i >= 0; i--) {
+        if (mono_cfg_dir [i] == '/')
+            mono_cfg_dir [i] = '\\';
+    }
+#endif
+  }
 }
 
 
@@ -3249,6 +3274,7 @@ static gconstpointer icall_map [] = {
        "System.AppDomain::InternalSetDomainByID", ves_icall_System_AppDomain_InternalSetDomainByID,
        "System.AppDomain::InternalSetContext", ves_icall_System_AppDomain_InternalSetContext,
        "System.AppDomain::InternalGetContext", ves_icall_System_AppDomain_InternalGetContext,
+       "System.AppDomain::InternalGetDefaultContext", ves_icall_System_AppDomain_InternalGetDefaultContext,
 
        /*
         * System.AppDomainSetup
@@ -3628,6 +3654,14 @@ static gconstpointer icall_map [] = {
        "System.Runtime.Remoting.RemotingServices::IsTransparentProxy",
        ves_icall_IsTransparentProxy,
 
+       /*
+        * System.Runtime.Remoting.Activation
+        */     
+       "System.Runtime.Remoting.Activation.ActivationServices::AllocateUninitializedClassInstance",
+       ves_icall_System_Runtime_Activation_ActivationServices_AllocateUninitializedClassInstance,
+       "System.Runtime.Remoting.Activation.ActivationServices::EnableProxyActivation",
+       ves_icall_System_Runtime_Activation_ActivationServices_EnableProxyActivation,
+
        /*
         * System.Runtime.Remoting.Messaging
         */     
@@ -3694,6 +3728,9 @@ static gconstpointer icall_map [] = {
        "System.Reflection.Assembly::MonoDebugger_GetMethod",
        ves_icall_MonoDebugger_GetMethod,
 
+       "System.Reflection.Assembly::MonoDebugger_GetMethodToken",
+       ves_icall_MonoDebugger_GetMethodToken,
+
        "System.Reflection.Assembly::MonoDebugger_GetLocalTypeFromSignature",
        ves_icall_MonoDebugger_GetLocalTypeFromSignature,