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. 此信息适用于2.0 版及更高版本的 .NET Framework。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 通知指定 i/o 请求的状态。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方法,该方法使宿主可以将垃圾回收段的大小和垃圾回收系统的代零的最大大小设置为大于 DWORD的值。Provides 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 中提供的宿主接口的主题。Contains topics that describe the hosting interfaces provided in the .NET Framework 4.