| 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 421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 432 ++attribute_count; | 432 ++attribute_count; |
| 433 | 433 |
| 434 HANDLE stdout_handle = policy_base->GetStdoutHandle(); | 434 HANDLE stdout_handle = policy_base->GetStdoutHandle(); |
| 435 HANDLE stderr_handle = policy_base->GetStderrHandle(); | 435 HANDLE stderr_handle = policy_base->GetStderrHandle(); |
| 436 int inherit_handle_count = 0; | 436 int inherit_handle_count = 0; |
| 437 if (stdout_handle != INVALID_HANDLE_VALUE) | 437 if (stdout_handle != INVALID_HANDLE_VALUE) |
| 438 inherit_handle_list[inherit_handle_count++] = stdout_handle; | 438 inherit_handle_list[inherit_handle_count++] = stdout_handle; |
| 439 // Handles in the list must be unique. | 439 // Handles in the list must be unique. |
| 440 if (stderr_handle != stdout_handle && stderr_handle != INVALID_HANDLE_VALUE) | 440 if (stderr_handle != stdout_handle && stderr_handle != INVALID_HANDLE_VALUE) |
| 441 inherit_handle_list[inherit_handle_count++] = stderr_handle; | 441 inherit_handle_list[inherit_handle_count++] = stderr_handle; |
| 442 |
| 443 HandleList handle_list = policy_base->GetHandlesBeingShared(); |
| 444 if (!handle_list.empty()) { |
| 445 for (size_t i = 0; i < handle_list.size(); ++i) |
| 446 inherit_handle_list[inherit_handle_count++] = handle_list[i]; |
| 447 } |
| 442 if (inherit_handle_count) | 448 if (inherit_handle_count) |
| 443 ++attribute_count; | 449 ++attribute_count; |
| 444 | 450 |
| 445 if (!startup_info.InitializeProcThreadAttributeList(attribute_count)) | 451 if (!startup_info.InitializeProcThreadAttributeList(attribute_count)) |
| 446 return SBOX_ERROR_PROC_THREAD_ATTRIBUTES; | 452 return SBOX_ERROR_PROC_THREAD_ATTRIBUTES; |
| 447 | 453 |
| 448 if (app_container) { | 454 if (app_container) { |
| 449 result = app_container->ShareForStartup(&startup_info); | 455 result = app_container->ShareForStartup(&startup_info); |
| 450 if (SBOX_ALL_OK != result) | 456 if (SBOX_ALL_OK != result) |
| 451 return result; | 457 return result; |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 598 return SBOX_ERROR_UNSUPPORTED; | 604 return SBOX_ERROR_UNSUPPORTED; |
| 599 | 605 |
| 600 base::string16 name = LookupAppContainer(sid); | 606 base::string16 name = LookupAppContainer(sid); |
| 601 if (name.empty()) | 607 if (name.empty()) |
| 602 return SBOX_ERROR_INVALID_APP_CONTAINER; | 608 return SBOX_ERROR_INVALID_APP_CONTAINER; |
| 603 | 609 |
| 604 return DeleteAppContainer(sid); | 610 return DeleteAppContainer(sid); |
| 605 } | 611 } |
| 606 | 612 |
| 607 } // namespace sandbox | 613 } // namespace sandbox |
| OLD | NEW |