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).
}

要求

要求 价值
标头 dbgmodel.h

另请参阅

IDebugHostType 接口