We need you! We're working hard on the next version of Developer Fusion -
Let us know what you think we should be up to!
-
Expand
Microsoft.Win32
-
Expand
Microsoft.Win32.SafeHandles
-
Expand
System
-
Expand
System.Runtime.Hosting
-
Expand
System.Runtime.InteropServices
-
Expand
System.Runtime.CompilerServices
-
Expand
System.Collections
-
Expand
System.Collections.Generic
-
Expand
System.Collections.ObjectModel
-
Expand
System.Configuration.Assemblies
-
Expand
System.Diagnostics
-
Expand
System.Diagnostics.CodeAnalysis
-
Expand
System.Diagnostics.SymbolStore
-
Expand
System.Globalization
-
Expand
System.IO
-
Expand
System.IO.IsolatedStorage
-
Expand
System.Reflection
-
Expand
System.Reflection.Cache
-
Expand
System.Reflection.Emit
-
Expand
System.Resources
-
Expand
System.Runtime
-
Expand
System.Runtime.InteropServices.Expando
-
Expand
System.Runtime.ConstrainedExecution
-
Expand
System.Runtime.Remoting.Activation
-
Expand
System.Runtime.Remoting.Messaging
-
Expand
System.Runtime.Remoting.Channels
-
Expand
System.Runtime.Remoting.Lifetime
-
Expand
System.Runtime.Remoting
-
Expand
System.Runtime.Remoting.Contexts
-
Expand
System.Runtime.Remoting.Proxies
-
Expand
System.Runtime.Remoting.Metadata
-
Expand
System.Runtime.Remoting.Metadata.W3cXsd2001
-
Expand
System.Runtime.Remoting.Services
-
Expand
System.Runtime.Serialization
-
Expand
System.Runtime.Serialization.Formatters
-
Expand
System.Runtime.Serialization.Formatters.Binary
-
Expand
System.Runtime.Versioning
-
Expand
System.Security
-
Expand
System.Security.Cryptography
-
Expand
System.Security.Cryptography.X509Certificates
-
Expand
System.Security.Permissions
-
Expand
System.Security.Policy
-
Expand
System.Security.Principal
-
Expand
System.Security.Util
-
Expand
System.Text
-
Expand
System.Threading
-
Expand
_IOCompletionCallback
-
Expand
_ThreadPoolWaitCallback
-
Expand
_ThreadPoolWaitOrTimerCallback
-
Expand
_TimerCallback
-
Expand
AbandonedMutexException
-
Expand
AsyncFlowControl
-
Expand
AutoResetEvent
-
Expand
CancellationRegion
-
Expand
CancellationSignal
-
Expand
CompressedStack
-
Capture()
-
CheckDemand(CodeAccessPermission, PermissionToken, RuntimeMethodHandle)
-
CheckSetDemand(PermissionSet, RuntimeMethodHandle)
-
CompleteConstruction(CompressedStack)
-
CompressedStack(SafeCompressedStackHandle)
-
CompressedStack(SafeCompressedStackHandle, PermissionListSet)
-
CompressedStack(SerializationInfo, StreamingContext)
-
CompressedStackHandle()
-
CreateCopy()
-
DestroyDCSList(SafeCompressedStackHandle)
-
DestroyDelayedCompressedStack(IntPtr)
-
GetCompressedStack()
-
GetCompressedStack(StackCrawlMark)
-
GetCompressedStackThread()
-
GetDCSCount(SafeCompressedStackHandle)
-
GetDelayedCompressedStack(StackCrawlMark)
-
GetDomainCompressedStack(SafeCompressedStackHandle, int)
-
GetHomogeneousPLS(PermissionListSet)
-
GetObjectData(SerializationInfo, StreamingContext)
-
GetZoneAndOrigin(ArrayList, ArrayList, PermissionToken, PermissionToken)
-
IsImmediateCompletionCandidate(SafeCompressedStackHandle, CompressedStack)
-
PLS()
-
RestoreAppDomainStack(IntPtr)
-
Run(CompressedStack, ContextCallback, object)
-
runFinallyCode(object, bool)
-
runTryCode(object)
-
SetAppDomainStack(CompressedStack)
-
SetCompressedStack(CompressedStack, CompressedStack)
-
SetCompressedStackThread(CompressedStack)
-
Expand
CompressedStackRunData
-
Expand
CompressedStackSwitcher
-
Expand
DomainCompressedStack
-
Expand
EventResetMode
-
Expand
EventWaitHandle
-
Expand
ExceptionType
-
Expand
ExecutionContext
-
Expand
ExecutionContextRunData
-
Expand
ExecutionContextSwitcher
-
Expand
HostExecutionContext
-
Expand
HostExecutionContextManager
-
Expand
HostExecutionContextSwitcher
-
Expand
Interlocked
-
Expand
IUnknownSafeHandle
-
Expand
LockCookie
-
Expand
ManualResetEvent
-
Expand
Monitor
-
Expand
Mutex
-
Expand
MutexCleanupInfo
-
Expand
NativeOverlapped
-
Expand
Overlapped
-
Expand
OverlappedData
-
Expand
OverlappedDataCache
-
Expand
OverlappedDataCacheLine
-
Expand
ReaderWriterLock
-
Expand
RegisteredWaitHandle
-
Expand
RegisteredWaitHandleSafe
-
Expand
SafeCompressedStackHandle
-
Expand
Semaphore
-
Expand
SemaphoreFullException
-
Expand
StackCrawlMark
-
Expand
SynchronizationContext
-
Expand
SynchronizationContextProperties
-
Expand
SynchronizationContextSwitcher
-
Expand
SynchronizationLockException
-
Expand
Thread
-
Expand
ThreadAbortException
-
Expand
ThreadHelper
-
Expand
ThreadInterruptedException
-
Expand
ThreadPool
-
Expand
ThreadPriority
-
Expand
ThreadStartException
-
Expand
ThreadState
-
Expand
ThreadStateException
-
Expand
Timeout
-
Expand
Timer
-
Expand
TimerBase
-
Expand
WaitHandle
-
Expand
WaitHandleCannotBeOpenedException
-
Expand
System.Runtime.Remoting.Channels.Http
-
Expand
System.Runtime.Remoting.Channels.Tcp
-
Expand
System.Runtime.Remoting.MetadataServices
-
Expand
System.Runtime.Serialization.Formatters.Soap.Xml
-
Expand
System.Runtime.Serialization.Formatters.Soap
-
Expand
Microsoft.Tools.Caspol
-
Expand
Microsoft.Tools.Build
-
Expand
Microsoft.CSharp
-
Expand
System.CodeDom
-
Expand
System.CodeDom.Compiler
-
Expand
System.Collections.Specialized
-
Expand
System.ComponentModel
-
Expand
System.ComponentModel.Design
-
Expand
System.ComponentModel.Design.Serialization
-
Expand
System.Configuration
-
Expand
System.Web
-
Expand
System.Configuration.Provider
-
Expand
System.Configuration.Internal
-
Expand
System.Internal
-
Expand
System.Windows.Forms
-
Expand
System.Net
-
Expand
System.Net.Sockets
-
Expand
System.Net.NetworkInformation
-
Expand
System.Net.ComImports
-
Expand
System.Net.Security
-
Expand
System.Net.Cache
-
Expand
System.Net.Configuration
-
Expand
System.Text.RegularExpressions
-
Expand
System.Tools
-
Expand
System.IO.Compression
-
Expand
System.IO.Ports
-
Expand
System.Security.AccessControl
-
Expand
System.Xml
-
Expand
System.Xml.XPath.DataBinding
-
Expand
System.Xml.Schema
-
Expand
System.Xml.Serialization
-
Expand
System.Xml.Serialization.Advanced
-
Expand
System.Xml.Serialization.Configuration
-
Expand
System.Xml.XPath
-
Expand
System.Xml.Xsl
-
Expand
System.Xml.Xsl.IlGen
-
Expand
System.Xml.Xsl.Qil
-
Expand
System.Xml.Xsl.Runtime
-
Expand
System.Xml.Xsl.XPath
-
Expand
System.Xml.Xsl.Xslt
-
Expand
System.Xml.Xsl.XsltOld
-
Expand
System.Xml.Xsl.XsltOld.Debugger
-
Expand
Microsoft.JScript
-
Expand
Microsoft.Vsa
-
Expand
Microsoft.JScript.Vsa
- namespace System.Threading
- {
- using System.Security;
- using System.Security.Permissions;
- using System.Runtime.InteropServices;
- using System.Runtime.CompilerServices;
- using System.Runtime.ConstrainedExecution;
- using System.Reflection;
- using System.Collections;
- using System.Threading;
- using System.Runtime.Serialization;
-
-
- internal struct CompressedStackSwitcher : IDisposable
- {
- internal CompressedStack curr_CS;
- internal CompressedStack prev_CS;
- internal IntPtr prev_ADStack;
-
-
- public override bool Equals(object obj)
- {
- if (obj == null || !(obj is CompressedStackSwitcher))
- return false;
- CompressedStackSwitcher sw = (CompressedStackSwitcher)obj;
- return (this.curr_CS == sw.curr_CS && this.prev_CS == sw.prev_CS && this.prev_ADStack == sw.prev_ADStack);
- }
-
- public override int GetHashCode()
- {
- return ToString().GetHashCode();
- }
-
- public static bool operator ==(CompressedStackSwitcher c1, CompressedStackSwitcher c2)
- {
- return c1.Equals(c2);
- }
-
- public static bool operator !=(CompressedStackSwitcher c1, CompressedStackSwitcher c2)
- {
- return !c1.Equals(c2);
- }
- /// <internalonly/>
- void IDisposable.Dispose()
- {
- Undo();
- }
-
- [ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)]
- internal bool UndoNoThrow()
- {
- try {
- Undo();
- }
- catch {
- return false;
- }
- return true;
- }
-
-
- [ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)]
- public void Undo()
- {
- if (curr_CS == null && prev_CS == null)
- return;
- if (prev_ADStack != (IntPtr)0)
- CompressedStack.RestoreAppDomainStack(prev_ADStack);
- CompressedStack.SetCompressedStackThread(prev_CS);
-
- prev_CS = null;
- curr_CS = null;
- prev_ADStack = (IntPtr)0;
- }
- }
-
- internal class SafeCompressedStackHandle : SafeHandle
- {
- public SafeCompressedStackHandle() : base(IntPtr.Zero, true)
- {
- }
-
- public override bool IsInvalid {
- get { return handle == IntPtr.Zero; }
- }
-
- protected override bool ReleaseHandle()
- {
- CompressedStack.DestroyDelayedCompressedStack(handle);
- handle = IntPtr.Zero;
- return true;
- }
- }
-
-
-
- [Serializable()]
- public sealed class CompressedStack : ISerializable
- {
-
- private PermissionListSet m_pls;
- private SafeCompressedStackHandle m_csHandle;
-
-
- internal PermissionListSet PLS {
- get { return m_pls; }
- }
-
- internal CompressedStack(SafeCompressedStackHandle csHandle)
- {
- m_csHandle = csHandle;
- }
-
- private CompressedStack(SafeCompressedStackHandle csHandle, PermissionListSet pls)
- {
- this.m_csHandle = csHandle;
- this.m_pls = pls;
- }
-
- [SecurityPermissionAttribute(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.SerializationFormatter)]
- public void GetObjectData(SerializationInfo info, StreamingContext context)
- {
- if (info == null)
- throw new ArgumentNullException("info");
- CompleteConstruction(null);
- info.AddValue("PLS", this.m_pls);
- }
-
- private CompressedStack(SerializationInfo info, StreamingContext context)
- {
- this.m_pls = (PermissionListSet)info.GetValue("PLS", typeof(PermissionListSet));
- }
-
- internal SafeCompressedStackHandle CompressedStackHandle {
- [ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
- get { return m_csHandle; }
- }
-
- [StrongNameIdentityPermissionAttribute(SecurityAction.LinkDemand, PublicKey = "0x00000000000000000400000000000000"), SecurityPermissionAttribute(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.UnmanagedCode)]
- public static CompressedStack GetCompressedStack()
- {
-
- StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller;
- return CompressedStack.GetCompressedStack(ref stackMark);
- }
-
- static internal CompressedStack GetCompressedStack(ref StackCrawlMark stackMark)
- {
- CompressedStack cs;
- CompressedStack innerCS = null;
- if (CodeAccessSecurityEngine.QuickCheckForAllDemands()) {
- cs = new CompressedStack(null);
- }
- else if (CodeAccessSecurityEngine.AllDomainsHomogeneousWithNoStackModifiers()) {
- cs = new CompressedStack(null);
- cs.m_pls = PermissionListSet.CreateCompressedState_HG();
- }
- else {
-
- cs = new CompressedStack(GetDelayedCompressedStack(ref stackMark));
- if (cs.CompressedStackHandle != null && IsImmediateCompletionCandidate(cs.CompressedStackHandle, out innerCS)) {
- cs.CompleteConstruction(innerCS);
- DestroyDCSList(cs.CompressedStackHandle);
- }
- }
- return cs;
- }
-
- public static CompressedStack Capture()
- {
- StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller;
- return GetCompressedStack(ref stackMark);
- }
-
- [SecurityPermissionAttribute(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.Infrastructure), DynamicSecurityMethodAttribute()]
- public static void Run(CompressedStack compressedStack, ContextCallback callback, object state)
- {
-
- if (compressedStack == null) {
- throw new ArgumentException(Environment.GetResourceString("Arg_NamedParamNull"), "compressedStack");
- }
- if (cleanupCode == null) {
- tryCode = new RuntimeHelpers.TryCode(runTryCode);
- cleanupCode = new RuntimeHelpers.CleanupCode(runFinallyCode);
- }
-
- CompressedStackRunData runData = new CompressedStackRunData(compressedStack, callback, state);
- RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(tryCode, cleanupCode, runData);
- }
-
- internal class CompressedStackRunData
- {
- internal CompressedStack cs;
- internal ContextCallback callBack;
- internal object state;
- internal CompressedStackSwitcher cssw;
- internal CompressedStackRunData(CompressedStack cs, ContextCallback cb, object state)
- {
- this.cs = cs;
- this.callBack = cb;
- this.state = state;
- this.cssw = new CompressedStackSwitcher();
- }
- }
- static internal void runTryCode(object userData)
- {
- CompressedStackRunData rData = (CompressedStackRunData)userData;
- rData.cssw = SetCompressedStack(rData.cs, GetCompressedStackThread());
- rData.callBack(rData.state);
-
- }
-
- [PrePrepareMethod()]
- static internal void runFinallyCode(object userData, bool exceptionThrown)
- {
- CompressedStackRunData rData = (CompressedStackRunData)userData;
- rData.cssw.Undo();
- }
-
- static internal RuntimeHelpers.TryCode tryCode;
- static internal RuntimeHelpers.CleanupCode cleanupCode;
-
-
- static internal CompressedStackSwitcher SetCompressedStack(CompressedStack cs, CompressedStack prevCS)
- {
- CompressedStackSwitcher cssw = new CompressedStackSwitcher();
- RuntimeHelpers.PrepareConstrainedRegions();
- try {
-
-
- RuntimeHelpers.PrepareConstrainedRegions();
- try {
-
- }
- finally {
-
- SetCompressedStackThread(cs);
- cssw.prev_CS = prevCS;
- cssw.curr_CS = cs;
- cssw.prev_ADStack = SetAppDomainStack(cs);
- }
- }
- catch {
- cssw.UndoNoThrow();
- throw;
-
- }
- return cssw;
- }
-
-
- [ComVisible(false)]
- public CompressedStack CreateCopy()
- {
- return new CompressedStack(this.m_csHandle, this.m_pls);
- }
-
- [ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
- static internal IntPtr SetAppDomainStack(CompressedStack cs)
- {
-
- return Thread.CurrentThread.SetAppDomainStack((cs == null ? null : cs.CompressedStackHandle));
- }
-
-
- [ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
- static internal void RestoreAppDomainStack(IntPtr appDomainStack)
- {
- Thread.CurrentThread.RestoreAppDomainStack(appDomainStack);
-
- }
- static internal CompressedStack GetCompressedStackThread()
- {
- ExecutionContext ec = Thread.CurrentThread.GetExecutionContextNoCreate();
- if (ec != null && ec.SecurityContext != null)
- return ec.SecurityContext.CompressedStack;
- return null;
- }
- [ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)]
- static internal void SetCompressedStackThread(CompressedStack cs)
- {
- ExecutionContext ec = Thread.CurrentThread.ExecutionContext;
- if (ec.SecurityContext != null)
- ec.SecurityContext.CompressedStack = cs;
- else if (cs != null) {
- SecurityContext sc = new SecurityContext();
- sc.CompressedStack = cs;
- ec.SecurityContext = sc;
- }
- }
-
-
- internal bool CheckDemand(CodeAccessPermission demand, PermissionToken permToken, RuntimeMethodHandle rmh)
- {
- CompleteConstruction(null);
-
- if (PLS == null)
- return SecurityRuntime.StackHalt;
- else
- return PLS.CheckDemand(demand, permToken, rmh);
-
- }
-
- internal bool CheckSetDemand(PermissionSet pset, RuntimeMethodHandle rmh)
- {
- CompleteConstruction(null);
-
- if (PLS == null)
- return SecurityRuntime.StackHalt;
- else
- return PLS.CheckSetDemand(pset, rmh);
- }
-
-
- internal void GetZoneAndOrigin(ArrayList zoneList, ArrayList originList, PermissionToken zoneToken, PermissionToken originToken)
- {
-
-
- CompleteConstruction(null);
- if (PLS != null)
- PLS.GetZoneAndOrigin(zoneList, originList, zoneToken, originToken);
- return;
- }
-
- internal void CompleteConstruction(CompressedStack innerCS)
- {
- if (PLS != null)
- return;
- PermissionListSet pls = PermissionListSet.CreateCompressedState(this, innerCS);
- lock (this) {
- if (PLS == null)
- m_pls = pls;
- }
- }
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- static internal extern SafeCompressedStackHandle GetDelayedCompressedStack(ref StackCrawlMark stackMark);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- static internal extern void DestroyDelayedCompressedStack(IntPtr unmanagedCompressedStack);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- static internal extern void DestroyDCSList(SafeCompressedStackHandle compressedStack);
-
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- static internal extern int GetDCSCount(SafeCompressedStackHandle compressedStack);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- static internal extern bool IsImmediateCompletionCandidate(SafeCompressedStackHandle compressedStack, out CompressedStack innerCS);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- static internal extern DomainCompressedStack GetDomainCompressedStack(SafeCompressedStackHandle compressedStack, int index);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- static internal extern void GetHomogeneousPLS(PermissionListSet hgPLS);
-
-
- }
-
-
-
-
- [Serializable()]
- internal sealed class DomainCompressedStack
- {
-
- private PermissionListSet m_pls;
-
- private bool m_bHaltConstruction;
-
-
-
-
- internal PermissionListSet PLS {
- get { return m_pls; }
- }
-
- internal bool ConstructionHalted {
- get { return m_bHaltConstruction; }
- }
-
-
-
-
- private static DomainCompressedStack CreateManagedObject(IntPtr unmanagedDCS)
- {
- DomainCompressedStack newDCS = new DomainCompressedStack();
- newDCS.m_pls = PermissionListSet.CreateCompressedState(unmanagedDCS, out newDCS.m_bHaltConstruction);
-
- return newDCS;
- }
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- static internal extern int GetDescCount(IntPtr dcs);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- static internal extern void GetDomainPermissionSets(IntPtr dcs, out PermissionSet granted, out PermissionSet refused);
-
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- static internal extern bool GetDescriptorInfo(IntPtr dcs, int index, out PermissionSet granted, out PermissionSet refused, out Assembly assembly, out FrameSecurityDescriptor fsd);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- static internal extern bool IgnoreDomain(IntPtr dcs);
- }
-
- }