AssertAllPossible() static private method

static private AssertAllPossible ( System.Threading.StackCrawlMark &stackMark ) : void
stackMark System.Threading.StackCrawlMark
return void
Beispiel #1
0
        static internal void AssertAllPossible()
        {
            SecurityRuntime isr = SecurityManager.GetSecurityRuntime();

            if (isr != null)
            {
                StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller;
                isr.AssertAllPossible(ref stackMark);
            }
        }
Beispiel #2
0
        [MethodImplAttribute(MethodImplOptions.NoInlining)] // Methods containing StackCrawlMark local var has to be marked non-inlineable
        static internal void Assert(bool allPossible)
        {
            //    The intent of the method is to be an internal mscorlib helper that easily asserts for all possible permissions
            //    without having to new a PermissionSet.
            //    The security annotation fxcop rule that flags all methods with an Assert() has logic
            //    which checks for methods named Assert in types that implement IPermission or IStackWalk.
            Debug.Assert(new StackFrame().GetMethod().Name.Equals("Assert"), "This method needs to be named Assert");

            StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller;

            SecurityRuntime.AssertAllPossible(ref stackMark);
        }
        static internal void AssertAllPossible()
        {
            StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller;

            SecurityRuntime.AssertAllPossible(ref stackMark);
        }
Beispiel #4
0
        internal static void Assert(bool allPossible)
        {
            StackCrawlMark lookForMyCaller = StackCrawlMark.LookForMyCaller;

            SecurityRuntime.AssertAllPossible(ref lookForMyCaller);
        }