Condividi tramite


IDebugComPlusSymbolProvider::GetArrayTypeFromAddress

Retrieves type information about the specified array given its debug address.

[C++]
HRESULT GetArrayTypeFromAddress(
   IDebugAddress* pAddress,
   BYTE*          pSig,
   DWORD          dwSigLength,
   IDebugField**  ppField
);

[C#]
int GetArrayTypeFromAddress(
   IDebugAddress   pAddress,
   int[]           pSig,
   uint            dwSigLength,
   out IDebugField ppField
);

Parameters

  • pAddress
    [in] The debug address represented by an IDebugAddress interface.

  • pSig
    [in] The array to examine.

  • dwSigLength
    [in] Length in bytes of the pSig array.

  • ppField
    [out] Returns the array type as represented by an IDebugClassField interface.

Return Value

If successful, returns S_OK; otherwise, returns an error code.

Example

The following example shows how to implement this method for a CDebugSymbolProvider object that exposes the IDebugComPlusSymbolProvider interface.

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;
}

See Also

Reference

IDebugComPlusSymbolProvider