| Index: base/win/dllmain.cc
|
| diff --git a/base/win/dllmain.cc b/base/win/dllmain.cc
|
| index fad951905ddb3b01301ee6ba9eec12becf8da13d..3d830b2689f737c8044e24b15ee774ea2827d28a 100644
|
| --- a/base/win/dllmain.cc
|
| +++ b/base/win/dllmain.cc
|
| @@ -26,7 +26,8 @@
|
|
|
| #include <windows.h>
|
|
|
| -#include "base/logging.h"
|
| +#include "base/compiler_specific.h"
|
| +#include "base/win/win_util.h"
|
|
|
| // Indicate if another service is scanning the callbacks. When this becomes
|
| // set to true, then DllMain() will stop supporting the callback service. This
|
| @@ -83,10 +84,16 @@ PIMAGE_TLS_CALLBACK p_thread_callback_dllmain_typical_entry = on_callback;
|
| #endif // _WIN64
|
| } // extern "C"
|
|
|
| +NOINLINE static void CrashOnProcessDetach() {
|
| + *((int*)0) = 0x356;
|
| +}
|
|
|
| // Make DllMain call the listed callbacks. This way any third parties that are
|
| // linked in will also be called.
|
| BOOL WINAPI DllMain(PVOID h, DWORD reason, PVOID reserved) {
|
| + if (DLL_PROCESS_DETACH == reason && base::win::ShouldCrashOnProcessDetach())
|
| + CrashOnProcessDetach();
|
| +
|
| if (DLL_THREAD_DETACH != reason && DLL_PROCESS_DETACH != reason)
|
| return true; // We won't service THREAD_ATTACH calls.
|
|
|
|
|