PFN_WER_RUNTIME_EXCEPTION_EVENT callback function (werapi.h)

Windows Error Reporting (WER) calls this function to determine whether the exception handler is claiming the crash.

The PFN_WER_RUNTIME_EXCEPTION_EVENT type defines a pointer to this callback function. You must use "OutOfProcessExceptionEventCallback" as the name of the callback function.



HRESULT PfnWerRuntimeExceptionEvent(
  [in]      PVOID pContext,
  [in]      const PWER_RUNTIME_EXCEPTION_INFORMATION pExceptionInformation,
  [out]     BOOL *pbOwnershipClaimed,
  [out]     PWSTR pwszEventName,
  [in, out] PDWORD pchSize,
  [out]     PDWORD pdwSignatureCount


[in] pContext

A pointer to arbitrary context information that you specified when you called the WerRegisterRuntimeExceptionModule function to register the exception handler.

[in] pExceptionInformation

A WER_RUNTIME_EXCEPTION_INFORMATION structure that contains the exception information. Use the information to determine whether you want to claim the crash.

[out] pbOwnershipClaimed

Set to TRUE if the exception handler is claiming this crash; otherwise, FALSE. If you set this parameter to FALSE, do not set the rest of the out parameters.

[out] pwszEventName

A caller-allocated buffer that you use to specify the event name used to identify this crash.

[in, out] pchSize

The size, in characters, of the pwszEventName buffer. The buffer is limited to MAX_PATH characters. The size includes the null-terminating character.

[out] pdwSignatureCount

The number of report parameters that you will provide. The valid range of values is one to 10. If you specify a value greater than 10, WER will ignore the value and collect only the first 10 parameters. If you specify zero, the reporting process will be indeterminate.

This value determines the number of times that WER calls your OutOfProcessExceptionEventSignatureCallback function.

Return value

Return S_OK, even if the exception handler is not claiming this crash. If you return other failure codes, WER reverts to its default crash reporting behavior if no other handlers are registered.


You must implement this function in your exception handler DLL.


Requirement Value
Minimum supported client Windows 7 [desktop apps only]
Minimum supported server Windows Server 2008 R2 [desktop apps only]
Target Platform Windows
Header werapi.h

See also

WerRegisterRuntimeExceptionModule, Windows Error Reporting