GetRestrictedErrorInfo, fonction (roerrorapi.h)

Obtient l’objet d’informations d’erreur restreinte défini par un appel précédent à SetRestrictedErrorInfo dans le thread logique actuel.

Syntaxe

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

Paramètres

[out] ppRestrictedErrorInfo

Objet d’informations d’erreur restreint associé au thread actuel.

Valeur retournée

Cette fonction peut retourner l’une de ces valeurs.

Code de retour Description
S_OK
L’objet d’erreur restreint a été récupéré avec succès.
S_FALSE
Aucun objet d’erreur restreint n’est associé au thread actuel. Tout autre objet d’erreur est supprimé du thread.

Remarques

Appelez la fonction GetRestrictedErrorInfo pour obtenir le dernier objet IRestrictedErrorInfo défini sur le thread actuel dans une application du Windows Store.

Appelez la fonction RoCaptureErrorContext pour enregistrer les informations d’erreur pour le thread actuel. Appelez la fonction RoFailFastWithErrorContext pour lever une exception, arrêter le processus en cours et signaler l’erreur au service Rapport d'erreurs Windows (WER).

GetRestrictedErrorInfo transfère la propriété de l’objet d’erreur à l’appelant et efface l’état d’erreur du thread. Si l’objet d’erreur défini le plus récemment ne prend pas en charge l’interface IRestrictedErrorInfo , l’état d’erreur du thread est effacé, mais aucune interface n’est retournée à l’appelant.

GetRestrictedErrorInfo récupère l’objet error à partir du thread actuel et appelle QueryInterface pour rechercher l’interface IRestrictedErrorInfo. Si IRestrictedErrorInfo est introuvable, GetRestrictedErrorInfo retourne S_FALSE. Dans ce cas, l’objet d’erreur est supprimé du thread. Pour plus d’informations, consultez GetErrorInfo.

L’appel de la fonction GetRestrictedErrorInfo échoue si IRestrictedErrorInfo n’est pas l’implémentation du système. Pour créer un objet IRestrictedErrorInfo , appelez les fonctions OriginateError, TransformError ou RoCaptureErrorContext .

Configuration requise

Condition requise Valeur
Client minimal pris en charge Windows 8 [applications de bureau | Applications UWP]
Serveur minimal pris en charge Windows Server 2012 [applications de bureau | Applications UWP]
Plateforme cible Windows
En-tête roerrorapi.h
DLL Combase.dll

Voir aussi

GetErrorInfo

IRestrictedErrorInfo

RO_ERROR_REPORTING_FLAGS

RoCaptureErrorContext

RoFailFastWithErrorContext

SetRestrictedErrorInfo