RoCaptureErrorContext function (roerrorapi.h)
Saves the current error context so that it's available for later calls to the RoFailFastWithErrorContext function.
HRESULT RoCaptureErrorContext( HRESULT hr );
The HRESULT associated with the error.
If this function succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.
The RoCaptureErrorContext function captures the context associated with an error, including the stack-backtrace. This information is stored in the restricted error object and is available to the Windows Error Reporting (WER) service, if WER is enabled, and if a subsequent call is made to the RoFailFastWithErrorContext function from the same thread.
To use RoCaptureErrorContext function with RoOriginateError, call RoOriginateError first, and then call RoCaptureErrorContext. Calling in the reverse order may cause the error context to be lost.
|Minimum supported client||Windows 8 [desktop apps | UWP apps]|
|Minimum supported server||Windows Server 2012 [desktop apps | UWP apps]|