5 #ifndef _MONO_METADATA_LOADER_INTERNALS_H_
6 #define _MONO_METADATA_LOADER_INTERNALS_H_
9 #include <mono/metadata/appdomain.h>
10 #include <mono/metadata/image.h>
11 #include <mono/metadata/object-forward.h>
12 #include <mono/utils/mono-forward.h>
13 #include <mono/utils/mono-error.h>
14 #include <mono/utils/mono-coop-mutex.h>
16 typedef struct _MonoLoadedImages MonoLoadedImages
;
17 typedef struct _MonoAssemblyLoadContext MonoAssemblyLoadContext
;
19 #ifndef DISABLE_DLLMAP
20 typedef struct _MonoDllMap MonoDllMap
;
31 /* FIXME: this probably belongs somewhere else */
32 struct _MonoAssemblyLoadContext
{
34 MonoLoadedImages
*loaded_images
;
35 GSList
*loaded_assemblies
;
36 MonoCoopMutex assemblies_lock
;
37 /* Handle of the corresponding managed object. If the ALC is
38 * collectible, the handle is weak, otherwise it's strong.
42 // Used in native-library.c for the hash table below; do not access anywhere else
43 MonoCoopMutex pinvoke_lock
;
44 // Maps malloc-ed char* pinvoke scope -> MonoDl*
45 GHashTable
*pinvoke_scopes
;
47 #endif /* ENABLE_NETCORE */
50 mono_global_loader_data_lock (void);
53 mono_global_loader_data_unlock (void);
56 mono_lookup_pinvoke_call_internal (MonoMethod
*method
, MonoError
*error
);
58 #ifndef DISABLE_DLLMAP
60 mono_dllmap_insert_internal (MonoImage
*assembly
, const char *dll
, const char *func
, const char *tdll
, const char *tfunc
);
63 mono_global_dllmap_cleanup (void);
67 mono_global_loader_cache_init (void);
70 mono_global_loader_cache_cleanup (void);
74 mono_set_pinvoke_search_directories (int dir_count
, char **dirs
);
77 mono_alc_init (MonoAssemblyLoadContext
*alc
, MonoDomain
*domain
);
80 mono_alc_cleanup (MonoAssemblyLoadContext
*alc
);
83 mono_alc_assemblies_lock (MonoAssemblyLoadContext
*alc
);
86 mono_alc_assemblies_unlock (MonoAssemblyLoadContext
*alc
);
89 mono_alc_is_default (MonoAssemblyLoadContext
*alc
);
92 mono_alc_invoke_resolve_using_load_nofail (MonoAssemblyLoadContext
*alc
, MonoAssemblyName
*aname
);
95 mono_alc_invoke_resolve_using_resolving_event_nofail (MonoAssemblyLoadContext
*alc
, MonoAssemblyName
*aname
);
98 mono_alc_invoke_resolve_using_resolve_satellite_nofail (MonoAssemblyLoadContext
*alc
, MonoAssemblyName
*aname
);
100 #endif /* ENABLE_NETCORE */
102 static inline MonoDomain
*
103 mono_alc_domain (MonoAssemblyLoadContext
*alc
)
105 #ifdef ENABLE_NETCORE
108 return mono_domain_get ();
113 mono_alc_get_loaded_images (MonoAssemblyLoadContext
*alc
);
116 mono_loader_save_bundled_library (int fd
, uint64_t offset
, uint64_t size
, const char *destfname
);