1 #ifndef _MONONET_METADATA_IMAGE_H_
2 #define _MONONET_METADATA_IMAGE_H_
7 typedef struct _MonoImage MonoImage;
12 const char *hash_value;
15 gint16 major, minor, build, revision;
21 MonoAssemblyName aname;
34 guint32 rows, row_size;
38 * Tables contain up to 9 columns and the possible sizes of the
39 * fields in the documentation are 1, 2 and 4 bytes. So we
40 * can encode in 2 bits the size.
42 * A 32 bit value can encode the resulting size
44 * The top eight bits encode the number of columns in the table.
45 * we only need 4, but 8 is aligned no shift required.
47 guint32 size_bitfield;
54 const char *assembly_name;
55 const char *module_name;
60 gboolean idx_string_wide, idx_guid_wide, idx_blob_wide;
62 MonoStreamHeader heap_strings;
63 MonoStreamHeader heap_us;
64 MonoStreamHeader heap_blob;
65 MonoStreamHeader heap_guid;
66 MonoStreamHeader heap_tables;
68 const char *tables_base;
70 MonoTableInfo tables [64];
73 * references is initialized only by using the mono_assembly_open
74 * function, and not by using the lowlevel mono_image_open.
76 * It is NULL terminated.
78 MonoAssembly **references;
81 * The Assembly this image was loaded from.
83 MonoAssembly *assembly;
86 * Indexed by method tokens and typedef tokens.
88 GHashTable *method_cache;
89 GHashTable *class_cache;
91 * Indexes namespaces to hash tables that map class name to typedef token.
93 GHashTable *name_cache;
96 * Indexed by ((rank << 24) | (typedef & 0xffffff)), which limits us to a
99 GHashTable *array_cache;
102 * indexed by MonoMethodSignature
104 GHashTable *delegate_begin_invoke_cache;
105 GHashTable *delegate_end_invoke_cache;
106 GHashTable *delegate_invoke_cache;
109 * indexed by MonoMethod pointers
111 GHashTable *runtime_invoke_cache;
112 GHashTable *managed_wrapper_cache;
113 GHashTable *native_wrapper_cache;
114 GHashTable *remoting_invoke_cache;
116 void *reflection_info;
119 * user_info is a public field and is not touched by the
127 MONO_IMAGE_ERROR_ERRNO,
128 MONO_IMAGE_MISSING_ASSEMBLYREF,
129 MONO_IMAGE_IMAGE_INVALID
130 } MonoImageOpenStatus;
132 MonoImage *mono_image_open (const char *fname,
133 MonoImageOpenStatus *status);
134 MonoImage *mono_image_loaded (const char *name);
135 void mono_image_close (MonoImage *image);
136 const char *mono_image_strerror (MonoImageOpenStatus status);
138 int mono_image_ensure_section (MonoImage *image,
139 const char *section);
140 int mono_image_ensure_section_idx (MonoImage *image,
142 /* This actually returns a MonoPEResourceDataEntry *, but declaring it
143 * causes an include file loop.
145 gpointer mono_image_lookup_resource (MonoImage *image, guint32 res_id,
146 guint32 lang_id, gunichar2 *name);