verify.h 1.5 KB

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