Merge pull request #3801 from akoeplinger/netstandard20-updates
[mono.git] / mono / metadata / verify.h
1 #ifndef __MONO_METADATA_VERIFY_H__
2 #define __MONO_METADATA_VERIFY_H__
3
4 #include <mono/metadata/metadata.h>
5 #include <mono/metadata/image.h>
6 #include <mono/metadata/loader.h>
7 #include <mono/metadata/class-internals.h>
8 #include <glib.h> /* GSList dep */
9
10 MONO_BEGIN_DECLS
11
12 typedef enum {
13         MONO_VERIFY_OK,
14         MONO_VERIFY_ERROR,
15         MONO_VERIFY_WARNING,
16         MONO_VERIFY_CLS = 4,
17         MONO_VERIFY_ALL = 7,
18
19         /* Status signaling code that is not verifiable.*/
20         MONO_VERIFY_NOT_VERIFIABLE = 8,
21
22         /*OR it with other flags*/
23         
24         /* Abort the verification if the code is not verifiable.
25          * The standard behavior is to abort if the code is not valid.
26          * */
27         MONO_VERIFY_FAIL_FAST = 16,
28
29
30         /* Perform less verification of the code. This flag should be used
31          * if one wants the verifier to be more compatible to the MS runtime.
32          * Mind that this is not to be more compatible with MS peverify, but
33          * with the runtime itself, that has a less strict verifier.
34          */
35         MONO_VERIFY_NON_STRICT = 32,
36
37         /*Skip all visibility related checks*/
38         MONO_VERIFY_SKIP_VISIBILITY = 64,
39
40         /*Skip all visibility related checks*/
41         MONO_VERIFY_REPORT_ALL_ERRORS = 128
42
43 } MonoVerifyStatus;
44
45 typedef struct {
46         char            *message;
47         MonoVerifyStatus status;
48 } MonoVerifyInfo;
49
50 typedef struct {
51         MonoVerifyInfo info;
52         MonoExceptionType exception_type : 8; /*should be one of MONO_EXCEPTION_* */
53 } MonoVerifyInfoExtended;
54
55
56 MONO_API GSList* mono_method_verify       (MonoMethod *method, int level);
57 MONO_API void    mono_free_verify_list    (GSList *list);
58 MONO_API char*   mono_verify_corlib       (void);
59
60 MONO_END_DECLS
61
62 #endif  /* __MONO_METADATA_VERIFY_H__ */
63