IDebugComPlusSymbolProvider::GetArrayTypeFromAddress

Recupera informazioni sul tipo sulla matrice specificata in base all'indirizzo di debug.

Sintassi

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

Parametri

pAddress
[in] Indirizzo di debug rappresentato da un'interfaccia IDebugAddress .

pSig
[in] Matrice da esaminare.

dwSigLength
[in] Lunghezza in byte della pSig matrice.

ppField
[out] Restituisce il tipo di matrice rappresentato da un'interfaccia IDebugClassField .

Valore restituito

Se ha esito positivo, restituisce S_OK; in caso contrario, restituisce un codice di errore.

Esempio

Nell'esempio seguente viene illustrato come implementare questo metodo per un oggetto CDebugSymbolProvider che espone l'interfaccia IDebugComPlusSymbolProvider .

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

Vedi anche