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