根据指定的数组的调试地址检索有关指定数组的类型信息。
语法
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;
}