| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/src/interception.h" | 10 #include "sandbox/src/interception.h" |
| (...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 431 } | 431 } |
| 432 | 432 |
| 433 char* interceptor_base = NULL; | 433 char* interceptor_base = NULL; |
| 434 | 434 |
| 435 #if SANDBOX_EXPORTS | 435 #if SANDBOX_EXPORTS |
| 436 interceptor_base = reinterpret_cast<char*>(child_->MainModule()); | 436 interceptor_base = reinterpret_cast<char*>(child_->MainModule()); |
| 437 HMODULE local_interceptor = ::LoadLibrary(child_->Name()); | 437 HMODULE local_interceptor = ::LoadLibrary(child_->Name()); |
| 438 #endif | 438 #endif |
| 439 | 439 |
| 440 ServiceResolverThunk* thunk; | 440 ServiceResolverThunk* thunk; |
| 441 if (base::win::GetWOW64Status() == base::win::WOW64_ENABLED) | 441 if (base::win::OSInfo::GetInstance()->wow64_status() == |
| 442 base::win::OSInfo::WOW64_ENABLED) |
| 442 thunk = new Wow64ResolverThunk(child_->Process(), relaxed_); | 443 thunk = new Wow64ResolverThunk(child_->Process(), relaxed_); |
| 443 else if (!IsXPSP2OrLater()) | 444 else if (!IsXPSP2OrLater()) |
| 444 thunk = new Win2kResolverThunk(child_->Process(), relaxed_); | 445 thunk = new Win2kResolverThunk(child_->Process(), relaxed_); |
| 445 else | 446 else |
| 446 thunk = new ServiceResolverThunk(child_->Process(), relaxed_); | 447 thunk = new ServiceResolverThunk(child_->Process(), relaxed_); |
| 447 | 448 |
| 448 std::list<InterceptionData>::iterator it = interceptions_.begin(); | 449 std::list<InterceptionData>::iterator it = interceptions_.begin(); |
| 449 for (; it != interceptions_.end(); ++it) { | 450 for (; it != interceptions_.end(); ++it) { |
| 450 const std::wstring ntdll(kNtdllName); | 451 const std::wstring ntdll(kNtdllName); |
| 451 if (it->dll != ntdll) | 452 if (it->dll != ntdll) |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 495 ::FreeLibrary(local_interceptor); | 496 ::FreeLibrary(local_interceptor); |
| 496 #endif | 497 #endif |
| 497 | 498 |
| 498 if (it != interceptions_.end()) | 499 if (it != interceptions_.end()) |
| 499 return false; | 500 return false; |
| 500 | 501 |
| 501 return true; | 502 return true; |
| 502 } | 503 } |
| 503 | 504 |
| 504 } // namespace sandbox | 505 } // namespace sandbox |
| OLD | NEW |