GetRestrictedErrorInfo function (roerrorapi.h)

Gets the restricted error information object set by a previous call to SetRestrictedErrorInfo in the current logical thread.

Syntax

HRESULT GetRestrictedErrorInfo(
  [out] IRestrictedErrorInfo **ppRestrictedErrorInfo
);

Parameters

[out] ppRestrictedErrorInfo

The restricted error info object associated with the current thread.

Return value

This function can return one of these values.

Return code Description
S_OK
The restricted error object was retrieved successfully.
S_FALSE
There is no restricted error object associated with the current thread. Any other error object is removed from the thread.

Remarks

Call the GetRestrictedErrorInfo function to get the most recently set IRestrictedErrorInfo object on the current thread in a Windows Store app.

Call the RoCaptureErrorContext function to save error information for the current thread. Call the RoFailFastWithErrorContext function to raise an exception, terminate the current process, and report the error to the Windows Error Reporting service (WER).

GetRestrictedErrorInfo transfers ownership of the error object to the caller and clears the error state for the thread. If the most recently set error object doesn't support the IRestrictedErrorInfo interface, the error state for the thread is cleared, but no interface is returned to the caller.

The GetRestrictedErrorInfo retrieves the error object from the current thread and calls QueryInterface to find the IRestrictedErrorInfo interface. If IRestrictedErrorInfo isn't found, GetRestrictedErrorInfo returns S_FALSE. In this case, the error object is removed from the thread. For more info, see GetErrorInfo.

Calling the GetRestrictedErrorInfo function fails if IRestrictedErrorInfo isn't the system implementation. To create an IRestrictedErrorInfo object, call the OriginateError, TransformError, or RoCaptureErrorContext functions.

Requirements

Requirement Value
Minimum supported client Windows 8 [desktop apps | UWP apps]
Minimum supported server Windows Server 2012 [desktop apps | UWP apps]
Target Platform Windows
Header roerrorapi.h
DLL Combase.dll

See also

GetErrorInfo

IRestrictedErrorInfo

RO_ERROR_REPORTING_FLAGS

RoCaptureErrorContext

RoFailFastWithErrorContext

SetRestrictedErrorInfo