Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

RoResolveRestrictedErrorInfoReference function

Returns the IRestrictedErrorInfo interface pointer based on the given reference.

Syntax


HRESULT WINAPI RoResolveRestrictedErrorInfoReference(
  _In_   PCWSTR reference,
  _Out_  IRestrictedErrorInfo **ppRestrictedErrorInfo
);

Parameters

reference [in]

Type: PCWSTR

Identifies an error object which contains relevant information for the specific error.

ppRestrictedErrorInfo [out]

Type: IRestrictedErrorInfo**

The output parameter for the object associated with the given reference.

Return value

Type: HRESULT

This function can return one of these values.

Return codeDescription
S_OK

The operation succeeded.

CLASS_E_NOAGGREGATION

object does not support aggregation.

E_INVALIDARG

The reference is invalid.

 

Remarks

The RoResolveRestrictedErrorInfoReference function is useful primarily for debugger development. A debugger receives the reference string and uses the reference to identify the associated IRestrictedErrorInfo object, which allows the debugger to retrieve the detailed error message by calling the GetErrorDetails method.

Examples


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

    // Resove 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;

}


Requirements

Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Header

Roerrorapi.h

Library

Runtimeobject.lib

 

 

Community Additions

Show:
© 2014 Microsoft