فهرست منبع

Disable more CAS

Marek Safar 10 سال پیش
والد
کامیت
48de084039

+ 16 - 4
mcs/class/referencesource/System.ServiceModel.Internals/System/Runtime/ActionItem.cs

@@ -11,9 +11,11 @@ namespace System.Runtime
 
     abstract class ActionItem
     {
+#if FEATURE_COMPRESSEDSTACK
         [Fx.Tag.SecurityNote(Critical = "Stores the security context, used later in binding back into")]
         [SecurityCritical]
         SecurityContext context;
+#endif
         bool isScheduled;
 
         bool lowPriority;
@@ -76,6 +78,7 @@ namespace System.Runtime
             }
 
             this.isScheduled = true;
+#if FEATURE_COMPRESSEDSTACK
             if (PartialTrustHelpers.ShouldFlowSecurityContext)
             {
                 this.context = PartialTrustHelpers.CaptureSecurityContextNoIdentityFlow();
@@ -85,10 +88,12 @@ namespace System.Runtime
                 ScheduleCallback(CallbackHelper.InvokeWithContextCallback);
             }
             else
+#endif
             {
                 ScheduleCallback(CallbackHelper.InvokeWithoutContextCallback);
             }
         }
+#if FEATURE_COMPRESSEDSTACK
         [Fx.Tag.SecurityNote(Critical = "Access critical field context and critical property " +
             "CallbackHelper.InvokeWithContextCallback, calls into critical method ScheduleCallback; " +
             "since nothing is known about the given context, can't be treated as safe")]
@@ -108,6 +113,8 @@ namespace System.Runtime
             this.context = context.CreateCopy();
             ScheduleCallback(CallbackHelper.InvokeWithContextCallback);
         }
+#endif
+
         [Fx.Tag.SecurityNote(Critical = "Access critical property CallbackHelper.InvokeWithoutContextCallback, " +
             "Calls into critical method ScheduleCallback; not bound to a security context")]
         [SecurityCritical]
@@ -137,7 +144,7 @@ namespace System.Runtime
                 IOThreadScheduler.ScheduleCallbackNoFlow(callback, state);
             }
         }
-
+#if FEATURE_COMPRESSEDSTACK
         [Fx.Tag.SecurityNote(Critical = "Extract the security context stored and reset the critical field")]
         [SecurityCritical]
         SecurityContext ExtractContext()
@@ -148,7 +155,7 @@ namespace System.Runtime
             this.context = null;
             return result;
         }
-
+#endif
         [Fx.Tag.SecurityNote(Critical = "Calls into critical static method ScheduleCallback")]
         [SecurityCritical]
         void ScheduleCallback(Action<object> callback)
@@ -159,12 +166,16 @@ namespace System.Runtime
         [SecurityCritical]
         static class CallbackHelper
         {
+#if FEATURE_COMPRESSEDSTACK
             [Fx.Tag.SecurityNote(Critical = "Stores a delegate to a critical method")]
             static Action<object> invokeWithContextCallback;
+#endif
             [Fx.Tag.SecurityNote(Critical = "Stores a delegate to a critical method")]
             static Action<object> invokeWithoutContextCallback;
             [Fx.Tag.SecurityNote(Critical = "Stores a delegate to a critical method")]
             static ContextCallback onContextAppliedCallback;
+
+#if FEATURE_COMPRESSEDSTACK
             [Fx.Tag.SecurityNote(Critical = "Provides access to a critical field; Initialize it with " +
                 "a delegate to a critical method")]
             public static Action<object> InvokeWithContextCallback
@@ -178,7 +189,7 @@ namespace System.Runtime
                     return invokeWithContextCallback;
                 }
             }
-
+#endif
             [Fx.Tag.SecurityNote(Critical = "Provides access to a critical field; Initialize it with " +
                 "a delegate to a critical method")]
             public static Action<object> InvokeWithoutContextCallback
@@ -205,13 +216,14 @@ namespace System.Runtime
                     return onContextAppliedCallback;
                 }
             }
+#if FEATURE_COMPRESSEDSTACK
             [Fx.Tag.SecurityNote(Critical = "Called by the scheduler without any user context on the stack")]
             static void InvokeWithContext(object state)
             {
                 SecurityContext context = ((ActionItem)state).ExtractContext();
                 SecurityContext.Run(context, OnContextAppliedCallback, state);
             }
-
+#endif
             [Fx.Tag.SecurityNote(Critical = "Called by the scheduler without any user context on the stack")]
             static void InvokeWithoutContext(object state)
             {

+ 2 - 2
mcs/class/referencesource/System.ServiceModel.Internals/System/Runtime/PartialTrustHelpers.cs

@@ -55,7 +55,7 @@ namespace System.Runtime
             }
 #endif
         }
-
+#if FEATURE_COMPRESSEDSTACK
         [Fx.Tag.SecurityNote(Critical = "Captures security context with identity flow suppressed, " +
             "this requires satisfying a LinkDemand for infrastructure.")]
         [SecurityCritical]
@@ -74,7 +74,7 @@ namespace System.Runtime
                 }
             }
         }
-                
+#endif
         [Fx.Tag.SecurityNote(Critical = "used in a security-sensitive decision")]
         [SecurityCritical]
         internal static bool IsTypeAptca(Type type)