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 |