public static CompressedStack GetCompressedStack()
        {
            StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller;

            if (SecurityManager.SecurityEnabled)
            {
                return(new CompressedStack(CodeAccessSecurityEngine.GetDelayedCompressedStack(ref stackMark)));
            }
            else
            {
                return(new CompressedStack((IntPtr)0));
            }
        }
Esempio n. 2
0
        unsafe public NativeOverlapped *Pack(IOCompletionCallback iocb)
        {
            NativeOverlapped *nativeOverlappedPtr = AllocNativeOverlapped();
            StackCrawlMark    stackMark           = StackCrawlMark.LookForMyCaller;

            if (SecurityManager.SecurityEnabled)
            {
                (*nativeOverlappedPtr).ReservedCOR3 = CodeAccessSecurityEngine.GetDelayedCompressedStack(ref stackMark);
            }
            else
            {
                (*nativeOverlappedPtr).ReservedCOR3 = (IntPtr)null;
            }
            PackCore(nativeOverlappedPtr, iocb);
            return(nativeOverlappedPtr);
        }