Bug 1932613 - temporarily disable browser_ml_end_to_end.js for permanent failures...
[gecko.git] / xpcom / base / nsCrashOnException.cpp
blob67436c15c4d45eb86095060a779d65538b847f94
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #include "nsCrashOnException.h"
8 #include "nsCOMPtr.h"
9 #include "nsICrashReporter.h"
10 #include "nsServiceManagerUtils.h"
12 namespace mozilla {
14 static int ReportException(EXCEPTION_POINTERS* aExceptionInfo) {
15 nsCOMPtr<nsICrashReporter> cr =
16 do_GetService("@mozilla.org/toolkit/crash-reporter;1");
17 if (cr) {
18 cr->WriteMinidumpForException(aExceptionInfo);
21 return EXCEPTION_EXECUTE_HANDLER;
24 XPCOM_API(LRESULT)
25 CallWindowProcCrashProtected(WNDPROC aWndProc, HWND aHWnd, UINT aMsg,
26 WPARAM aWParam, LPARAM aLParam) {
27 MOZ_SEH_TRY { return aWndProc(aHWnd, aMsg, aWParam, aLParam); }
28 MOZ_SEH_EXCEPT(ReportException(GetExceptionInformation())) {
29 ::TerminateProcess(::GetCurrentProcess(), 253);
31 return 0; // not reached
34 } // namespace mozilla