2 * Appdomain-related internal data structures and functions.
4 #ifndef __MONO_METADATA_DOMAIN_INTERNALS_H__
5 #define __MONO_METADATA_DOMAIN_INTERNALS_H__
7 #include <mono/metadata/appdomain.h>
8 #include <mono/utils/mono-codeman.h>
9 #include <mono/utils/mono-hash.h>
10 #include <mono/io-layer/io-layer.h>
12 extern CRITICAL_SECTION mono_delegate_section;
14 /* This is a copy of System.AppDomainSetup */
17 MonoString *application_base;
18 MonoString *application_name;
19 MonoString *cache_path;
20 MonoString *configuration_file;
21 MonoString *dynamic_base;
22 MonoString *license_file;
23 MonoString *private_bin_path;
24 MonoString *private_bin_path_probe;
25 MonoString *shadow_copy_directories;
26 MonoString *shadow_copy_files;
27 MonoBoolean publisher_policy;
28 MonoBoolean path_changed;
29 int loader_optimization;
30 MonoBoolean disallow_binding_redirects;
31 MonoBoolean disallow_code_downloads;
34 typedef GArray MonoJitInfoTable;
40 gpointer handler_start;
45 } MonoJitExceptionInfo;
54 /* Whenever the code is domain neutral or 'shared' */
55 gboolean domain_neutral:1;
56 MonoJitExceptionInfo *clauses;
59 struct _MonoAppContext {
63 gpointer *static_data;
67 MONO_APPDOMAIN_CREATED,
68 MONO_APPDOMAIN_UNLOADING,
69 MONO_APPDOMAIN_UNLOADED
73 MonoAppDomain *domain;
74 CRITICAL_SECTION lock;
76 MonoCodeManager *code_mp;
78 GHashTable *assemblies;
79 MonoAssembly *entry_assembly;
80 MonoAppDomainSetup *setup;
83 MonoGHashTable *ldstr_table;
84 MonoGHashTable *class_vtable_hash;
85 MonoGHashTable *proxy_vtable_hash;
86 MonoGHashTable *static_data_hash;
87 GHashTable *jit_code_hash;
88 MonoJitInfoTable *jit_info_table;
89 /* hashtables for Reflection handles */
90 MonoGHashTable *type_hash;
91 MonoGHashTable *refobject_hash;
92 /* Needed by Thread:GetDomainID() */
94 /* Used when loading assemblies */
96 /* Used by remoting proxies */
97 MonoMethod *create_proxy_for_type_method;
98 MonoMethod *private_invoke_method;
99 MonoAppContext *default_context;
100 MonoException *out_of_memory_ex;
101 MonoException *null_reference_ex;
102 MonoException *stack_overflow_ex;
103 /* Used to store offsets of thread and context static fields */
104 GHashTable *special_static_fields;
105 GHashTable *jump_target_hash;
106 MonoGHashTable *class_init_trampoline_hash;
107 MonoGHashTable *jump_trampoline_hash;
109 * This must be a GHashTable, since these objects can't be finalized
110 * if the hashtable contains a GC visible reference to them.
112 GHashTable *finalizable_objects_hash;
115 #define mono_domain_lock(domain) EnterCriticalSection(&(domain)->lock)
116 #define mono_domain_unlock(domain) LeaveCriticalSection(&(domain)->lock)
119 mono_jit_info_table_add (MonoDomain *domain, MonoJitInfo *ji);
122 mono_jit_info_table_remove (MonoDomain *domain, MonoJitInfo *ji);
125 ves_icall_System_AppDomain_getCurDomain (void);
128 ves_icall_System_AppDomain_getDomainByID (gint32 domain_id);
131 ves_icall_System_AppDomain_createDomain (MonoString *friendly_name,
132 MonoAppDomainSetup *setup);
135 ves_icall_System_AppDomain_GetData (MonoAppDomain *ad,
138 MonoReflectionAssembly *
139 ves_icall_System_AppDomain_LoadAssemblyRaw (MonoAppDomain *ad,
140 MonoArray *raw_assembly,
141 MonoArray *raw_symbol_store,
142 MonoObject *evidence);
145 ves_icall_System_AppDomain_SetData (MonoAppDomain *ad,
150 ves_icall_System_AppDomain_getSetup (MonoAppDomain *ad);
153 ves_icall_System_AppDomain_getFriendlyName (MonoAppDomain *ad);
156 ves_icall_System_AppDomain_GetAssemblies (MonoAppDomain *ad);
158 MonoReflectionAssembly *
159 ves_icall_System_Reflection_Assembly_LoadFrom (MonoString *fname);
161 MonoReflectionAssembly *
162 ves_icall_System_AppDomain_LoadAssembly (MonoAppDomain *ad,
164 MonoObject *evidence);
167 ves_icall_System_AppDomain_InternalIsFinalizingForUnload (gint32 domain_id);
170 ves_icall_System_AppDomain_InternalUnload (gint32 domain_id);
173 ves_icall_System_AppDomain_ExecuteAssembly (MonoAppDomain *ad,
175 MonoObject *evidence,
179 ves_icall_System_AppDomain_InternalSetDomain (MonoAppDomain *ad);
182 ves_icall_System_AppDomain_InternalSetDomainByID (gint32 domainid);
185 ves_icall_System_AppDomain_InternalPushDomainRef (MonoAppDomain *ad);
188 ves_icall_System_AppDomain_InternalPushDomainRefByID (gint32 domain_id);
191 ves_icall_System_AppDomain_InternalPopDomainRef (void);
194 ves_icall_System_AppDomain_InternalGetContext (void);
197 ves_icall_System_AppDomain_InternalGetDefaultContext (void);
200 ves_icall_System_AppDomain_InternalSetContext (MonoAppContext *mc);
203 ves_icall_System_AppDomain_GetIDFromDomain (MonoAppDomain * ad);
206 ves_icall_System_AppDomain_InternalGetProcessGuid (MonoString* newguid);
209 mono_get_framework_version (void);
212 mono_get_runtime_version (void);
215 #endif /* __MONO_METADATA_DOMAIN_INTERNALS_H__ */