Minor fixes for crashpad_wer_main.cc

These were suggested after https://crrev.com/c/3864248 was submitted.

Change-Id: I73c451a3ea52721d8476e229cff7a0aded6746ac
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/3902210
Commit-Queue: Alan Zhao <ayzhao@google.com>
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Mark Mentovai <mark@chromium.org>
This commit is contained in:
Alan Zhao 2022-09-19 13:48:20 -07:00 committed by Crashpad LUCI CQ
parent ca928c8d6b
commit cca548be84
3 changed files with 9 additions and 9 deletions

View File

@ -73,7 +73,7 @@ ScopedHandle DuplicateFromTarget(HANDLE target_process, HANDLE target_handle) {
return ScopedHandle(hTmp); return ScopedHandle(hTmp);
} }
bool ProcessException(DWORD* handled_exceptions, bool ProcessException(const DWORD* handled_exceptions,
size_t num_handled_exceptions, size_t num_handled_exceptions,
const PVOID pContext, const PVOID pContext,
const PWER_RUNTIME_EXCEPTION_INFORMATION e_info) { const PWER_RUNTIME_EXCEPTION_INFORMATION e_info) {
@ -193,7 +193,7 @@ bool ProcessException(DWORD* handled_exceptions,
} // namespace } // namespace
bool ExceptionEvent( bool ExceptionEvent(
DWORD* handled_exceptions, const DWORD* handled_exceptions,
size_t num_handled_exceptions, size_t num_handled_exceptions,
const PVOID pContext, const PVOID pContext,
const PWER_RUNTIME_EXCEPTION_INFORMATION pExceptionInformation) { const PWER_RUNTIME_EXCEPTION_INFORMATION pExceptionInformation) {

View File

@ -37,7 +37,7 @@ namespace crashpad::wer {
//! \return `true` if the target process was dumped by the crashpad handler then //! \return `true` if the target process was dumped by the crashpad handler then
//! terminated, or `false` otherwise. //! terminated, or `false` otherwise.
bool ExceptionEvent( bool ExceptionEvent(
DWORD* handled_exceptions, const DWORD* handled_exceptions,
size_t num_handled_exceptions, size_t num_handled_exceptions,
const PVOID pContext, const PVOID pContext,
const PWER_RUNTIME_EXCEPTION_INFORMATION pExceptionInformation); const PWER_RUNTIME_EXCEPTION_INFORMATION pExceptionInformation);

View File

@ -36,17 +36,17 @@ HRESULT OutOfProcessExceptionEventCallback(
PWSTR pwszEventName, PWSTR pwszEventName,
PDWORD pchSize, PDWORD pchSize,
PDWORD pdwSignatureCount) { PDWORD pdwSignatureCount) {
DWORD wanted_exceptions[] = { static constexpr DWORD wanted_exceptions[] = {
0xC0000602, // STATUS_FAIL_FAST_EXCEPTION 0xC0000602, // STATUS_FAIL_FAST_EXCEPTION
0xC0000409, // STATUS_STACK_BUFFER_OVERRUN 0xC0000409, // STATUS_STACK_BUFFER_OVERRUN
}; };
// Default to not-claiming as bailing out is easier. // Default to not-claiming as bailing out is easier.
*pbOwnershipClaimed = FALSE; *pbOwnershipClaimed = FALSE;
bool result = bool result = crashpad::wer::ExceptionEvent(
crashpad::wer::ExceptionEvent(wanted_exceptions, wanted_exceptions,
sizeof(wanted_exceptions) / sizeof(DWORD), sizeof(wanted_exceptions) / sizeof(wanted_exceptions[0]),
pContext, pContext,
pExceptionInformation); pExceptionInformation);
if (result) { if (result) {
*pbOwnershipClaimed = TRUE; *pbOwnershipClaimed = TRUE;