ICorRuntimeHost::CreateEvidence 方法ICorRuntimeHost::CreateEvidence Method

获取类型的接口指针 System.Security.Principal.IIdentity ,该指针允许主机创建要传递给CreateDomainCreateDomainEx方法的安全证据。Gets an interface pointer of type System.Security.Principal.IIdentity, which allows the host to create security evidence to pass to the CreateDomain or CreateDomainEx method.


HRESULT CreateEvidence (  
    [out] IUnknown** pEvidence  


弄一个接口指针,指向 System.Security.Principal.IIdentity 用于创建安全证据的实例。[out] A interface pointer to an System.Security.Principal.IIdentity instance used to create security evidence. 此指针的类型为 IUnknown ,因此调用方通常应 QueryInterface 在此接口上调用以获取指向的指针 System.Security.Principal.IIdentityThis pointer is typed IUnknown, so callers should typically call QueryInterface on this interface to obtain a pointer to an System.Security.Principal.IIdentity.

返回值Return Value

S_OKS_OK 操作成功。The operation was successful.
S_FALSES_FALSE 操作未能完成。The operation failed to complete.
E_FAILE_FAIL 发生了未知的灾难性故障。An unknown, catastrophic failure occurred. 如果方法返回 E_FAIL,则公共语言运行时(CLR)在该过程中将不再可用。If a method returns E_FAIL, the common language runtime (CLR) is no longer usable in the process. 对任何宿主 Api 的后续调用都会返回 HOST_E_CLRNOTAVAILABLE。Subsequent calls to any hosting APIs return HOST_E_CLRNOTAVAILABLE.
HOST_E_CLRNOTAVAILABLEHOST_E_CLRNOTAVAILABLE CLR 未加载到进程中,或 CLR 处于无法运行托管代码或成功处理调用的状态。The CLR has not been loaded into a process, or the CLR is in a state in which it cannot run managed code or process the call successfully.


此方法返回一个不能从本机代码中填充的空集合。This method returns an empty collection that cannot be populated from native code. Evidence 改用方法。You should use the Evidence method instead.


平台: 请参阅系统要求Platforms: See System Requirements.

标头: Mscoree.dllHeader: MSCorEE.h

库: 作为资源包括在 Mscoree.dll 中Library: Included as a resource in MSCorEE.dll

.NET Framework 版本: 1.0、1。1.NET Framework Version: 1.0, 1.1

另请参阅See also