OLD | NEW |
1 // Copyright (c) 2011 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/src/interception.h" | 10 #include "sandbox/src/interception.h" |
11 | 11 |
(...skipping 419 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 defined(_WIN64) |
442 base::win::OSInfo::WOW64_ENABLED) | 442 thunk = new ServiceResolverThunk(child_->Process(), relaxed_); |
443 thunk = new Wow64ResolverThunk(child_->Process(), relaxed_); | 443 #else |
444 else if (!IsXPSP2OrLater()) | 444 base::win::OSInfo* os_info = base::win::OSInfo::GetInstance(); |
| 445 if (os_info->wow64_status() == base::win::OSInfo::WOW64_ENABLED) { |
| 446 if (os_info->version() >= base::win::VERSION_WIN8) |
| 447 thunk = new Wow64W8ResolverThunk(child_->Process(), relaxed_); |
| 448 else |
| 449 thunk = new Wow64ResolverThunk(child_->Process(), relaxed_); |
| 450 } else if (!IsXPSP2OrLater()) { |
445 thunk = new Win2kResolverThunk(child_->Process(), relaxed_); | 451 thunk = new Win2kResolverThunk(child_->Process(), relaxed_); |
446 else | 452 } else if (os_info->version() >= base::win::VERSION_WIN8) { |
| 453 thunk = new Win8ResolverThunk(child_->Process(), relaxed_); |
| 454 } else { |
447 thunk = new ServiceResolverThunk(child_->Process(), relaxed_); | 455 thunk = new ServiceResolverThunk(child_->Process(), relaxed_); |
| 456 } |
| 457 #endif |
448 | 458 |
449 std::list<InterceptionData>::iterator it = interceptions_.begin(); | 459 std::list<InterceptionData>::iterator it = interceptions_.begin(); |
450 for (; it != interceptions_.end(); ++it) { | 460 for (; it != interceptions_.end(); ++it) { |
451 const std::wstring ntdll(kNtdllName); | 461 const std::wstring ntdll(kNtdllName); |
452 if (it->dll != ntdll) | 462 if (it->dll != ntdll) |
453 break; | 463 break; |
454 | 464 |
455 if (INTERCEPTION_SERVICE_CALL != it->type) | 465 if (INTERCEPTION_SERVICE_CALL != it->type) |
456 break; | 466 break; |
457 | 467 |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
496 ::FreeLibrary(local_interceptor); | 506 ::FreeLibrary(local_interceptor); |
497 #endif | 507 #endif |
498 | 508 |
499 if (it != interceptions_.end()) | 509 if (it != interceptions_.end()) |
500 return false; | 510 return false; |
501 | 511 |
502 return true; | 512 return true; |
503 } | 513 } |
504 | 514 |
505 } // namespace sandbox | 515 } // namespace sandbox |
OLD | NEW |