IDebugBinder3::GetMemoryContext64
개체 위치 또는 64-비트 메모리 주소를 메모리 컨텍스트를 변환합니다.
HRESULT GetMemoryContext64 (
IDebugField* pField,
UINT64 uConstant,
IDebugMemoryContext2** ppMemCxt
);
int GetMemoryContext64 (
IDebugField pField,
ulong uConstant,
out IDebugMemoryContext2 ppMemCxt
);
매개 변수
pField
[in] IDebugField 찾을 개체에 설명 합니다. 경우 NULL를 사용 하 고 dwConstant 대신 합니다.uConstant
[in] 0X50000000와 같은 64 비트 메모리 주소입니다.ppMemCxt
[out] 반환은 IDebugMemoryContext2 인터페이스는 개체의 주소를 메모리 주소를 나타냅니다.
반환 값
성공 하면 반환 S_OK. 그렇지 않으면 오류 코드를 반환 합니다.
예제
다음 예제에서는 만들고 구현 하는 개체는 IDebugBinder3 인터페이스와 메모리 컨텍스트를 검색 하려면이 메서드를 사용 하 여.
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;
}