mscorlib 2.0.0.0 4.0.0.0 System.Object System.IDisposable

A object captures all security-related information for a logical thread, including the information contained in the and objects. This configuration allows the Windows identity and the security elements on the stack to be propagated automatically when the is copied and transferred across asynchronous threads.

The common language runtime (CLR) is aware of impersonation operations performed using only managed code, not of impersonation performed outside of managed code, such as through platform invoke to unmanaged code or through direct calls to Win32 functions. Only managed objects can flow across asynchronous points, unless the alwaysFlowImpersonationPolicy element has been set to true (<alwaysFlowImpersonationPolicy enabled="true"/>). Setting the alwaysFlowImpersonationPolicy element to true specifies that the Windows identity always flows across asynchronous points, regardless of how impersonation was performed. For more information about flowing unmanaged impersonation across asynchronous points, see <alwaysFlowImpersonationPolicy> Element.

The is part of the larger and flows or migrates when the flows or migrates.

Encapsulates and propagates all security-related data for execution contexts transferred across threads. This class cannot be inherited.

- Method
  2.0.0.0
  4.0.0.0
  System.Security.SecurityContext

  The captured security context can be applied to another thread. The consists of the and the for the executing thread.

  Captures the security context for the current thread.

  The security context for the current thread.

- Method
  2.0.0.0
  4.0.0.0
  System.Security.SecurityContext

  The current context must have been acquired through a capture or a copy operation. This method is useful for applying a captured to multiple threads.

  Creates a copy of the current security context.

  The security context for the current thread.

- Method
  4.0.0.0
  System.Void

  Call Dispose when you are finished using the . The Dispose method leaves the in an unusable state. After calling Dispose, you must release all references to the so the garbage collector can reclaim the memory that the was occupying.

  For more information, see Cleaning Up Unmanaged Resources and Implementing a Dispose Method.

  Always call Dispose before you release your last reference to the . Otherwise, the resources it is using will not be freed until the garbage collector calls the object's Finalize method.

  Releases all resources used by the current instance of the class.

- Method
  2.0.0.0
  4.0.0.0
  System.Boolean

  The method is used by infrastructure components to determine whether to transfer the information during asynchronous operations.

  Determines whether the flow of the security context has been suppressed.

  true if the flow has been suppressed; otherwise, false.

- Method
  2.0.0.0
  4.0.0.0
  System.Boolean

  The method is used by infrastructure components to determine whether to transfer the Windows identity information when the migrates during asynchronous operations.

  Determines whether the flow of the Windows identity portion of the current security context has been suppressed.

  true if the flow has been suppressed; otherwise, false.

- Method
  2.0.0.0
  4.0.0.0
  System.Void

  The method is called by the method to reverse the effect of a prior method call.

  Restores the flow of the security context across asynchronous threads.

- Method
  2.0.0.0
  4.0.0.0
  System.Void `` `` ``

  The security context for the current thread is returned to its previous state when the method call is complete.

  Runs the specified method in the specified security context on the current thread.

  The security context to set. The delegate that represents the method to run in the specified security context. The object to pass to the callback method.
- Method
  2.0.0.0
  4.0.0.0
  System.Threading.AsyncFlowControl

  Use this method to suppress the flow of information on the current thread for asynchronous operations.

  The common language runtime (CLR) is only aware of the impersonation operations performed using managed code. The CLR has no knowledge of impersonation performed outside of managed code, such as platform invokes to unmanaged code that does the impersonation, or through calls to Win32 functions. To flow identity across asynchronous points you must use the managed and methods.

  Use the method on the returned structure to return the object to its previous state.

  This method is protected with a for permission. A fully trusted component can call this method to suppress the flow of the information during asynchronous calls. When the flow is suppressed, the method returns null.

  Suppresses the flow of the security context across asynchronous threads.

  An structure for restoring the flow.

- Method
  2.0.0.0
  4.0.0.0
  System.Threading.AsyncFlowControl

  Use this method to suppress the flow of the Windows identity when the migrates across asynchronous threads.

  Use the method on the returned structure to return the object to its previous state.

  The common language runtime (CLR) is aware of impersonation operations performed using only managed code, not of impersonation performed outside of managed code, such as through platform invoke to unmanaged code or through direct calls to Win32 functions. Only managed objects can flow across asynchronous points, unless the alwaysFlowImpersonationPolicy element has been set to true (<alwaysFlowImpersonationPolicy enabled="true"/>). Setting the alwaysFlowImpersonationPolicy element to true specifies that the Windows identity always flows across asynchronous points, regardless of how impersonation was performed. For more information about flowing unmanaged impersonation across asynchronous points, see <alwaysFlowImpersonationPolicy> Element.

  Suppresses the flow of the Windows identity portion of the current security context across asynchronous threads.

  A structure for restoring the flow.