Skip to content

Commit

Permalink
[corlib] Disable core security icalls on mobile
Browse files Browse the repository at this point in the history
  • Loading branch information
marek-safar committed Apr 23, 2016
1 parent 55b3ef6 commit aad627c
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 1 deletion.
9 changes: 8 additions & 1 deletion mcs/class/corlib/ReferenceSources/RuntimeType.cs
Expand Up @@ -602,6 +602,12 @@ bool IsGenericCOMObjectImpl ()
get;
}

#if MOBILE
static int get_core_clr_security_level ()
{
return 1;
}
#else
//seclevel { transparent = 0, safe-critical = 1, critical = 2}
[MethodImplAttribute(MethodImplOptions.InternalCall)]
public extern int get_core_clr_security_level ();
Expand All @@ -616,6 +622,7 @@ bool IsGenericCOMObjectImpl ()

public override bool IsSecuritySafeCritical {
get { return get_core_clr_security_level () == 1; }
}
}
#endif
}
}
7 changes: 7 additions & 0 deletions mcs/class/corlib/System.Reflection/MonoField.cs
Expand Up @@ -296,6 +296,12 @@ internal MonoField Clone (string newName)
throw new InvalidOperationException ("Late bound operations cannot be performed on fields with types for which Type.ContainsGenericParameters is true.");
}

#if MOBILE
static int get_core_clr_security_level ()
{
return 1;
}
#else
//seclevel { transparent = 0, safe-critical = 1, critical = 2}
[MethodImplAttribute(MethodImplOptions.InternalCall)]
public extern int get_core_clr_security_level ();
Expand All @@ -311,5 +317,6 @@ internal MonoField Clone (string newName)
public override bool IsSecuritySafeCritical {
get { return get_core_clr_security_level () == 1; }
}
#endif
}
}
14 changes: 14 additions & 0 deletions mcs/class/corlib/System.Reflection/MonoMethod.cs
Expand Up @@ -502,9 +502,16 @@ public override MethodInfo GetGenericMethodDefinition ()
return CustomAttributeData.GetCustomAttributes (this);
}

#if MOBILE
static int get_core_clr_security_level ()
{
return 1;
}
#else
//seclevel { transparent = 0, safe-critical = 1, critical = 2}
[MethodImplAttribute(MethodImplOptions.InternalCall)]
public extern int get_core_clr_security_level ();
#endif

public override bool IsSecurityTransparent {
get { return get_core_clr_security_level () == 0; }
Expand Down Expand Up @@ -752,8 +759,15 @@ public override Object Invoke (BindingFlags invokeAttr, Binder binder, Object[]
return CustomAttributeData.GetCustomAttributes (this);
}

#if MOBILE
static int get_core_clr_security_level ()
{
return 1;
}
#else
[MethodImplAttribute(MethodImplOptions.InternalCall)]
public extern int get_core_clr_security_level ();
#endif

public override bool IsSecurityTransparent {
get { return get_core_clr_security_level () == 0; }
Expand Down

0 comments on commit aad627c

Please sign in to comment.