OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome_elf/chrome_elf_main.h" | 5 #include "chrome_elf/chrome_elf_main.h" |
6 | 6 |
7 #include <assert.h> | 7 #include <assert.h> |
8 #include <windows.h> | 8 #include <windows.h> |
9 | 9 |
10 #include "chrome/install_static/install_details.h" | 10 #include "chrome/install_static/install_details.h" |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 // install_static::InstallDetails::InitializeFromPrimaryModule. | 48 // install_static::InstallDetails::InitializeFromPrimaryModule. |
49 extern "C" const install_static::InstallDetails::Payload* | 49 extern "C" const install_static::InstallDetails::Payload* |
50 GetInstallDetailsPayload() { | 50 GetInstallDetailsPayload() { |
51 return install_static::InstallDetails::Get().GetPayload(); | 51 return install_static::InstallDetails::Get().GetPayload(); |
52 } | 52 } |
53 | 53 |
54 BOOL APIENTRY DllMain(HMODULE module, DWORD reason, LPVOID reserved) { | 54 BOOL APIENTRY DllMain(HMODULE module, DWORD reason, LPVOID reserved) { |
55 if (reason == DLL_PROCESS_ATTACH) { | 55 if (reason == DLL_PROCESS_ATTACH) { |
56 install_static::InitializeProductDetailsForPrimaryModule(); | 56 install_static::InitializeProductDetailsForPrimaryModule(); |
57 | 57 |
58 #if !defined(ADDRESS_SANITIZER) | |
59 // CRT on initialization installs an exception filter which calls | 58 // CRT on initialization installs an exception filter which calls |
60 // TerminateProcess. We need to hook CRT's attempt to set an exception. | 59 // TerminateProcess. We need to hook CRT's attempt to set an exception. |
61 // NOTE: Do not hook if ASan is present, or ASan will fail to install | |
62 // its own unhandled exception filter. | |
63 elf_crash::DisableSetUnhandledExceptionFilter(); | 60 elf_crash::DisableSetUnhandledExceptionFilter(); |
64 #endif // !defined (ADDRESS_SANITIZER) | |
65 | 61 |
66 install_static::InitializeProcessType(); | 62 install_static::InitializeProcessType(); |
67 | 63 |
68 __try { | 64 __try { |
69 blacklist::Initialize(false); // Don't force, abort if beacon is present. | 65 blacklist::Initialize(false); // Don't force, abort if beacon is present. |
70 } __except (elf_crash::GenerateCrashDump(GetExceptionInformation())) { | 66 } __except (elf_crash::GenerateCrashDump(GetExceptionInformation())) { |
71 } | 67 } |
72 } else if (reason == DLL_PROCESS_DETACH) { | 68 } else if (reason == DLL_PROCESS_DETACH) { |
73 elf_crash::ShutdownCrashReporting(); | 69 elf_crash::ShutdownCrashReporting(); |
74 } | 70 } |
75 return TRUE; | 71 return TRUE; |
76 } | 72 } |
OLD | NEW |