Not
Bu sayfaya erişim yetkilendirme gerektiriyor. Oturum açmayı veya dizinleri değiştirmeyi deneyebilirsiniz.
Bu sayfaya erişim yetkilendirme gerektiriyor. Dizinleri değiştirmeyi deneyebilirsiniz.
Kullanılacak sağlama toplamı algoritmasının benzersiz tanımlayıcısı verilip kesme noktası isteğinin belge sağlama toplamını alır.
Sözdizimi
Parametreler
guidAlgorithm
[in] Sağlama toplamı algoritmasının benzersiz tanımlayıcısı.
pChecksumData
[out] Kesme noktası isteği için belge sağlama toplamı.
İade Değeri
Başarılı olursa döndürür S_OK; aksi takdirde bir hata kodu döndürür.
Örnek
Aşağıdaki örnekte, bağlanmak üzere olan bir belgenin sağlama toplamının kullanıcı arabiriminden bir taneyle eşleşip eşleşmediğini denetleyen bir işlev gösterilmektedir.
bool CDebugProgram::DoChecksumsMatch(CDebugPendingBreakpoint *pPending, CDebugCodeContext *pContext)
{
bool fRet = false;
HRESULT hRes;
// Get the checksum for the document we are about to bind to from the pdb side
GUID guidAlgorithmId;
BYTE *pChecksum = NULL;
ULONG cNumBytes = 0;
hRes = pContext->GetDocumentChecksumAndAlgorithmId(&guidAlgorithmId, &pChecksum, &cNumBytes);
if ( S_OK == hRes )
{
// Get checksum data for the document from the UI (request) side
CComPtr<IDebugBreakpointChecksumRequest2> pChecksumRequest;
hRes = pPending->GetChecksumRequest(&pChecksumRequest);
if ( S_OK == hRes )
{
CHECKSUM_DATA data;
hRes = pChecksumRequest->GetChecksum(guidAlgorithmId, &data);
if ( S_OK == hRes )
{
if ( data.ByteCount == cNumBytes && memcmp(data.pBytes, pChecksum, cNumBytes) == 0 )
fRet = true;
else
fRet = false;
// Free up data allocated for checksum data
CoTaskMemFree(data.pBytes);
}
else
fRet = true; // checksums not available - user disabled checksums
}
else
fRet = true; // we couldn't get checksum from UI - default to past behavior
// free up space allocated for checksum from pdb
CoTaskMemFree(pChecksum);
}
else
fRet = true; // we don't have a checksum to compare with.
return ( fRet );
}