IHostSecurityManager Interface

Provides methods that allow access to and control over the security context of the currently executing thread.



IHostSecurityManager::GetSecurityContext Method

Gets the requested IHostSecurityContext from the host.

IHostSecurityManager::ImpersonateLoggedOnUser Method

Requests that code be executed using the credentials of the current user identity.

IHostSecurityManager::OpenThreadToken Method

Opens the discretionary access token associated with the current thread.

IHostSecurityManager::RevertToSelf Method

Terminates impersonation of the current user identity and returns the original thread token.

IHostSecurityManager::SetSecurityContext Method

Sets the security context for the currently executing thread.

IHostSecurityManager::SetThreadToken Method

Sets a handle for the currently executing thread.

A host can control all code access to thread tokens by both the common language runtime (CLR) and user code. It can also ensure that complete security context information is passed across asynchronous operations or code points with restricted code access. IHostSecurityContext encapsulates this security context information, which is opaque to the CLR.

The CLR handles managed thread context internally. It queries the process-specific IHostSecurityManager in the following situations:

  • On the finalizer thread, during finalizer execution.

  • During class and module constructor execution.

  • At asynchronous points on the worker thread, in calls to the IHostThreadPoolManager::QueueUserWorkItem method.

  • In servicing of I/O completion ports.

Platforms: See .NET Framework System Requirements.

Header: MSCorEE.h

Library: Included as a resource in MSCorEE.dll

.NET Framework Versions: 4.6, 4.5.2, 4.5.1, 4.5, 4, 3.5 SP1, 3.5, 3.0 SP1, 3.0, 2.0 SP1, 2.0

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
© 2015 Microsoft