ILanguageExceptionStackBackTrace interface (restrictederrorinfo.h)

Allows projections to provide custom stack trace for that exception.

Inheritance

The ILanguageExceptionStackBackTrace interface inherits from the IUnknown interface. ILanguageExceptionStackBackTrace also has these types of members:

Methods

The ILanguageExceptionStackBackTrace interface has these methods.

 
ILanguageExceptionStackBackTrace::GetStackBackTrace

Retrieves the back stack trace.

Remarks

It is recommended that language projections implement this interface when the stack trace is not captured by the relevant Global Error Handler API.

Examples

The following example demonstrates a projection providing its back trace through an interface implemented on the language exception object. Global Error Handling (GEH) queries for this interface when a language exception object is provided to RoOriginateLanguageException or CapturePropagationContext. As such, this scenario allows the GEH to expose back traces for projections which the GEH can’t capture back traces for.

class FooExceptionInfo : public Microsoft::WRL::RuntimeClass< 
    Microsoft::WRL::RuntimeClassFlags< 
    Microsoft::WRL::RuntimeClassType::ClassicCom>, 
    ... 
    ILanguageExceptionStackBackTrace > 
{ 
    ... 
    ... 
private: 
    UINT_PTR* customBackTrace; 
    int numFramesCaptured; 
public: 
    HRESULT GetStackBackTrace( 
        ULONG maxFramesToCapture, 
        UINT_PTR stackBackTrace [], 
        ULONG* framesCaptured) 
    { 
        int idx = 0; 
        for (; idx < maxFramesToCapture && idx < numFramesCaptured; idx++) 
        { 
            stackBackTrace[idx] = customBackTrace[idx]; 
        } 
        *framesCaptured = idx; 
        return S_OK; 
    } 
} 

Requirements

Requirement Value
Minimum supported client Windows 10, version 1703 [desktop apps only]
Minimum supported server Windows Server 2016 [desktop apps only]
Target Platform Windows
Header restrictederrorinfo.h

See also

IUnknown