New test.
[mono.git] / mono / tests / cas / demand / pinvoke2.cs
index 84452466ed629d070dd743eb07d9d5df0b5b2bab..6e2823e483319605a369f10b2756799529063e02 100644 (file)
@@ -14,17 +14,18 @@ public class Program {
        [DllImport ("kernel32.dll", SetLastError=true)]
        public static extern uint GetTickCount ();
 
-       static bool RunningOnMono ()
+       static bool RunningOnWindows ()
        {
-               bool mono = (Type.GetType ("Mono.Math.BigInteger") != null); 
-               Console.WriteLine ("Running on {0} runtime...", mono ? "Mono" : "Microsoft");
-               return mono;
+               int p = (int) Environment.OSVersion.Platform;
+               bool win = ((p != 4) && (p != 128));
+               Console.WriteLine ("Running on {0}...", Environment.OSVersion);
+               return win;
        }
 
        static int Test ()
        {
                try {
-                       uint u = (RunningOnMono ()) ? getuid () : GetTickCount ();
+                       uint u = (RunningOnWindows () ? GetTickCount () : getuid ());
                        Console.WriteLine ("*1* P/Invoke: {0}", u);
                        return 1;
                }
@@ -38,7 +39,6 @@ public class Program {
                }
        }
 
-       [SecurityPermission (SecurityAction.Deny, UnmanagedCode=true)]
        static int Main ()
        {
                return Test ();