rename net_2_1 to moonlight
[mono.git] / mono / metadata / metadata-internals.h
1
2 #ifndef __MONO_METADATA_INTERNALS_H__
3 #define __MONO_METADATA_INTERNALS_H__
4
5 #include "mono/metadata/image.h"
6 #include "mono/metadata/blob.h"
7 #include "mono/metadata/mempool.h"
8 #include "mono/metadata/domain-internals.h"
9 #include "mono/utils/mono-hash.h"
10 #include "mono/utils/mono-compiler.h"
11 #include "mono/utils/mono-dl.h"
12 #include "mono/utils/monobitset.h"
13 #include "mono/utils/mono-property-hash.h"
14 #include "mono/utils/mono-value-hash.h"
15 #include <mono/utils/mono-error.h>
16
17 struct _MonoType {
18         union {
19                 MonoClass *klass; /* for VALUETYPE and CLASS */
20                 MonoType *type;   /* for PTR */
21                 MonoArrayType *array; /* for ARRAY */
22                 MonoMethodSignature *method;
23                 MonoGenericParam *generic_param; /* for VAR and MVAR */
24                 MonoGenericClass *generic_class; /* for GENERICINST */
25         } data;
26         unsigned int attrs    : 16; /* param attributes or field flags */
27         MonoTypeEnum type     : 8;
28         unsigned int num_mods : 6;  /* max 64 modifiers follow at the end */
29         unsigned int byref    : 1;
30         unsigned int pinned   : 1;  /* valid when included in a local var signature */
31         MonoCustomMod modifiers [MONO_ZERO_LEN_ARRAY]; /* this may grow */
32 };
33
34 #define MONO_SIZEOF_TYPE (offsetof (struct _MonoType, modifiers))
35
36 #define MONO_SECMAN_FLAG_INIT(x)                (x & 0x2)
37 #define MONO_SECMAN_FLAG_GET_VALUE(x)           (x & 0x1)
38 #define MONO_SECMAN_FLAG_SET_VALUE(x,y)         do { x = ((y) ? 0x3 : 0x2); } while (0)
39
40 #define MONO_PUBLIC_KEY_TOKEN_LENGTH    17
41
42 struct _MonoAssemblyName {
43         const char *name;
44         const char *culture;
45         const char *hash_value;
46         const mono_byte* public_key;
47         // string of 16 hex chars + 1 NULL
48         mono_byte public_key_token [MONO_PUBLIC_KEY_TOKEN_LENGTH];
49         uint32_t hash_alg;
50         uint32_t hash_len;
51         uint32_t flags;
52         uint16_t major, minor, build, revision;
53 };
54
55 struct MonoTypeNameParse {
56         char *name_space;
57         char *name;
58         MonoAssemblyName assembly;
59         GList *modifiers; /* 0 -> byref, -1 -> pointer, > 0 -> array rank */
60         GPtrArray *type_arguments;
61         GList *nested;
62 };
63
64 struct _MonoAssembly {
65         /* 
66          * The number of appdomains which have this assembly loaded plus the number of 
67          * assemblies referencing this assembly through an entry in their image->references
68          * arrays. The later is needed because entries in the image->references array
69          * might point to assemblies which are only loaded in some appdomains, and without
70          * the additional reference, they can be freed at any time.
71          * The ref_count is initially 0.
72          */
73         int ref_count; /* use atomic operations only */
74         char *basedir;
75         MonoAssemblyName aname;
76         MonoImage *image;
77         GSList *friend_assembly_names; /* Computed by mono_assembly_load_friends () */
78         guint8 friend_assembly_names_inited;
79         guint8 in_gac;
80         guint8 dynamic;
81         guint8 corlib_internal;
82         gboolean ref_only;
83         /* security manager flags (one bit is for lazy initialization) */
84         guint32 ecma:2;         /* Has the ECMA key */
85         guint32 aptc:2;         /* Has the [AllowPartiallyTrustedCallers] attributes */
86         guint32 fulltrust:2;    /* Has FullTrust permission */
87         guint32 unmanaged:2;    /* Has SecurityPermissionFlag.UnmanagedCode permission */
88         guint32 skipverification:2;     /* Has SecurityPermissionFlag.SkipVerification permission */
89 };
90
91 typedef struct {
92         const char* data;
93         guint32  size;
94 } MonoStreamHeader;
95
96 struct _MonoTableInfo {
97         const char *base;
98         guint       rows     : 24;
99         guint       row_size : 8;
100
101         /*
102          * Tables contain up to 9 columns and the possible sizes of the
103          * fields in the documentation are 1, 2 and 4 bytes.  So we
104          * can encode in 2 bits the size.
105          *
106          * A 32 bit value can encode the resulting size
107          *
108          * The top eight bits encode the number of columns in the table.
109          * we only need 4, but 8 is aligned no shift required. 
110          */
111         guint32   size_bitfield;
112 };
113
114 #define REFERENCE_MISSING ((gpointer) -1)
115
116 typedef struct _MonoDllMap MonoDllMap;
117
118 struct _MonoImage {
119         /*
120          * The number of assemblies which reference this MonoImage though their 'image'
121          * field plus the number of images which reference this MonoImage through their 
122          * 'modules' field, plus the number of threads holding temporary references to
123          * this image between calls of mono_image_open () and mono_image_close ().
124          */
125         int   ref_count;
126         void *raw_data_handle;
127         char *raw_data;
128         guint32 raw_data_len;
129         guint8 raw_buffer_used    : 1;
130         guint8 raw_data_allocated : 1;
131
132 #ifdef HOST_WIN32
133         /* Module was loaded using LoadLibrary. */
134         guint8 is_module_handle : 1;
135
136         /* Module entry point is _CorDllMain. */
137         guint8 has_entry_point : 1;
138 #endif
139
140         /* Whenever this is a dynamically emitted module */
141         guint8 dynamic : 1;
142
143         /* Whenever this is a reflection only image */
144         guint8 ref_only : 1;
145
146         /* Whenever this image contains uncompressed metadata */
147         guint8 uncompressed_metadata : 1;
148
149         guint8 checked_module_cctor : 1;
150         guint8 has_module_cctor : 1;
151
152         guint8 idx_string_wide : 1;
153         guint8 idx_guid_wide : 1;
154         guint8 idx_blob_wide : 1;
155
156         /* Whenever this image is considered as platform code for the CoreCLR security model */
157         guint8 core_clr_platform_code : 1;
158                             
159         char *name;
160         const char *assembly_name;
161         const char *module_name;
162         char *version;
163         gint16 md_version_major, md_version_minor;
164         char *guid;
165         void *image_info;
166         MonoMemPool         *mempool; /*protected by the image lock*/
167
168         char                *raw_metadata;
169                             
170         MonoStreamHeader     heap_strings;
171         MonoStreamHeader     heap_us;
172         MonoStreamHeader     heap_blob;
173         MonoStreamHeader     heap_guid;
174         MonoStreamHeader     heap_tables;
175                             
176         const char          *tables_base;
177
178         /**/
179         MonoTableInfo        tables [MONO_TABLE_NUM];
180
181         /*
182          * references is initialized only by using the mono_assembly_open
183          * function, and not by using the lowlevel mono_image_open.
184          *
185          * It is NULL terminated.
186          */
187         MonoAssembly **references;
188
189         MonoImage **modules;
190         guint32 module_count;
191         gboolean *modules_loaded;
192
193         MonoImage **files;
194
195         gpointer aot_module;
196
197         /*
198          * The Assembly this image was loaded from.
199          */
200         MonoAssembly *assembly;
201
202         /*
203          * Indexed by method tokens and typedef tokens.
204          */
205         GHashTable *method_cache; /*protected by the image lock*/
206         MonoInternalHashTable class_cache;
207
208         /* Indexed by memberref + methodspec tokens */
209         GHashTable *methodref_cache; /*protected by the image lock*/
210
211         /*
212          * Indexed by fielddef and memberref tokens
213          */
214         GHashTable *field_cache;
215
216         /* indexed by typespec tokens. */
217         GHashTable *typespec_cache;
218         /* indexed by token */
219         GHashTable *memberref_signatures;
220         GHashTable *helper_signatures;
221
222         /* Indexed by blob heap indexes */
223         GHashTable *method_signatures;
224
225         /*
226          * Indexes namespaces to hash tables that map class name to typedef token.
227          */
228         GHashTable *name_cache;  /*protected by the image lock*/
229
230         /*
231          * Indexed by MonoClass
232          */
233         GHashTable *array_cache;
234         GHashTable *ptr_cache;
235
236         GHashTable *szarray_cache;
237         /* This has a separate lock to improve scalability */
238         CRITICAL_SECTION szarray_cache_lock;
239
240         /*
241          * indexed by MonoMethodSignature 
242          */
243         GHashTable *delegate_begin_invoke_cache;
244         GHashTable *delegate_end_invoke_cache;
245         GHashTable *delegate_invoke_cache;
246         GHashTable *runtime_invoke_cache;
247
248         /*
249          * indexed by SignatureMethodPair
250          */
251         GHashTable *delegate_abstract_invoke_cache;
252
253         /*
254          * indexed by MonoMethod pointers 
255          */
256         GHashTable *runtime_invoke_direct_cache;
257         GHashTable *runtime_invoke_vcall_cache;
258         GHashTable *managed_wrapper_cache;
259         GHashTable *native_wrapper_cache;
260         GHashTable *native_wrapper_aot_cache;
261         GHashTable *remoting_invoke_cache;
262         GHashTable *synchronized_cache;
263         GHashTable *unbox_wrapper_cache;
264         GHashTable *cominterop_invoke_cache;
265         GHashTable *cominterop_wrapper_cache; /* LOCKING: marshal lock */
266         GHashTable *thunk_invoke_cache;
267
268         /*
269          * indexed by MonoClass pointers
270          */
271         GHashTable *ldfld_wrapper_cache;
272         GHashTable *ldflda_wrapper_cache;
273         GHashTable *stfld_wrapper_cache;
274         GHashTable *isinst_cache;
275         GHashTable *castclass_cache;
276         GHashTable *proxy_isinst_cache;
277         GHashTable *rgctx_template_hash; /* LOCKING: templates lock */
278
279         /* Contains rarely used fields of runtime structures belonging to this image */
280         MonoPropertyHash *property_hash;
281
282         void *reflection_info;
283
284         /*
285          * user_info is a public field and is not touched by the
286          * metadata engine
287          */
288         void *user_info;
289
290         /* dll map entries */
291         MonoDllMap *dll_map;
292
293         /* interfaces IDs from this image */
294         MonoBitSet *interface_bitset;
295
296         /* when the image is being closed, this is abused as a list of
297            malloc'ed regions to be freed. */
298         GSList *reflection_info_unregister_classes;
299
300         /* List of image sets containing this image */
301         GSList *image_sets;
302
303         /*
304          * No other runtime locks must be taken while holding this lock.
305          * It's meant to be used only to mutate and query structures part of this image.
306          */
307         CRITICAL_SECTION    lock;
308 };
309
310 /*
311  * Generic instances depend on many images, and they need to be deleted if one
312  * of the images they depend on is unloaded. For example,
313  * List<Foo> depends on both List's image and Foo's image.
314  * A MonoImageSet is the owner of all generic instances depending on the same set of
315  * images.
316  */
317 typedef struct {
318         int nimages;
319         MonoImage **images;
320
321         GHashTable *gclass_cache, *ginst_cache, *gmethod_cache, *gsignature_cache;
322
323         CRITICAL_SECTION    lock;
324
325         /*
326          * Memory for generic instances owned by this image set should be allocated from
327          * this mempool, using the mono_image_set_alloc family of functions.
328          */
329         MonoMemPool         *mempool;
330 } MonoImageSet;
331
332 enum {
333         MONO_SECTION_TEXT,
334         MONO_SECTION_RSRC,
335         MONO_SECTION_RELOC,
336         MONO_SECTION_MAX
337 };
338
339 typedef struct {
340         GHashTable *hash;
341         char *data;
342         guint32 alloc_size; /* malloced bytes */
343         guint32 index;
344         guint32 offset; /* from start of metadata */
345 } MonoDynamicStream;
346
347 typedef struct {
348         guint32 alloc_rows;
349         guint32 rows;
350         guint8  row_size; /*  calculated later with column_sizes */
351         guint8  columns;
352         guint32 next_idx;
353         guint32 *values; /* rows * columns */
354 } MonoDynamicTable;
355
356 struct _MonoDynamicAssembly {
357         MonoAssembly assembly;
358         char *strong_name;
359         guint32 strong_name_size;
360         guint8 run;
361         guint8 save;
362         MonoDomain *domain;
363 };
364
365 struct _MonoDynamicImage {
366         MonoImage image;
367         guint32 meta_size;
368         guint32 text_rva;
369         guint32 metadata_rva;
370         guint32 image_base;
371         guint32 cli_header_offset;
372         guint32 iat_offset;
373         guint32 idt_offset;
374         guint32 ilt_offset;
375         guint32 imp_names_offset;
376         struct {
377                 guint32 rva;
378                 guint32 size;
379                 guint32 offset;
380                 guint32 attrs;
381         } sections [MONO_SECTION_MAX];
382         GHashTable *typespec;
383         GHashTable *typeref;
384         GHashTable *handleref;
385         MonoGHashTable *handleref_managed;
386         MonoGHashTable *tokens;
387         GHashTable *blob_cache;
388         GHashTable *standalonesig_cache;
389         GList *array_methods;
390         GPtrArray *gen_params;
391         MonoGHashTable *token_fixups;
392         GHashTable *method_to_table_idx;
393         GHashTable *field_to_table_idx;
394         GHashTable *method_aux_hash;
395         MonoGHashTable *generic_def_objects;
396         MonoGHashTable *methodspec;
397         gboolean run;
398         gboolean save;
399         gboolean initial_image;
400         guint32 pe_kind, machine;
401         char *strong_name;
402         guint32 strong_name_size;
403         char *win32_res;
404         guint32 win32_res_size;
405         guint8 *public_key;
406         int public_key_len;
407         MonoDynamicStream sheap;
408         MonoDynamicStream code; /* used to store method headers and bytecode */
409         MonoDynamicStream resources; /* managed embedded resources */
410         MonoDynamicStream us;
411         MonoDynamicStream blob;
412         MonoDynamicStream tstream;
413         MonoDynamicStream guid;
414         MonoDynamicTable tables [MONO_TABLE_NUM];
415         MonoClass *wrappers_type; /*wrappers are bound to this type instead of <Module>*/
416 };
417
418 /* Contains information about assembly binding */
419 typedef struct _MonoAssemblyBindingInfo {
420         char *name;
421         char *culture;
422         guchar public_key_token [MONO_PUBLIC_KEY_TOKEN_LENGTH];
423         int major;
424         int minor;
425         AssemblyVersionSet old_version_bottom;
426         AssemblyVersionSet old_version_top;
427         AssemblyVersionSet new_version;
428         guint has_old_version_bottom : 1;
429         guint has_old_version_top : 1;
430         guint has_new_version : 1;
431         guint is_valid : 1;
432 } MonoAssemblyBindingInfo;
433
434 struct _MonoMethodHeader {
435         const unsigned char  *code;
436 #ifdef MONO_SMALL_CONFIG
437         guint16      code_size;
438 #else
439         guint32      code_size;
440 #endif
441         guint16      max_stack   : 15;
442         unsigned int is_transient: 1; /* mono_metadata_free_mh () will actually free this header */
443         unsigned int num_clauses : 15;
444         /* if num_locals != 0, then the following apply: */
445         unsigned int init_locals : 1;
446         guint16      num_locals;
447         MonoExceptionClause *clauses;
448         MonoType    *locals [MONO_ZERO_LEN_ARRAY];
449 };
450
451 typedef struct {
452         guint32      code_size;
453         gboolean     has_clauses;
454 } MonoMethodHeaderSummary;
455
456 #define MONO_SIZEOF_METHOD_HEADER (sizeof (struct _MonoMethodHeader) - MONO_ZERO_LEN_ARRAY * SIZEOF_VOID_P)
457
458 struct _MonoMethodSignature {
459         MonoType     *ret;
460 #ifdef MONO_SMALL_CONFIG
461         guint8        param_count;
462         gint8         sentinelpos;
463         unsigned int  generic_param_count : 5;
464 #else
465         guint16       param_count;
466         gint16        sentinelpos;
467         unsigned int  generic_param_count : 16;
468 #endif
469         unsigned int  call_convention     : 6;
470         unsigned int  hasthis             : 1;
471         unsigned int  explicit_this       : 1;
472         unsigned int  pinvoke             : 1;
473         unsigned int  is_inflated         : 1;
474         unsigned int  has_type_parameters : 1;
475         MonoType     *params [MONO_ZERO_LEN_ARRAY];
476 };
477
478 #define MONO_SIZEOF_METHOD_SIGNATURE (sizeof (struct _MonoMethodSignature) - MONO_ZERO_LEN_ARRAY * SIZEOF_VOID_P)
479
480 /* for use with allocated memory blocks (assumes alignment is to 8 bytes) */
481 guint mono_aligned_addr_hash (gconstpointer ptr) MONO_INTERNAL;
482
483 void
484 mono_image_check_for_module_cctor (MonoImage *image) MONO_INTERNAL;
485
486 gpointer
487 mono_image_alloc  (MonoImage *image, guint size) MONO_INTERNAL;
488
489 gpointer
490 mono_image_alloc0 (MonoImage *image, guint size) MONO_INTERNAL;
491
492 char*
493 mono_image_strdup (MonoImage *image, const char *s) MONO_INTERNAL;
494
495 GList*
496 g_list_prepend_image (MonoImage *image, GList *list, gpointer data) MONO_INTERNAL;
497
498 GSList*
499 g_slist_append_image (MonoImage *image, GSList *list, gpointer data) MONO_INTERNAL;
500
501 void
502 mono_image_lock (MonoImage *image) MONO_INTERNAL;
503
504 void
505 mono_image_unlock (MonoImage *image) MONO_INTERNAL;
506
507 gpointer
508 mono_image_property_lookup (MonoImage *image, gpointer subject, guint32 property) MONO_INTERNAL;
509
510 void
511 mono_image_property_insert (MonoImage *image, gpointer subject, guint32 property, gpointer value) MONO_INTERNAL;
512
513 void
514 mono_image_property_remove (MonoImage *image, gpointer subject) MONO_INTERNAL;
515
516 gboolean
517 mono_image_close_except_pools (MonoImage *image) MONO_INTERNAL;
518
519 void
520 mono_image_close_finish (MonoImage *image) MONO_INTERNAL;
521
522 typedef void  (*MonoImageUnloadFunc) (MonoImage *image, gpointer user_data);
523
524 void
525 mono_install_image_unload_hook (MonoImageUnloadFunc func, gpointer user_data) MONO_INTERNAL;
526
527 MonoType*
528 mono_metadata_get_shared_type (MonoType *type) MONO_INTERNAL;
529
530 GSList*
531 mono_metadata_clean_for_image (MonoImage *image) MONO_INTERNAL;
532
533 void
534 mono_metadata_clean_generic_classes_for_image (MonoImage *image) MONO_INTERNAL;
535
536 void
537 mono_metadata_cleanup (void);
538
539 const char *   mono_meta_table_name              (int table) MONO_INTERNAL;
540 void           mono_metadata_compute_table_bases (MonoImage *meta) MONO_INTERNAL;
541
542 gboolean
543 mono_metadata_interfaces_from_typedef_full  (MonoImage             *image,
544                                                                                          guint32                table_index,
545                                                                                          MonoClass           ***interfaces,
546                                                                                          guint                 *count,
547                                                                                          gboolean               heap_alloc_result,
548                                                                                          MonoGenericContext    *context) MONO_INTERNAL;
549
550 MonoArrayType *
551 mono_metadata_parse_array_full              (MonoImage             *image,
552                                              MonoGenericContainer  *container,
553                                              const char            *ptr,
554                                              const char           **rptr) MONO_INTERNAL;
555
556 MonoType *
557 mono_metadata_parse_type_full               (MonoImage             *image,
558                                              MonoGenericContainer  *container,
559                                              MonoParseTypeMode      mode,
560                                              short                  opt_attrs,
561                                              const char            *ptr,
562                                              const char           **rptr);
563
564 MonoMethodSignature *
565 mono_metadata_parse_signature_full          (MonoImage             *image,
566                                              MonoGenericContainer  *generic_container,
567                                              guint32                token) MONO_INTERNAL;
568
569 MonoMethodSignature *
570 mono_metadata_parse_method_signature_full   (MonoImage             *image,
571                                              MonoGenericContainer  *generic_container,
572                                              int                     def,
573                                              const char             *ptr,
574                                              const char            **rptr);
575
576 MonoMethodHeader *
577 mono_metadata_parse_mh_full                 (MonoImage             *image,
578                                              MonoGenericContainer  *container,
579                                              const char            *ptr);
580
581 gboolean
582 mono_method_get_header_summary (MonoMethod *method, MonoMethodHeaderSummary *summary) MONO_INTERNAL;
583
584 int* mono_metadata_get_param_attrs          (MonoImage *m, int def, int param_count) MONO_INTERNAL;
585 gboolean mono_metadata_method_has_param_attrs (MonoImage *m, int def) MONO_INTERNAL;
586
587 guint
588 mono_metadata_generic_context_hash          (const MonoGenericContext *context) MONO_INTERNAL;
589
590 gboolean
591 mono_metadata_generic_context_equal         (const MonoGenericContext *g1,
592                                              const MonoGenericContext *g2) MONO_INTERNAL;
593
594 MonoGenericInst *
595 mono_metadata_parse_generic_inst            (MonoImage             *image,
596                                              MonoGenericContainer  *container,
597                                              int                    count,
598                                              const char            *ptr,
599                                              const char           **rptr) MONO_INTERNAL;
600
601 MonoGenericInst *
602 mono_metadata_get_generic_inst              (int                    type_argc,
603                                              MonoType             **type_argv) MONO_INTERNAL;
604
605 MonoGenericClass *
606 mono_metadata_lookup_generic_class          (MonoClass             *gclass,
607                                              MonoGenericInst       *inst,
608                                              gboolean               is_dynamic) MONO_INTERNAL;
609
610 MonoGenericInst * mono_metadata_inflate_generic_inst  (MonoGenericInst *ginst, MonoGenericContext *context, MonoError *error) MONO_INTERNAL;
611
612 void mono_dynamic_stream_reset  (MonoDynamicStream* stream) MONO_INTERNAL;
613 void mono_assembly_addref       (MonoAssembly *assembly) MONO_INTERNAL;
614 void mono_assembly_load_friends (MonoAssembly* ass) MONO_INTERNAL;
615 gboolean mono_assembly_has_skip_verification (MonoAssembly* ass) MONO_INTERNAL;
616
617 gboolean mono_assembly_close_except_image_pools (MonoAssembly *assembly) MONO_INTERNAL;
618 void mono_assembly_close_finish (MonoAssembly *assembly) MONO_INTERNAL;
619
620
621 gboolean mono_public_tokens_are_equal (const unsigned char *pubt1, const unsigned char *pubt2) MONO_INTERNAL;
622
623 void mono_config_parse_publisher_policy (const char *filename, MonoAssemblyBindingInfo *binding_info) MONO_INTERNAL;
624 void mono_config_parse_assembly_bindings (const char *filename, int major, int minor, void *user_data,
625                                           void (*infocb)(MonoAssemblyBindingInfo *info, void *user_data)) MONO_INTERNAL;
626
627 gboolean
628 mono_assembly_name_parse_full                (const char           *name,
629                                               MonoAssemblyName     *aname,
630                                               gboolean save_public_key,
631                                               gboolean *is_version_defined,
632                                                   gboolean *is_token_defined) MONO_INTERNAL;
633
634 guint32 mono_metadata_get_generic_param_row (MonoImage *image, guint32 token, guint32 *owner);
635
636 void mono_unload_interface_ids (MonoBitSet *bitset) MONO_INTERNAL;
637
638
639 MonoType *mono_metadata_type_dup (MonoImage *image, const MonoType *original) MONO_INTERNAL;
640 MonoMethodSignature  *mono_metadata_signature_dup_full (MonoImage *image,MonoMethodSignature *sig) MONO_INTERNAL;
641 MonoMethodSignature  *mono_metadata_signature_dup_mempool (MonoMemPool *mp, MonoMethodSignature *sig) MONO_INTERNAL;
642
643 MonoGenericInst *
644 mono_get_shared_generic_inst (MonoGenericContainer *container) MONO_INTERNAL;
645
646 int
647 mono_type_stack_size_internal (MonoType *t, int *align, gboolean allow_open) MONO_INTERNAL;
648
649 void            mono_type_get_desc (GString *res, MonoType *type, mono_bool include_namespace);
650
651 gboolean
652 mono_metadata_type_equal_full (MonoType *t1, MonoType *t2, gboolean signature_only) MONO_INTERNAL;
653
654 MonoMarshalSpec *
655 mono_metadata_parse_marshal_spec_full (MonoImage *image, const char *ptr) MONO_INTERNAL;
656
657 guint          mono_metadata_generic_inst_hash (gconstpointer data) MONO_INTERNAL;
658 gboolean       mono_metadata_generic_inst_equal (gconstpointer ka, gconstpointer kb) MONO_INTERNAL;
659
660 void
661 mono_metadata_field_info_with_mempool (
662                                           MonoImage *meta, 
663                                       guint32       table_index,
664                                       guint32      *offset,
665                                       guint32      *rva,
666                                       MonoMarshalSpec **marshal_spec);
667
668 MonoClassField*
669 mono_metadata_get_corresponding_field_from_generic_type_definition (MonoClassField *field) MONO_INTERNAL;
670
671 MonoEvent*
672 mono_metadata_get_corresponding_event_from_generic_type_definition (MonoEvent *event) MONO_INTERNAL;
673
674 MonoProperty*
675 mono_metadata_get_corresponding_property_from_generic_type_definition (MonoProperty *property) MONO_INTERNAL;
676
677 guint32
678 mono_metadata_signature_size (MonoMethodSignature *sig) MONO_INTERNAL;
679
680 guint mono_metadata_str_hash (gconstpointer v1) MONO_INTERNAL;
681
682 gboolean mono_image_load_pe_data (MonoImage *image) MONO_INTERNAL;
683
684 gboolean mono_image_load_cli_data (MonoImage *image) MONO_INTERNAL;
685
686 void mono_image_load_names (MonoImage *image) MONO_INTERNAL;
687
688 MonoImage *mono_image_open_raw (const char *fname, MonoImageOpenStatus *status) MONO_INTERNAL;
689
690 #endif /* __MONO_METADATA_INTERNALS_H__ */
691