检索有关提供的指定数组的类型信息其调试地址。
[C++]
HRESULT GetArrayTypeFromAddress(
IDebugAddress* pAddress,
BYTE* pSig,
DWORD dwSigLength,
IDebugField** ppField
);
[C#]
int GetArrayTypeFromAddress(
IDebugAddress pAddress,
int[] pSig,
uint dwSigLength,
out IDebugField ppField
);
参数
pAddress
[in] IDebugAddress 接口表示的调试地址。pSig
[in] 检查的数组。dwSigLength
[in] 长度。 pSig 数组的字节。ppField
[out] 返回数组类型 (如由 IDebugClassField 接口。
返回值
如果成功,则返回; S_OK否则,返回错误代码。
示例
下面的示例演示如何执行显示 IDebugComPlusSymbolProvider 接口的 CDebugSymbolProvider 对象的方法。
HRESULT CDebugSymbolProvider::GetArrayTypeFromAddress(
IDebugAddress *pAddress,
BYTE *pSig,
DWORD dwSigLength,
IDebugField **ppField)
{
HRESULT hr = E_FAIL;
CDEBUG_ADDRESS da;
CDebugGenericParamScope* pGenScope = NULL;
METHOD_ENTRY( CDebugDynamicFieldSymbol::GetArrayTypeFromAddress );
ASSERT(IsValidObjectPtr(this, CDebugSymbolProvider));
ASSERT(IsValidWritePtr(ppField, IDebugField*));
IfFailGo( pAddress->GetAddress(&da) );
if ( S_OK == hr )
{
IfNullGo( pGenScope = new CDebugGenericParamScope(da.GetModule(), da.tokClass, da.GetMethod()), E_OUTOFMEMORY );
IfFailGo( this->CreateType((const COR_SIGNATURE*)(pSig), dwSigLength, da.GetModule(), mdMethodDefNil, pGenScope, ppField) );
}
Error:
METHOD_EXIT( CDebugDynamicFieldSymbol::GetArrayTypeFromAddress, hr );
RELEASE( pGenScope );
return hr;
}