2 using System.Runtime.CompilerServices;
4 using System.Security.Permissions;
6 [assembly: SecurityPermission (SecurityAction.RequestRefuse, UnmanagedCode=true)]
10 // this is a "public" internal call for both Mono and Microsoft
11 // http://groups.google.ca/groups?q=MethodImplAttribute+InternalCall&hl=en&lr=&selm=udngxsETCHA.1468%40tkmsftngp11&rnum=10
14 [MethodImplAttribute (MethodImplOptions.InternalCall)]
15 public static extern double Sin (double a);
19 public class Program {
21 static int TestICall ()
23 return (int) System.Math.Sin (0);
29 Console.WriteLine ("*0* System.Math.Sin(0) == {0}", TestICall ());
32 catch (SecurityException se) {
33 Console.WriteLine ("*1* SecurityException\n{0}", se);
37 Console.WriteLine ("*2* Unexpected exception\n{0}", e);