IDebugHostType::GetHashCode 方法 (dbgmodel.h)

GetHashCode 方法返回类型的 32 位哈希代码。 除了全局匹配 (例如:与 * 等效的类型签名(如果主机) 允许)匹配所有内容,任何可以匹配特定类型签名的类型实例都必须返回相同的哈希代码。

此方法与类型签名结合使用,以便将类型签名与类型实例匹配。

语法

HRESULT GetHashCode(
  ULONG *hashCode
);

参数

hashCode

类型实例的 32 位哈希代码。 每个能够通过非全局匹配类型签名匹配另一种类型的类型将在此处返回相同的哈希代码。 调试主机必须保证其类型签名方法和此方法之间的此类同步。

返回值

此方法返回指示成功或失败的 HRESULT。

注解

示例代码

ComPtr<IDebugHostType> spType; /* get a type (see FindTypeByName) */

ULONG typeHash;
if (SUCCEEDED(spType->GetHashCode(&typeHash)))
{
    // typeHash contains a 32-bit hash code.  The hash must be identical for 
    // every type which can match a type signature (unless the signature 
    // is a total wildcard).
}

要求

要求
Header dbgmodel.h

另请参阅

IDebugHostType 接口