Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(747)

Unified Diff: base/win/dllmain.cc

Issue 9803002: [windows] Make calls to exit(), _exit(), abort(), and ExitProcess() from the renderer process resul… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address brettw comments Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | base/win/win_util.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.
« no previous file with comments | « no previous file | base/win/win_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698