blob: 95e0a415c41cb988fb256fe91ce2a12e9567d437 [file] [log] [blame]
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome_elf/chrome_elf_main.h"
#include <assert.h>
#include <windows.h>
#include "chrome/install_static/install_util.h"
#include "chrome_elf/blacklist/blacklist.h"
#include "chrome_elf/crash/crash_helper.h"
// This function is a temporary workaround for We
// need to come up with a better way to initialize crash reporting that can
// happen inside DllMain().
void SignalInitializeCrashReporting() {
if (!elf_crash::InitializeCrashReporting()) {
#ifdef _DEBUG
#endif // _DEBUG
void SignalChromeElf() {
BOOL APIENTRY DllMain(HMODULE module, DWORD reason, LPVOID reserved) {
if (reason == DLL_PROCESS_ATTACH) {
// CRT on initialization installs an exception filter which calls
// TerminateProcess. We need to hook CRT's attempt to set an exception.
// NOTE: Do not hook if ASan is present, or ASan will fail to install
// its own unhandled exception filter.
#endif // !defined (ADDRESS_SANITIZER)
__try {
blacklist::Initialize(false); // Don't force, abort if beacon is present.
} __except (elf_crash::GenerateCrashDump(GetExceptionInformation())) {
} else if (reason == DLL_PROCESS_DETACH) {
return TRUE;