| 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/broker_services.h" | 5 #include "sandbox/win/src/broker_services.h" |
| 6 | 6 |
| 7 #include <AclAPI.h> | 7 #include <AclAPI.h> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/macros.h" |
| 10 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
| 11 #include "base/stl_util.h" | 12 #include "base/stl_util.h" |
| 12 #include "base/threading/platform_thread.h" | 13 #include "base/threading/platform_thread.h" |
| 13 #include "base/win/scoped_handle.h" | 14 #include "base/win/scoped_handle.h" |
| 14 #include "base/win/scoped_process_information.h" | 15 #include "base/win/scoped_process_information.h" |
| 15 #include "base/win/startup_information.h" | 16 #include "base/win/startup_information.h" |
| 16 #include "base/win/windows_version.h" | 17 #include "base/win/windows_version.h" |
| 17 #include "sandbox/win/src/app_container.h" | 18 #include "sandbox/win/src/app_container.h" |
| 18 #include "sandbox/win/src/process_mitigations.h" | 19 #include "sandbox/win/src/process_mitigations.h" |
| 19 #include "sandbox/win/src/sandbox_policy_base.h" | 20 #include "sandbox/win/src/sandbox_policy_base.h" |
| (...skipping 524 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 544 return SBOX_ERROR_BAD_PARAMS; | 545 return SBOX_ERROR_BAD_PARAMS; |
| 545 | 546 |
| 546 if (!::RegisterWaitForSingleObject( | 547 if (!::RegisterWaitForSingleObject( |
| 547 &peer->wait_object, peer->process.Get(), RemovePeer, peer.get(), | 548 &peer->wait_object, peer->process.Get(), RemovePeer, peer.get(), |
| 548 INFINITE, WT_EXECUTEONLYONCE | WT_EXECUTEINWAITTHREAD)) { | 549 INFINITE, WT_EXECUTEONLYONCE | WT_EXECUTEINWAITTHREAD)) { |
| 549 peer_map_.erase(peer->id); | 550 peer_map_.erase(peer->id); |
| 550 return SBOX_ERROR_GENERIC; | 551 return SBOX_ERROR_GENERIC; |
| 551 } | 552 } |
| 552 | 553 |
| 553 // Release the pointer since it will be cleaned up by the callback. | 554 // Release the pointer since it will be cleaned up by the callback. |
| 554 peer.release(); | 555 ignore_result(peer.release()); |
| 555 return SBOX_ALL_OK; | 556 return SBOX_ALL_OK; |
| 556 } | 557 } |
| 557 | 558 |
| 558 ResultCode BrokerServicesBase::InstallAppContainer(const wchar_t* sid, | 559 ResultCode BrokerServicesBase::InstallAppContainer(const wchar_t* sid, |
| 559 const wchar_t* name) { | 560 const wchar_t* name) { |
| 560 if (base::win::OSInfo::GetInstance()->version() < base::win::VERSION_WIN8) | 561 if (base::win::OSInfo::GetInstance()->version() < base::win::VERSION_WIN8) |
| 561 return SBOX_ERROR_UNSUPPORTED; | 562 return SBOX_ERROR_UNSUPPORTED; |
| 562 | 563 |
| 563 base::string16 old_name = LookupAppContainer(sid); | 564 base::string16 old_name = LookupAppContainer(sid); |
| 564 if (old_name.empty()) | 565 if (old_name.empty()) |
| (...skipping 10 matching lines...) Expand all Loading... |
| 575 return SBOX_ERROR_UNSUPPORTED; | 576 return SBOX_ERROR_UNSUPPORTED; |
| 576 | 577 |
| 577 base::string16 name = LookupAppContainer(sid); | 578 base::string16 name = LookupAppContainer(sid); |
| 578 if (name.empty()) | 579 if (name.empty()) |
| 579 return SBOX_ERROR_INVALID_APP_CONTAINER; | 580 return SBOX_ERROR_INVALID_APP_CONTAINER; |
| 580 | 581 |
| 581 return DeleteAppContainer(sid); | 582 return DeleteAppContainer(sid); |
| 582 } | 583 } |
| 583 | 584 |
| 584 } // namespace sandbox | 585 } // namespace sandbox |
| OLD | NEW |