Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

change documentation to be in the right format for public api, and do…

…cument the meaning of the different enum values.
  • Loading branch information...
commit e045ceaf34217e48da3f08afba7fd064c153c681 1 parent ff691ff
Lucas Meijer authored Sebastien Pouliot committed
View
28 mono/metadata/security-core-clr.c
@@ -411,13 +411,23 @@ mono_security_core_clr_require_elevated_permissions (void)
static MonoSecurityCoreCLROptions security_core_clr_options = MONO_SECURITY_CORE_CLR_OPTIONS_DEFAULT;
-/*
- * mono_security_core_clr_set_options
+/**
+ * mono_security_core_clr_set_options:
+ * @options: the new options for the coreclr system to use
+ *
+ * By default, the CoreCLRs security model forbids execution trough reflection of methods not visible from the calling code.
+ * Even if the method being called is not in a platform assembly. For non moonlight CoreCLR users this restriction does not
+ * make a lot of sense, since the author could have just changed the non platform assembly to allow the method to be called.
+ * This function allows specific relaxations from the default behaviour to be set.
+ *
+ * Use MONO_SECURITY_CORE_CLR_OPTIONS_DEFAULT for the default coreclr coreclr behaviour as used in Moonlight.
+ *
+ * Use MONO_SECURITY_CORE_CLR_OPTIONS_RELAX_REFLECTION to 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.
+ *
+ * Use MONO_SECURITY_CORE_CLR_OPTIONS_RELAX_DELEGATE to 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.
*
- * By default, the CoreCLRs security model forbids execution trough reflection of methods not visible from the calling code.
- * Even if the method being called is not in a platform assembly. For non moonlight CoreCLR users this restriction does not
- * make a lot of sense, since the author could have just changed the non platform assembly to allow the method to be called.
- * this function allows specific relaxations from the default behaviour to be set.
*/
void
@@ -425,6 +435,12 @@ mono_security_core_clr_set_options (MonoSecurityCoreCLROptions options) {
security_core_clr_options = options;
}
+/**
+ * mono_security_core_clr_get_options:
+ *
+ * Retrieves the current options used by the coreclr system.
+ */
+
MonoSecurityCoreCLROptions
mono_security_core_clr_get_options ()
{
View
11 mono/metadata/security-core-clr.h
@@ -21,9 +21,18 @@ typedef enum {
} 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,
- MONO_SECURITY_CORE_CLR_OPTIONS_RELAX_DELEGATE = 2,
+
+ //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;
Please sign in to comment.
Something went wrong with that request. Please try again.