Use the DISABLE_CAS_USE macro instead of MOBILE to disable CAS
authorMarek Habersack <grendel@twistedcode.net>
Tue, 16 Dec 2014 20:30:48 +0000 (21:30 +0100)
committerMarek Safar <marek.safar@gmail.com>
Mon, 2 May 2016 22:07:41 +0000 (00:07 +0200)
This augments commit 7dc4e513eafd3fb30d34111948ef14c981264463

mcs/class/referencesource/System/compmod/system/componentmodel/TypeDescriptor.cs
mcs/class/referencesource/System/misc/SecurityUtils.cs

index 22f7cdc5dec5a5dc5e5d9b78847c97d4f49fd2ee..44ef7f85be6c100ff06d7f50a0b04f4c1dbcd1f2 100644 (file)
@@ -365,7 +365,7 @@ namespace System.ComponentModel
             {
                 throw new ArgumentNullException("type");
             }
-#if !MOBILE
+#if !DISABLE_CAS_USE
             PermissionSet typeDescriptorPermission = new PermissionSet(PermissionState.None);
             typeDescriptorPermission.AddPermission(new TypeDescriptorPermission(TypeDescriptorPermissionFlags.RestrictedRegistrationAccess));
 
@@ -401,7 +401,7 @@ namespace System.ComponentModel
             {
                 throw new ArgumentNullException("instance");
             }
-#if !MOBILE
+#if !DISABLE_CAS_USE
             Type type = instance.GetType();
 
             PermissionSet typeDescriptorPermission = new PermissionSet(PermissionState.None);
@@ -3240,7 +3240,7 @@ namespace System.ComponentModel
             {
                 throw new ArgumentNullException("type");
             }
-#if !MOBILE
+#if !DISABLE_CAS_USE
             PermissionSet typeDescriptorPermission = new PermissionSet(PermissionState.None);
             typeDescriptorPermission.AddPermission(new TypeDescriptorPermission(TypeDescriptorPermissionFlags.RestrictedRegistrationAccess));
 
@@ -3275,7 +3275,7 @@ namespace System.ComponentModel
             {
                 throw new ArgumentNullException("instance");
             }
-#if !MOBILE
+#if !DISABLE_CAS_USE
             Type type = instance.GetType();
 
             PermissionSet typeDescriptorPermission = new PermissionSet(PermissionState.None);
index 5bf155fd382b7a33483d0c9b7d61e3c5ebb56da9..3368922e70cf9468e3b39e7d5f208611b251fd61 100644 (file)
@@ -70,7 +70,7 @@ namespace System.Windows.Forms
 
         [SecuritySafeCritical]
         private static void DemandGrantSet(Assembly assembly) {
-#if !MOBILE
+#if !DISABLE_CAS_USE
             PermissionSet targetGrantSet = assembly.PermissionSet;
             targetGrantSet.AddPermission(RestrictedMemberAccessPermission);
             targetGrantSet.Demand();