CLR 承载接口CLR Hosting Interfaces

本部分描述的接口以及非托管主机可用于将公共语言运行时 (CLR) 集成到其应用程序。This section describes the interfaces that unmanaged hosts can use to integrate the common language runtime (CLR) into their applications. 信息适用于.NET Framework 2.0 版和更高版本。The information pertains to the .NET Framework version 2.0 and later versions. 这些接口使主机能够控制运行时比版本 1.0 和 1.1 中,可能更多方面,并提供 CLR 和主机的执行模型之间更紧密地集成。These interfaces enable the host to control many more aspects of the runtime than was possible in versions 1.0 and 1.1, and provide much tighter integration between the CLR and the host's execution model.

在.NET Framework 1.0 和 1.1 版中,承载模型启用非托管的主机将 CLR 加载到进程,将配置某些设置,以及接收事件通知。In the .NET Framework version 1.0 and 1.1, the hosting model enabled an unmanaged host to load the CLR into a process, to configure certain settings, and to receive event notifications. 但是,一般情况下,在主机和 CLR 独立该在进程中运行。However, in general, the host and the CLR ran independently in that process. 在.NET Framework 2.0 版和更高版本中,新的抽象层让主机提供很多当前由在 Win32 程序集中,类型提供的资源和扩展的主机可以配置的功能集。In the .NET Framework version 2.0 and later versions, new layers of abstraction let the host provide many of the resources currently provided by the types in the Win32 assembly, and extend the set of capabilities that the host can configure.

本节内容In This Section

IActionOnCLREvent 接口IActionOnCLREvent Interface
提供为已注册的事件执行回调的方法。Provides a method that performs a callback for a registered event.

IApartmentCallback 接口IApartmentCallback Interface
提供用于在单元内进行回调方法。Provides methods for making callbacks within an apartment.

IAppDomainBinding 接口IAppDomainBinding Interface
提供用于设置运行时配置方法。Provides methods for setting run-time configuration.

ICatalogServices 接口ICatalogServices Interface
提供用于编录服务的方法。Provides methods for cataloging services. (此接口支持.NET Framework 基础结构,不宜在代码中直接使用。)(This interface supports the .NET Framework infrastructure and is not intended to be used directly from your code.)

ICLRAssemblyIdentityManager 接口ICLRAssemblyIdentityManager Interface
提供用于支持在主机和有关程序集 CLR 之间的通信方法。Provides methods that support communication between the host and the CLR about assemblies.

ICLRAssemblyReferenceList 接口ICLRAssemblyReferenceList Interface
管理由 CLR 而不是主机加载的程序集的列表。Manages a list of assemblies that are loaded by the CLR and not by the host.

ICLRControl 接口ICLRControl Interface
提供主机访问,并配置的 CLR 的各个方面的方法。Provides methods for the host to gain access to, and configure various aspects of, the CLR.

ICLRDebugManager 接口ICLRDebugManager Interface
提供使主机能够将一组任务标识符和友好名称与相关联的方法。Provides methods that enable a host to associate a set of tasks with an identifier and a friendly name.

ICLRErrorReportingManager 接口ICLRErrorReportingManager Interface
提供使主机能够为错误报告配置自定义的堆转储的方法。Provides methods that enable the host to configure custom heap dumps for error reporting.

ICLRGCManager 接口ICLRGCManager Interface
提供使主机能够与 CLR 的垃圾回收系统进行交互的方法。Provides methods that enable a host to interact with the CLR's garbage collection system.

ICLRHostBindingPolicyManager 接口ICLRHostBindingPolicyManager Interface
提供用于主机评估并将程序集的策略信息中的更改通知方法。Provides methods for the host to evaluate and communicate changes in policy information for assemblies.

ICLRHostProtectionManager 接口ICLRHostProtectionManager Interface
使主机可以阻止特定的托管的类、 方法、 属性和字段从部分受信任的代码中运行。Enables the host to block specific managed classes, methods, properties, and fields from running in partially trusted code.

ICLRIoCompletionManager 接口ICLRIoCompletionManager Interface
实现使宿主能够通知指定的输入/输出请求的状态的 CLR 的回调方法。Implements a callback method that enables the host to notify the CLR of the status of specified I/O requests.

ICLRMemoryNotificationCallback 接口ICLRMemoryNotificationCallback Interface
允许宿主来报告内存压力情况使用类似于 Win32 方法CreateMemoryResourceNotification函数。Enables the host to report memory pressure conditions using an approach similar to that of the Win32 CreateMemoryResourceNotification function.

ICLROnEventManager 接口ICLROnEventManager Interface
提供使主机能够注册和注销 CLR 事件的回调的方法。Provides methods that enable the host to register and unregister callbacks for CLR events.

ICLRPolicyManager 接口ICLRPolicyManager Interface
提供使主机能够指定要执行发生故障和超时策略操作的方法。Provides methods that enable the host to specify policy actions to be taken in the event of failures and timeouts.

ICLRProbingAssemblyEnum 接口ICLRProbingAssemblyEnum Interface
提供使主机能够通过使用是内部的 CLR,而无需了解该标识或创建的程序集的标识信息来获取程序集的探测标识的方法。Provides methods that enable the host to get the probing identities of an assembly by using the assembly's identity information that is internal to the CLR, without needing to create or understand that identity.

ICLRReferenceAssemblyEnum 接口ICLRReferenceAssemblyEnum Interface
提供使主机能够操作的文件或使用程序集是内部的 CLR,而无需创建或了解这些标识的标识数据的流由引用的程序集的方法。Provides methods that enable the host to manipulate the set of assemblies referenced by a file or stream using assembly identity data that is internal to the CLR, without needing to create or understand those identities.

ICLRRuntimeHost 接口ICLRRuntimeHost Interface
提供功能类似于ICorRuntimeHost,与其他方法将主机控件接口设置。Provides capabilities similar to ICorRuntimeHost, with an additional method to set the host control interface.

ICLRSyncManager 接口ICLRSyncManager Interface
提供方法以获取有关请求的任务的信息并在其同步实现检测死锁的主机。Provides methods for the host to get information about requested tasks and to detect deadlocks in its synchronization implementation.

ICLRTask 接口ICLRTask Interface
提供一些方法,请启用主机发出请求的 CLR,或向 CLR 有关关联的任务提供通知。Provides methods that enable the host to make requests of the CLR, or to provide notification to the CLR about the associated task.

ICLRTaskManager 接口ICLRTaskManager Interface
提供使主机能够 CLR 创建新任务、 获取当前正在执行的任务,并设置地理语言和任务的区域性显式请求的方法。Provides methods that enable the host to request explicitly that the CLR create a new task, get the currently executing task, and set the geographic language and culture for the task.

ICLRValidator 接口ICLRValidator Interface
提供用于验证可移植可执行 (PE) 映像和报告验证错误的方法。Provides methods for validating portable executable (PE) images and reporting validation errors.

ICorConfiguration 接口ICorConfiguration Interface
提供用于配置 CLR 方法。Provides methods for configuring the CLR.

ICorThreadpool 接口ICorThreadpool Interface
提供用于访问线程池的方法。Provides methods for accessing the thread pool.

IDebuggerInfo 接口IDebuggerInfo Interface
提供用于获取有关调试服务的状态信息的方法。Provides methods for obtaining information about the state of the debugging services.

IDebuggerThreadControl 接口IDebuggerThreadControl Interface
提供用于通知主机有关阻止和取消阻止的线程调试服务的方法。Provides methods for notifying the host about the blocking and unblocking of threads by the debugging services.

IGCHost 接口IGCHost Interface
提供用于获取有关垃圾回收系统的信息以及控制垃圾回收的某些方面的方法。Provides methods for obtaining information about the garbage collection system and for controlling some aspects of garbage collection.

IGCHost2 接口IGCHost2 Interface
提供SetGCStartupLimitsEx方法,使主机设置为值的垃圾回收段的大小和垃圾回收系统生成零的最大大小大于DWORDProvides the SetGCStartupLimitsEx method that enables a host to set the size of the garbage collection segment and the maximum size of the garbage collection system's generation zero to values greater than DWORD.

IGCHostControl 接口IGCHostControl Interface
提供一个方法,使垃圾回收器请求主机后,若要更改的虚拟内存限制。Provides a method that enables the garbage collector to request the host to change the limits of virtual memory.

IGCThreadControl 接口IGCThreadControl Interface
提供用于参与否则会阻止垃圾回收的线程调度的方法。Provides methods for participating in the scheduling of threads that would otherwise be blocked for garbage collection.

IHostAssemblyManager 接口IHostAssemblyManager Interface
提供使主机能够指定的由 CLR 或主机应加载的程序集的方法。Provides methods that enable a host to specify sets of assemblies that should be loaded by the CLR or by the host.

IHostAssemblyStore 接口IHostAssemblyStore Interface
提供使主机能够加载程序集和独立于 CLR 模块的方法。Provides methods that enable a host to load assemblies and modules independently of the CLR.

IHostAutoEvent 接口IHostAutoEvent Interface
提供的表示形式由宿主实现的自动重置事件。Provides a representation of an auto-reset event implemented by the host.

IHostControl 接口IHostControl Interface
提供用于配置加载的程序集,以及用于确定主机支持哪些承载接口方法。Provides methods for configuring the loading of assemblies, and for determining which hosting interfaces the host supports.

IHostCrst 接口IHostCrst Interface
用作主机的表示形式的线程处理关键部分。Serves as the host's representation of a critical section for threading.

IHostGCManager 接口IHostGCManager Interface
提供通知宿主的垃圾回收机制由 CLR 实现中的事件的方法。Provides methods that notify the host of events in the garbage collection mechanism implemented by the CLR.

IHostIoCompletionManager 接口IHostIoCompletionManager Interface
提供启用 CLR 与主机提供的 I/O 完成端口进行交互的方法。Provides methods that enable the CLR to interact with I/O completion ports provided by the host.

IHostMalloc 接口IHostMalloc Interface
提供 CLR 从通过主机堆请求细粒度分配方法。Provides methods for the CLR to request fine-grained allocations from the heap through the host.

IHostManualEvent 接口IHostManualEvent Interface
提供的表示形式的手动重置事件主机的实现。Provides the host's implementation of a representation of a manual reset event.

IHostMemoryManager 接口IHostMemoryManager Interface
提供 CLR 发出通过主机,而不是使用标准 Win32 虚拟内存函数的虚拟内存请求的方法。Provides methods for the CLR to make virtual memory requests through the host, instead of using the standard Win32 virtual memory functions.

IHostPolicyManager 接口IHostPolicyManager Interface
提供通知的 CLR 的情况下将执行的操作主机中止、 超时或失败的方法。Provides methods that notify the host of the actions the CLR performs in case of aborts, timeouts, or failures.

IHostSecurityContext 接口IHostSecurityContext Interface
启用 CLR 能够维护由宿主实现的安全上下文信息。Enables the CLR to maintain security context information implemented by the host.

IHostSecurityManager 接口IHostSecurityManager Interface
提供启用访问,并控制当前正在执行的线程的安全上下文的方法。Provides methods that enable access to, and control over, the security context of the currently executing thread.

IHostSemaphore 接口IHostSemaphore Interface
提供的表示形式由宿主实现的信号量。Provides a representation of a semaphore implemented by the host.

IHostSyncManager 接口IHostSyncManager Interface
提供 CLR 通过调用主机,而不是使用 Win32 同步函数创建同步基元的方法。Provides methods for the CLR to create synchronization primitives by calling the host, instead of using the Win32 synchronization functions.

IHostTask 接口IHostTask Interface
提供启用 CLR 与要管理任务的主机进行通信的方法。Provides methods that enable the CLR to communicate with the host to manage tasks.

IHostTaskManager 接口IHostTaskManager Interface
提供启用 CLR 能够来处理通过主机而不是使用标准操作系统线程处理或纤程函数的任务的方法。Provides methods that enable the CLR to work with tasks through the host instead of using the standard operating system threading or fiber functions.

IHostThreadPoolManager 接口IHostThreadPoolManager Interface
提供 CLR 配置线程池以及排队到线程池工作项的方法。Provides methods for the CLR to configure the thread pool and to queue work items to the thread pool.

IManagedObject 接口IManagedObject Interface
提供用于控制托管的对象的方法。Provides methods for controlling a managed object.

"IObjectHandle""IObjectHandle"
提供用于从间接寻址的寻址封送按值对象的方法。Provides a method for unwrapping marshal-by-value objects from indirection.

ITypeName 接口ITypeName Interface
提供用于获取类型名称信息的方法。Provides methods for obtaining type name information. (此接口支持.NET Framework 基础结构,不宜在代码中直接使用。)(This interface supports the .NET Framework infrastructure and is not intended to be used directly from your code.)

ITypeNameBuilder 接口ITypeNameBuilder Interface
提供用于生成的类型名称的方法。Provides methods for building a type name. (此接口支持.NET Framework 基础结构,不宜在代码中直接使用。)(This interface supports the .NET Framework infrastructure and is not intended to be used directly from your code.)

ITypeNameFactory 接口ITypeNameFactory Interface
提供用于解构类型名称的方法。Provides methods for deconstructing a type name. (此接口支持.NET Framework 基础结构,不宜在代码中直接使用。)(This interface supports the .NET Framework infrastructure and is not intended to be used directly from your code.)

"IValidator""IValidator"
提供用于验证可移植可执行 (PE) 映像和报告验证错误的方法。Provides methods for validating portable executable (PE) images and reporting validation errors.

弃用的 CLR 承接接口和组件类Deprecated CLR Hosting Interfaces and Coclasses
包含描述.NET Framework 1.0 和 1.1 版中提供的托管接口的主题。Contains topics that describe the hosting interfaces provided in the .NET Framework version 1.0 and 1.1.

.NET Framework 4 和 4.5 中添加的 CLR 承载接口CLR Hosting Interfaces Added in the .NET Framework 4 and 4.5
包含描述中提供的托管接口的主题.NET Framework 4.NET Framework 4Contains topics that describe the hosting interfaces provided in the .NET Framework 4.NET Framework 4.