| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/app/close_handle_hook_win.h" | 5 #include "chrome/app/close_handle_hook_win.h" |
| 6 | 6 |
| 7 #include <Windows.h> | 7 #include <Windows.h> |
| 8 #include <psapi.h> | 8 #include <psapi.h> |
| 9 | 9 |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/lazy_instance.h" | 12 #include "base/lazy_instance.h" |
| 13 #include "base/memory/scoped_ptr.h" |
| 13 #include "base/win/iat_patch_function.h" | 14 #include "base/win/iat_patch_function.h" |
| 14 #include "base/win/pe_image.h" | 15 #include "base/win/pe_image.h" |
| 15 #include "base/win/scoped_handle.h" | 16 #include "base/win/scoped_handle.h" |
| 16 #include "chrome/common/chrome_version_info.h" | 17 #include "chrome/common/chrome_version_info.h" |
| 17 | 18 |
| 18 namespace { | 19 namespace { |
| 19 | 20 |
| 20 typedef BOOL (WINAPI* CloseHandleType) (HANDLE handle); | 21 typedef BOOL (WINAPI* CloseHandleType) (HANDLE handle); |
| 21 CloseHandleType g_close_function = NULL; | 22 CloseHandleType g_close_function = NULL; |
| 22 | 23 |
| (...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 222 // threads attempting to call CloseHandle. | 223 // threads attempting to call CloseHandle. |
| 223 hooks->AddEATPatch(); | 224 hooks->AddEATPatch(); |
| 224 PatchLoadedModules(hooks); | 225 PatchLoadedModules(hooks); |
| 225 } | 226 } |
| 226 } | 227 } |
| 227 | 228 |
| 228 void RemoveCloseHandleHooks() { | 229 void RemoveCloseHandleHooks() { |
| 229 // We are partching all loaded modules without forcing them to stay in memory, | 230 // We are partching all loaded modules without forcing them to stay in memory, |
| 230 // removing patches is not safe. | 231 // removing patches is not safe. |
| 231 } | 232 } |
| OLD | NEW |