Chromium Code Reviews| Index: base/debug/close_handle_hook_win.cc |
| diff --git a/base/debug/close_handle_hook_win.cc b/base/debug/close_handle_hook_win.cc |
| index 359b758ed33924727c59136265e60b97f4ac22ab..90d55b139037a912e974925423d669a2ccc6be8a 100644 |
| --- a/base/debug/close_handle_hook_win.cc |
| +++ b/base/debug/close_handle_hook_win.cc |
| @@ -203,15 +203,14 @@ bool HandleHooks::AddIATPatch(HMODULE module) { |
| base::win::IATPatchFunction* patch = NULL; |
| patch = IATPatch(module, "CloseHandle", &CloseHandleHook, |
| reinterpret_cast<void**>(&g_close_function)); |
| - if (!patch) |
| - return false; |
| - hooks_.push_back(patch); |
| + if (patch) |
| + hooks_.push_back(patch); |
| patch = IATPatch(module, "DuplicateHandle", &DuplicateHandleHook, |
| reinterpret_cast<void**>(&g_duplicate_function)); |
| - if (!patch) |
| - return false; |
| - hooks_.push_back(patch); |
| + if (patch) |
| + hooks_.push_back(patch); |
| + |
| return true; |
| } |
| @@ -249,15 +248,11 @@ bool PatchLoadedModules(HandleHooks* hooks) { |
| returned /= sizeof(HMODULE); |
| returned = std::min(kSize, returned); |
| - bool success = false; |
| + for (DWORD current = 0; current < returned; current++) |
| + if (!hooks->AddIATPatch(modules[current])) |
|
cpu_(ooo_6.6-7.5)
2015/12/21 00:34:41
add brackets, looks strange as is.
Will Harris
2015/12/21 01:25:24
Done.
|
| + return false; |
| - for (DWORD current = 0; current < returned; current++) { |
| - success = hooks->AddIATPatch(modules[current]); |
| - if (!success) |
| - break; |
| - } |
| - |
| - return success; |
| + return true; |
| } |
| } // namespace |