for (i = 0; i < top; i++){
if ((addr >= tables->st_virtual_address) &&
(addr < tables->st_virtual_address + tables->st_raw_data_size)){
-#ifdef HOST_WIN32
+#ifdef ENABLE_COREE
if (image->is_module_handle)
return addr;
#endif
if (!mono_image_ensure_section_idx (image, i))
return NULL;
}
-#ifdef HOST_WIN32
+#ifdef ENABLE_COREE
if (image->is_module_handle)
return image->raw_data + addr;
#endif
void
mono_images_cleanup (void)
{
+ GHashTableIter iter;
+ MonoImage *image;
+
DeleteCriticalSection (&images_mutex);
+ g_hash_table_iter_init (&iter, loaded_images_hash);
+ while (g_hash_table_iter_next (&iter, NULL, (void**)&image))
+ mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_ASSEMBLY, "Assembly image '%s' still loaded at shutdown.", image->name);
+
g_hash_table_destroy (loaded_images_hash);
g_hash_table_destroy (loaded_images_refonly_hash);
if (sect->st_raw_data_ptr + sect->st_raw_data_size > image->raw_data_len)
return FALSE;
-#ifdef HOST_WIN32
+#ifdef ENABLE_COREE
if (image->is_module_handle)
iinfo->cli_sections [section] = image->raw_data + sect->st_virtual_address;
else
if (image->modules [idx - 1]) {
mono_image_addref (image->modules [idx - 1]);
image->modules [idx - 1]->assembly = image->assembly;
-#ifdef HOST_WIN32
+#ifdef ENABLE_COREE
if (image->modules [idx - 1]->is_module_handle)
mono_image_fixup_vtable (image->modules [idx - 1]);
#endif
{
MonoDotNetHeader64 header64;
-#ifdef HOST_WIN32
+#ifdef ENABLE_COREE
if (!image->is_module_handle)
#endif
if (offset + sizeof (MonoDotNetHeader32) > image->raw_data_len)
SWAPPDE (header->datadir.pe_cli_header);
SWAPPDE (header->datadir.pe_reserved);
-#ifdef HOST_WIN32
+#ifdef ENABLE_COREE
if (image->is_module_handle)
image->raw_data_len = header->nt.pe_image_size;
#endif
iinfo = image->image_info;
header = &iinfo->cli_header;
-#ifdef HOST_WIN32
+#ifdef ENABLE_COREE
if (!image->is_module_handle)
#endif
if (offset + sizeof (msdos) > image->raw_data_len)
return mono_image_open_from_data_full (data, data_len, need_copy, status, FALSE);
}
-#ifdef HOST_WIN32
+#ifdef ENABLE_COREE
/* fname is not duplicated. */
MonoImage*
mono_image_open_from_module_handle (HMODULE module_handle, char* fname, gboolean has_entry_point, MonoImageOpenStatus* status)
g_return_val_if_fail (fname != NULL, NULL);
-#ifdef HOST_WIN32
+#ifdef ENABLE_COREE
/* Load modules using LoadLibrary. */
if (!refonly && coree_module_handle) {
HMODULE module_handle;
void
mono_image_fixup_vtable (MonoImage *image)
{
-#ifdef HOST_WIN32
+#ifdef ENABLE_COREE
MonoCLIImageInfo *iinfo;
MonoPEDirEntry *de;
MonoVTableFixup *vtfixup;
}
*/
-static void
-free_remoting_wrappers (gpointer key, gpointer val, gpointer user_data)
-{
- g_free (val);
-}
-
static void
free_array_cache_entry (gpointer key, gpointer val, gpointer user_data)
{
mono_images_unlock ();
-#ifdef HOST_WIN32
+#ifdef ENABLE_COREE
if (image->is_module_handle && image->has_entry_point) {
mono_images_lock ();
if (image->ref_count == 0) {
}
}
-#ifdef HOST_WIN32
+#ifdef ENABLE_COREE
mono_images_lock ();
if (image->is_module_handle && !image->has_entry_point)
FreeLibrary ((HMODULE) image->raw_data);
free_hash (image->delegate_invoke_cache);
free_hash (image->delegate_abstract_invoke_cache);
free_hash (image->delegate_bound_static_invoke_cache);
- if (image->remoting_invoke_cache)
- g_hash_table_foreach (image->remoting_invoke_cache, free_remoting_wrappers, NULL);
free_hash (image->remoting_invoke_cache);
free_hash (image->runtime_invoke_cache);
free_hash (image->runtime_invoke_direct_cache);
}
image->files [fileidx - 1] = res;
-#ifdef HOST_WIN32
+#ifdef ENABLE_COREE
if (res->is_module_handle)
mono_image_fixup_vtable (res);
#endif