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/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
439 HANDLE stdout_handle = policy_base->GetStdoutHandle(); | 439 HANDLE stdout_handle = policy_base->GetStdoutHandle(); |
440 HANDLE stderr_handle = policy_base->GetStderrHandle(); | 440 HANDLE stderr_handle = policy_base->GetStderrHandle(); |
441 | 441 |
442 if (stdout_handle != INVALID_HANDLE_VALUE) | 442 if (stdout_handle != INVALID_HANDLE_VALUE) |
443 inherited_handle_list.push_back(stdout_handle); | 443 inherited_handle_list.push_back(stdout_handle); |
444 | 444 |
445 // Handles in the list must be unique. | 445 // Handles in the list must be unique. |
446 if (stderr_handle != stdout_handle && stderr_handle != INVALID_HANDLE_VALUE) | 446 if (stderr_handle != stdout_handle && stderr_handle != INVALID_HANDLE_VALUE) |
447 inherited_handle_list.push_back(stderr_handle); | 447 inherited_handle_list.push_back(stderr_handle); |
448 | 448 |
449 HandleList policy_handle_list = policy_base->GetHandlesBeingShared(); | 449 const HandleList& policy_handle_list = policy_base->GetHandlesBeingShared(); |
450 | 450 |
451 for (auto handle : policy_handle_list) | 451 for (auto handle : policy_handle_list) |
452 inherited_handle_list.push_back(handle); | 452 inherited_handle_list.push_back(handle->Get()); |
453 | 453 |
454 if (inherited_handle_list.size()) | 454 if (inherited_handle_list.size()) |
455 ++attribute_count; | 455 ++attribute_count; |
456 | 456 |
457 if (!startup_info.InitializeProcThreadAttributeList(attribute_count)) | 457 if (!startup_info.InitializeProcThreadAttributeList(attribute_count)) |
458 return SBOX_ERROR_PROC_THREAD_ATTRIBUTES; | 458 return SBOX_ERROR_PROC_THREAD_ATTRIBUTES; |
459 | 459 |
460 if (app_container) { | 460 if (app_container) { |
461 result = app_container->ShareForStartup(&startup_info); | 461 result = app_container->ShareForStartup(&startup_info); |
462 if (SBOX_ALL_OK != result) | 462 if (SBOX_ALL_OK != result) |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
619 return SBOX_ERROR_UNSUPPORTED; | 619 return SBOX_ERROR_UNSUPPORTED; |
620 | 620 |
621 base::string16 name = LookupAppContainer(sid); | 621 base::string16 name = LookupAppContainer(sid); |
622 if (name.empty()) | 622 if (name.empty()) |
623 return SBOX_ERROR_INVALID_APP_CONTAINER; | 623 return SBOX_ERROR_INVALID_APP_CONTAINER; |
624 | 624 |
625 return DeleteAppContainer(sid); | 625 return DeleteAppContainer(sid); |
626 } | 626 } |
627 | 627 |
628 } // namespace sandbox | 628 } // namespace sandbox |
OLD | NEW |