System.Security.SecurityRuntime.AssertAllPossible C# (CSharp) Method

AssertAllPossible() static private method

static private AssertAllPossible ( System.Threading.StackCrawlMark &stackMark ) : void
stackMark System.Threading.StackCrawlMark
return void
        internal static void AssertAllPossible(ref StackCrawlMark stackMark)
        {
            FrameSecurityDescriptor secObj =
                SecurityRuntime.GetSecurityObjectForFrame(ref stackMark, true);
    
            BCLDebug.Assert(secObj != null || !SecurityManager._IsSecurityOn(),"Failure in SecurityRuntime.AssertAllPossible() - secObj != null");
            if (secObj == null)
            {
                if (SecurityManager._IsSecurityOn())
                    // Security: REQ_SQ flag is missing. Bad compiler ?
                    throw new ExecutionEngineException( Environment.GetResourceString( "ExecutionEngine_MissingSecurityDescriptor" ) );
            }
            else
            {
                if (secObj.GetAssertAllPossible())
                    throw new SecurityException( Environment.GetResourceString( "Security_MustRevertOverride" ) );

                secObj.SetAssertAllPossible();
            }
        }
    

Usage Example

Beispiel #1
0
        static internal void AssertAllPossible()
        {
            SecurityRuntime isr = SecurityManager.GetSecurityRuntime();

            if (isr != null)
            {
                StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller;
                isr.AssertAllPossible(ref stackMark);
            }
        }
All Usage Examples Of System.Security.SecurityRuntime::AssertAllPossible