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.
Bir nesne konumunu veya 64 bit bellek adresini bellek bağlamı olarak dönüştürür.
Sözdizimi
int GetMemoryContext64 (
IDebugField pField,
ulong uConstant,
out IDebugMemoryContext2 ppMemCxt
);
Parametreler
pField
[in] Bulunacak nesneyi tanımlayan bir IDebugField . ise NULL, bunun yerine kullanın dwConstant .
uConstant
[in] 0x50000000 gibi 64 bit bellek adresi.
ppMemCxt
[out] Nesnenin adresini veya bellekteki adresi temsil eden IDebugMemoryContext2 arabirimini döndürür.
İ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 örnekler, IDebugBinder3 arabirimini uygulayan bir nesne oluşturur ve bellek bağlamını almak için bu yöntemi kullanır.
HRESULT CValueProperty::GetMemoryContext ( IDebugMemoryContext2** out_ppMemoryContext )
{
// precondition
REQUIRE( NULL != out_ppMemoryContext );
if (NULL == out_ppMemoryContext)
return E_POINTER;
*out_ppMemoryContext = NULL;
INVARIANT( this );
if (!this->ClassInvariant())
return E_UNEXPECTED;
if (VT_EMPTY == this->m_VarValue.vt)
{
return E_FAIL;
}
// function body
if (NULL != this->m_pBinder)
{
UINT64 dwOffset = 0;
DEBUG_PROPERTY_INFO dpInfo;
HRESULT HR = this->GetPropertyInfo(DEBUGPROP_INFO_VALUE,
10, // RADIX
DEFAULT_TIMEOUT,
NULL,
0,
&dpInfo);
if (ENSURE( S_OK == HR ))
{
REQUIRE( NULL != dpInfo.bstrValue );
REQUIRE( NULL == dpInfo.bstrName );
REQUIRE( NULL == dpInfo.bstrFullName );
REQUIRE( NULL == dpInfo.bstrType );
REQUIRE( NULL == dpInfo.pProperty );
wchar_t * end;
dwOffset = _wcstoui64(dpInfo.bstrValue, &end, 0); // base 0 to allow 0x if it's ever output
::SysFreeString(dpInfo.bstrValue);
}
if (CComQIPtr<IDebugBinder3> binder3 = this->m_pBinder)
HR = binder3->GetMemoryContext64(NULL, dwOffset, out_ppMemoryContext);
else
HR = this->m_pBinder->GetMemoryContext(NULL, (DWORD)(__int32)dwOffset, out_ppMemoryContext);
if (ENSURE( S_OK == HR ))
{
REQUIRE( NULL != *out_ppMemoryContext );
}
}
// postcondition
INVARIANT( this );
HRESULT HR = E_FAIL;
if (NULL != *out_ppMemoryContext)
{
HR = S_OK;
}
return HR;
}