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;
108 * This must be a GHashTable, since these objects can't be finalized
109 * if the hashtable contains a GC visible reference to them.
111 GHashTable *finalizable_objects_hash;
114 #define mono_domain_lock(domain) EnterCriticalSection(&(domain)->lock)
115 #define mono_domain_unlock(domain) LeaveCriticalSection(&(domain)->lock)
118 mono_jit_info_table_add (MonoDomain *domain, MonoJitInfo *ji);
121 ves_icall_System_AppDomain_getCurDomain (void);
124 ves_icall_System_AppDomain_createDomain (MonoString *friendly_name,
125 MonoAppDomainSetup *setup);
128 ves_icall_System_AppDomain_GetData (MonoAppDomain *ad,
131 MonoReflectionAssembly *
132 ves_icall_System_AppDomain_LoadAssemblyRaw (MonoAppDomain *ad,
133 MonoArray *raw_assembly,
134 MonoArray *raw_symbol_store,
135 MonoObject *evidence);
138 ves_icall_System_AppDomain_SetData (MonoAppDomain *ad,
143 ves_icall_System_AppDomain_getSetup (MonoAppDomain *ad);
146 ves_icall_System_AppDomain_getFriendlyName (MonoAppDomain *ad);
149 ves_icall_System_AppDomain_GetAssemblies (MonoAppDomain *ad);
151 MonoReflectionAssembly *
152 ves_icall_System_Reflection_Assembly_LoadFrom (MonoString *fname);
154 MonoReflectionAssembly *
155 ves_icall_System_AppDomain_LoadAssembly (MonoAppDomain *ad,
157 MonoObject *evidence);
160 ves_icall_System_AppDomain_InternalIsFinalizingForUnload (gint32 domain_id);
163 ves_icall_System_AppDomain_InternalUnload (gint32 domain_id);
166 ves_icall_System_AppDomain_ExecuteAssembly (MonoAppDomain *ad,
168 MonoObject *evidence,
172 ves_icall_System_AppDomain_InternalSetDomain (MonoAppDomain *ad);
175 ves_icall_System_AppDomain_InternalSetDomainByID (gint32 domainid);
178 ves_icall_System_AppDomain_InternalPushDomainRef (MonoAppDomain *ad);
181 ves_icall_System_AppDomain_InternalPushDomainRefByID (gint32 domain_id);
184 ves_icall_System_AppDomain_InternalPopDomainRef (void);
187 ves_icall_System_AppDomain_InternalGetContext (void);
190 ves_icall_System_AppDomain_InternalGetDefaultContext (void);
193 ves_icall_System_AppDomain_InternalSetContext (MonoAppContext *mc);
196 ves_icall_System_AppDomain_GetIDFromDomain (MonoAppDomain * ad);
199 ves_icall_System_AppDomain_InternalGetProcessGuid (MonoString* newguid);
201 #endif /* __MONO_METADATA_DOMAIN_INTERNALS_H__ */