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 21 matching lines...) Expand all Loading... | |
32 // install_static::InstallDetails::InitializeFromPrimaryModule. | 32 // install_static::InstallDetails::InitializeFromPrimaryModule. |
33 extern "C" const install_static::InstallDetails::Payload* | 33 extern "C" const install_static::InstallDetails::Payload* |
34 GetInstallDetailsPayload() { | 34 GetInstallDetailsPayload() { |
35 return install_static::InstallDetails::Get().GetPayload(); | 35 return install_static::InstallDetails::Get().GetPayload(); |
36 } | 36 } |
37 | 37 |
38 BOOL APIENTRY DllMain(HMODULE module, DWORD reason, LPVOID reserved) { | 38 BOOL APIENTRY DllMain(HMODULE module, DWORD reason, LPVOID reserved) { |
39 if (reason == DLL_PROCESS_ATTACH) { | 39 if (reason == DLL_PROCESS_ATTACH) { |
40 install_static::InitializeProductDetailsForPrimaryModule(); | 40 install_static::InitializeProductDetailsForPrimaryModule(); |
41 | 41 |
42 // CRT on initialization installs an exception filter which calls | |
grt (UTC plus 2)
2016/11/22 21:06:58
i never liked the way this was indented...
scottmg
2016/11/22 21:59:57
ocd ftw!
| |
43 // TerminateProcess. We need to hook CRT's attempt to set an exception. | |
44 // NOTE: Do not hook if ASan is present, or ASan will fail to install | |
45 // its own unhandled exception filter. | |
46 #if !defined(ADDRESS_SANITIZER) | 42 #if !defined(ADDRESS_SANITIZER) |
43 // CRT on initialization installs an exception filter which calls | |
44 // TerminateProcess. We need to hook CRT's attempt to set an exception. | |
45 // NOTE: Do not hook if ASan is present, or ASan will fail to install | |
46 // its own unhandled exception filter. | |
47 elf_crash::DisableSetUnhandledExceptionFilter(); | 47 elf_crash::DisableSetUnhandledExceptionFilter(); |
48 #endif // !defined (ADDRESS_SANITIZER) | 48 #endif // !defined (ADDRESS_SANITIZER) |
49 | 49 |
50 install_static::InitializeProcessType(); | 50 install_static::InitializeProcessType(); |
51 | 51 |
52 __try { | 52 __try { |
53 blacklist::Initialize(false); // Don't force, abort if beacon is present. | 53 blacklist::Initialize(false); // Don't force, abort if beacon is present. |
54 } __except (elf_crash::GenerateCrashDump(GetExceptionInformation())) { | 54 } __except (elf_crash::GenerateCrashDump(GetExceptionInformation())) { |
55 } | 55 } |
56 } else if (reason == DLL_PROCESS_DETACH) { | 56 } else if (reason == DLL_PROCESS_DETACH) { |
57 elf_crash::ShutdownCrashReporting(); | 57 elf_crash::ShutdownCrashReporting(); |
58 } | 58 } |
59 return TRUE; | 59 return TRUE; |
60 } | 60 } |
OLD | NEW |