Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // For information about interceptions as a whole see | 5 // For information about interceptions as a whole see |
| 6 // http://dev.chromium.org/developers/design-documents/sandbox . | 6 // http://dev.chromium.org/developers/design-documents/sandbox . |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <set> | 10 #include <set> |
| (...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 462 // Bypass purify's interception. | 462 // Bypass purify's interception. |
| 463 wchar_t* loader_get = reinterpret_cast<wchar_t*>( | 463 wchar_t* loader_get = reinterpret_cast<wchar_t*>( |
| 464 ntdll_image.GetProcAddress("LdrGetDllHandle")); | 464 ntdll_image.GetProcAddress("LdrGetDllHandle")); |
| 465 if (loader_get) { | 465 if (loader_get) { |
| 466 if (!GetModuleHandleEx(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS | | 466 if (!GetModuleHandleEx(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS | |
| 467 GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT, | 467 GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT, |
| 468 loader_get, &ntdll_base)) | 468 loader_get, &ntdll_base)) |
| 469 return false; | 469 return false; |
| 470 } | 470 } |
| 471 | 471 |
| 472 if (base::win::GetVersion() <= base::win::VERSION_VISTA) { | |
| 473 Wow64 WowHelper(child_, ntdll_base); | |
| 474 if (!WowHelper.WaitForNtdll()) | |
|
Will Harris
2016/03/17 23:05:58
this appears to be the only place this is used, so
kylix_rd
2016/03/17 23:40:10
I will certainly look into that.
kylix_rd
2016/03/21 19:09:09
Done.
| |
| 475 return false; | |
| 476 } | |
| 477 | |
| 478 char* interceptor_base = NULL; | 472 char* interceptor_base = NULL; |
| 479 | 473 |
| 480 #if SANDBOX_EXPORTS | 474 #if SANDBOX_EXPORTS |
| 481 interceptor_base = reinterpret_cast<char*>(child_->MainModule()); | 475 interceptor_base = reinterpret_cast<char*>(child_->MainModule()); |
| 482 HMODULE local_interceptor = ::LoadLibrary(child_->Name()); | 476 HMODULE local_interceptor = ::LoadLibrary(child_->Name()); |
| 483 #endif | 477 #endif |
| 484 | 478 |
| 485 ServiceResolverThunk* thunk; | 479 ServiceResolverThunk* thunk; |
| 486 #if defined(_WIN64) | 480 #if defined(_WIN64) |
| 487 thunk = new ServiceResolverThunk(child_->Process(), relaxed_); | 481 thunk = new ServiceResolverThunk(child_->Process(), relaxed_); |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 551 ::FreeLibrary(local_interceptor); | 545 ::FreeLibrary(local_interceptor); |
| 552 #endif | 546 #endif |
| 553 | 547 |
| 554 if (it != interceptions_.end()) | 548 if (it != interceptions_.end()) |
| 555 return false; | 549 return false; |
| 556 | 550 |
| 557 return true; | 551 return true; |
| 558 } | 552 } |
| 559 | 553 |
| 560 } // namespace sandbox | 554 } // namespace sandbox |
| OLD | NEW |