GetRestrictedErrorInfo function

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

Syntax


HRESULT WINAPI GetRestrictedErrorInfo(
  _Out_  IRestrictedErrorInfo **ppRestrictedErrorInfo
);

Parameters

ppRestrictedErrorInfo [out]

The restricted error info object associated with the current thread.

Return value

This function can return one of these values.

Return codeDescription
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.

Windows Phone 8: This API is supported.

Windows Phone 8.1: This API is supported.

Requirements

Minimum supported client

Windows 8 [desktop apps | Windows Store apps]

Minimum supported server

Windows Server 2012 [desktop apps | Windows Store apps]

Header

Roerrorapi.h

DLL

Combase.dll

See also

SetRestrictedErrorInfo
IRestrictedErrorInfo
RoCaptureErrorContext
RoFailFastWithErrorContext
GetErrorInfo
RO_ERROR_REPORTING_FLAGS

 

 

Community Additions

ADD
Show:
© 2014 Microsoft