| 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::OSInfo::GetInstance()->wow64_status() == | 441 if (base::win::GetWOW64Status() == base::win::WOW64_ENABLED) |
| 442 base::win::OSInfo::WOW64_ENABLED) | |
| 443 thunk = new Wow64ResolverThunk(child_->Process(), relaxed_); | 442 thunk = new Wow64ResolverThunk(child_->Process(), relaxed_); |
| 444 else if (!IsXPSP2OrLater()) | 443 else if (!IsXPSP2OrLater()) |
| 445 thunk = new Win2kResolverThunk(child_->Process(), relaxed_); | 444 thunk = new Win2kResolverThunk(child_->Process(), relaxed_); |
| 446 else | 445 else |
| 447 thunk = new ServiceResolverThunk(child_->Process(), relaxed_); | 446 thunk = new ServiceResolverThunk(child_->Process(), relaxed_); |
| 448 | 447 |
| 449 std::list<InterceptionData>::iterator it = interceptions_.begin(); | 448 std::list<InterceptionData>::iterator it = interceptions_.begin(); |
| 450 for (; it != interceptions_.end(); ++it) { | 449 for (; it != interceptions_.end(); ++it) { |
| 451 const std::wstring ntdll(kNtdllName); | 450 const std::wstring ntdll(kNtdllName); |
| 452 if (it->dll != ntdll) | 451 if (it->dll != ntdll) |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 496 ::FreeLibrary(local_interceptor); | 495 ::FreeLibrary(local_interceptor); |
| 497 #endif | 496 #endif |
| 498 | 497 |
| 499 if (it != interceptions_.end()) | 498 if (it != interceptions_.end()) |
| 500 return false; | 499 return false; |
| 501 | 500 |
| 502 return true; | 501 return true; |
| 503 } | 502 } |
| 504 | 503 |
| 505 } // namespace sandbox | 504 } // namespace sandbox |
| OLD | NEW |