X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mono%2Fmetadata%2Fsecurity-core-clr.h;h=96407dadf282cc6630f7e99f7045be140568d9be;hb=45b28d0324a9dcc1ec78bfe423c290a410eff15f;hp=595c04c2e450e0a8eff6fe71e2bec57a3ec41576;hpb=95446aaeca9797b936883efc94a96433bc79455b;p=mono.git diff --git a/mono/metadata/security-core-clr.h b/mono/metadata/security-core-clr.h index 595c04c2e45..96407dadf28 100644 --- a/mono/metadata/security-core-clr.h +++ b/mono/metadata/security-core-clr.h @@ -4,7 +4,7 @@ * Author: * Mark Probst * - * (C) 2007 Novell, Inc + * (C) 2007, 2010 Novell, Inc */ #ifndef _MONO_METADATA_SECURITY_CORE_CLR_H_ @@ -20,15 +20,45 @@ typedef enum { MONO_SECURITY_CORE_CLR_CRITICAL } MonoSecurityCoreCLRLevel; +typedef enum { + //The following flags can be used in combination, and control specific behaviour of the CoreCLR securit system. + + //Default coreclr behaviour, as used in moonlight. + MONO_SECURITY_CORE_CLR_OPTIONS_DEFAULT = 0, + + //Allow transparent code to execute methods and access fields that are not in platformcode, + //even if those methods and fields are private or otherwise not visible to the calling code. + MONO_SECURITY_CORE_CLR_OPTIONS_RELAX_REFLECTION = 1, + + //Allow delegates to be created that point at methods that are not in platformcode, + //even if those methods and fields are private or otherwise not visible to the calling code. + MONO_SECURITY_CORE_CLR_OPTIONS_RELAX_DELEGATE = 2 +} MonoSecurityCoreCLROptions; + extern gboolean mono_security_core_clr_test; +extern void mono_security_core_clr_check_inheritance (MonoClass *class) MONO_INTERNAL; +extern void mono_security_core_clr_check_override (MonoClass *class, MonoMethod *override, MonoMethod *base) MONO_INTERNAL; + extern void mono_security_core_clr_ensure_reflection_access_field (MonoClassField *field) MONO_INTERNAL; extern void mono_security_core_clr_ensure_reflection_access_method (MonoMethod *method) MONO_INTERNAL; +extern gboolean mono_security_core_clr_ensure_delegate_creation (MonoMethod *method, gboolean throwOnBindFailure) MONO_INTERNAL; extern MonoException* mono_security_core_clr_ensure_dynamic_method_resolved_object (gpointer ref, MonoClass *handle_class) MONO_INTERNAL; +extern gboolean mono_security_core_clr_can_access_internals (MonoImage *accessing, MonoImage* accessed) MONO_INTERNAL; + +extern MonoException* mono_security_core_clr_is_field_access_allowed (MonoMethod *caller, MonoClassField *field) MONO_INTERNAL; +extern MonoException* mono_security_core_clr_is_call_allowed (MonoMethod *caller, MonoMethod *callee) MONO_INTERNAL; + extern MonoSecurityCoreCLRLevel mono_security_core_clr_class_level (MonoClass *class) MONO_INTERNAL; extern MonoSecurityCoreCLRLevel mono_security_core_clr_method_level (MonoMethod *method, gboolean with_class_level) MONO_INTERNAL; extern gboolean mono_security_core_clr_is_platform_image (MonoImage *image) MONO_INTERNAL; +extern gboolean mono_security_core_clr_determine_platform_image (MonoImage *image) MONO_INTERNAL; + +extern gboolean mono_security_core_clr_require_elevated_permissions (void); + +extern void mono_security_core_clr_set_options (MonoSecurityCoreCLROptions options); +extern MonoSecurityCoreCLROptions mono_security_core_clr_get_options (void); #endif /* _MONO_METADATA_SECURITY_CORE_CLR_H_ */