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"
9 #include "nsServiceManagerUtils.h"
11 #ifdef MOZ_CRASHREPORTER
12 #include "nsICrashReporter.h"
18 ReportException(EXCEPTION_POINTERS
* aExceptionInfo
)
20 #ifdef MOZ_CRASHREPORTER
21 nsCOMPtr
<nsICrashReporter
> cr
=
22 do_GetService("@mozilla.org/toolkit/crash-reporter;1");
24 cr
->WriteMinidumpForException(aExceptionInfo
);
27 return EXCEPTION_EXECUTE_HANDLER
;
31 CallWindowProcCrashProtected(WNDPROC aWndProc
, HWND aHWnd
, UINT aMsg
,
32 WPARAM aWParam
, LPARAM aLParam
)
35 return aWndProc(aHWnd
, aMsg
, aWParam
, aLParam
);
37 MOZ_SEH_EXCEPT(ReportException(GetExceptionInformation())) {
38 ::TerminateProcess(::GetCurrentProcess(), 253);
40 return 0; // not reached