| 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 <set> | 8 #include <set> |
| 9 | 9 |
| 10 #include "sandbox/win/src/interception.h" | 10 #include "sandbox/win/src/interception.h" |
| (...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 446 HMODULE ntdll_base = ::GetModuleHandle(kNtdllName); | 446 HMODULE ntdll_base = ::GetModuleHandle(kNtdllName); |
| 447 if (!ntdll_base) | 447 if (!ntdll_base) |
| 448 return false; | 448 return false; |
| 449 | 449 |
| 450 base::win::PEImage ntdll_image(ntdll_base); | 450 base::win::PEImage ntdll_image(ntdll_base); |
| 451 | 451 |
| 452 // Bypass purify's interception. | 452 // Bypass purify's interception. |
| 453 wchar_t* loader_get = reinterpret_cast<wchar_t*>( | 453 wchar_t* loader_get = reinterpret_cast<wchar_t*>( |
| 454 ntdll_image.GetProcAddress("LdrGetDllHandle")); | 454 ntdll_image.GetProcAddress("LdrGetDllHandle")); |
| 455 if (loader_get) { | 455 if (loader_get) { |
| 456 if (!GetModuleHandleHelper(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS | | 456 if (!GetModuleHandleEx(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS | |
| 457 GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT, | 457 GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT, |
| 458 loader_get, &ntdll_base)) | 458 loader_get, &ntdll_base)) |
| 459 return false; | 459 return false; |
| 460 } | 460 } |
| 461 | 461 |
| 462 if (base::win::GetVersion() <= base::win::VERSION_VISTA) { | 462 if (base::win::GetVersion() <= base::win::VERSION_VISTA) { |
| 463 Wow64 WowHelper(child_, ntdll_base); | 463 Wow64 WowHelper(child_, ntdll_base); |
| 464 if (!WowHelper.WaitForNtdll()) | 464 if (!WowHelper.WaitForNtdll()) |
| 465 return false; | 465 return false; |
| 466 } | 466 } |
| 467 | 467 |
| 468 char* interceptor_base = NULL; | 468 char* interceptor_base = NULL; |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 541 ::FreeLibrary(local_interceptor); | 541 ::FreeLibrary(local_interceptor); |
| 542 #endif | 542 #endif |
| 543 | 543 |
| 544 if (it != interceptions_.end()) | 544 if (it != interceptions_.end()) |
| 545 return false; | 545 return false; |
| 546 | 546 |
| 547 return true; | 547 return true; |
| 548 } | 548 } |
| 549 | 549 |
| 550 } // namespace sandbox | 550 } // namespace sandbox |
| OLD | NEW |