Condividi tramite


Funzione RoResolveRestrictedErrorInfoReference (roerrorapi.h)

Restituisce il puntatore all'interfaccia IRestrictedErrorInfo in base al riferimento specificato.

Sintassi

HRESULT RoResolveRestrictedErrorInfoReference(
  [in]  PCWSTR               reference,
  [out] IRestrictedErrorInfo **ppRestrictedErrorInfo
);

Parametri

[in] reference

Tipo: PCWSTR

Identifica un oggetto errore che contiene informazioni rilevanti per l'errore specifico.

[out] ppRestrictedErrorInfo

Tipo: IRestrictedErrorInfo**

Parametro di output per l'oggetto associato al riferimento specificato.

Valore restituito

Tipo: HRESULT

Questa funzione può restituire uno di questi valori.

Codice restituito Descrizione
S_OK
Operazione completata.
CLASS_E_NOAGGREGATION
l'oggetto non supporta l'aggregazione.
E_INVALIDARG
Il riferimento non è valido.

Commenti

La funzione RoResolveRestrictedErrorInfoReference è utile principalmente per lo sviluppo del debugger. Un debugger riceve la stringa di riferimento e usa il riferimento per identificare l'oggetto IRestrictedErrorInfo associato, che consente al debugger di recuperare il messaggio di errore dettagliato chiamando il metodo GetErrorDetails .

Esempio

HRESULT DebuggerIntegration(PCWST   referenceName)
{
    HRESULT hr = S_OK;
    IRestrictedErrorInfo *pRORestrictedErrorInfo = nullptr;

    // Resolve the IRestrictedErrorInfo
    hr = RoResolveRestrictedErrorInfoReference(referenceName,  
                      reinterpret_cast<void**>(&pRORestrictedErrorInfo));
    if (FAILED(hr))
    {
        hr = E_FAIL;
    }


    HRESULT hrError = S_OK;
    BSTR bstrDescription = nullptr;
    BSTR bstrRestrictedDescription = nullptr;

    // Get the error details out of the interface
    if (SUCCEEDED(hr))
    {
        hr = spRestrictedErrorInfo->GetErrorDetails(&bstrDescription,
                                      &hrError, &bstrRestrictedDescription);
        if (FAILED(hr))
        {
            hr = E_FAIL;
        }
    }

   return hr;

}

Requisiti

Requisito Valore
Client minimo supportato Windows 8
Server minimo supportato Windows Server 2012
Piattaforma di destinazione Windows
Intestazione roerrorapi.h
Libreria Runtimeobject.lib