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 #include "sandbox/win/src/sandbox_policy_base.h" | 5 #include "sandbox/win/src/sandbox_policy_base.h" |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/win/windows_version.h" | 10 #include "base/win/windows_version.h" |
(...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
475 if (!appcontainer_list_.get() || !appcontainer_list_->HasAppContainer()) | 475 if (!appcontainer_list_.get() || !appcontainer_list_->HasAppContainer()) |
476 return NULL; | 476 return NULL; |
477 | 477 |
478 return appcontainer_list_.get(); | 478 return appcontainer_list_.get(); |
479 } | 479 } |
480 | 480 |
481 bool PolicyBase::AddTarget(TargetProcess* target) { | 481 bool PolicyBase::AddTarget(TargetProcess* target) { |
482 if (NULL != policy_) | 482 if (NULL != policy_) |
483 policy_maker_->Done(); | 483 policy_maker_->Done(); |
484 | 484 |
485 if (!ApplyProcessMitigationsToSuspendedTarget(target, mitigations_)) | 485 if (!ApplyProcessMitigationsToSuspendedProcess(target->Process(), |
| 486 mitigations_)) { |
486 return false; | 487 return false; |
| 488 } |
487 | 489 |
488 if (!SetupAllInterceptions(target)) | 490 if (!SetupAllInterceptions(target)) |
489 return false; | 491 return false; |
490 | 492 |
491 if (!SetupHandleCloser(target)) | 493 if (!SetupHandleCloser(target)) |
492 return false; | 494 return false; |
493 | 495 |
494 // Initialize the sandbox infrastructure for the target. | 496 // Initialize the sandbox infrastructure for the target. |
495 if (ERROR_SUCCESS != target->Init(this, policy_, kIPCMemSize, kPolMemSize)) | 497 if (ERROR_SUCCESS != target->Init(this, policy_, kIPCMemSize, kPolMemSize)) |
496 return false; | 498 return false; |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
626 | 628 |
627 // Finally, setup imports on the target so the interceptions can work. | 629 // Finally, setup imports on the target so the interceptions can work. |
628 return SetupNtdllImports(target); | 630 return SetupNtdllImports(target); |
629 } | 631 } |
630 | 632 |
631 bool PolicyBase::SetupHandleCloser(TargetProcess* target) { | 633 bool PolicyBase::SetupHandleCloser(TargetProcess* target) { |
632 return handle_closer_.InitializeTargetHandles(target); | 634 return handle_closer_.InitializeTargetHandles(target); |
633 } | 635 } |
634 | 636 |
635 } // namespace sandbox | 637 } // namespace sandbox |
OLD | NEW |