summaryrefslogtreecommitdiffstats
path: root/base/debug/close_handle_hook_win.cc
diff options
context:
space:
mode:
Diffstat (limited to 'base/debug/close_handle_hook_win.cc')
-rw-r--r--base/debug/close_handle_hook_win.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/base/debug/close_handle_hook_win.cc b/base/debug/close_handle_hook_win.cc
index 6ff6fa2..0d617b5 100644
--- a/base/debug/close_handle_hook_win.cc
+++ b/base/debug/close_handle_hook_win.cc
@@ -17,6 +17,7 @@
#include "base/win/iat_patch_function.h"
#include "base/win/pe_image.h"
#include "base/win/scoped_handle.h"
+#include "base/win/windows_version.h"
#include "build/build_config.h"
namespace {
@@ -259,12 +260,19 @@ void PatchLoadedModules(HandleHooks* hooks) {
} // namespace
void InstallHandleHooks() {
+#if !defined(DISABLE_HANDLE_VERIFIER_HOOKS)
+#if defined(_DEBUG)
+ // Handle hooks cause shutdown asserts in Debug on Windows 7. crbug.com/571304
+ if (base::win::GetVersion() < base::win::VERSION_WIN8)
+ return;
+#endif
HandleHooks* hooks = g_hooks.Pointer();
// Performing EAT interception first is safer in the presence of other
// threads attempting to call CloseHandle.
hooks->AddEATPatch();
PatchLoadedModules(hooks);
+#endif
}
void RemoveHandleHooks() {