Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(138)

Side by Side Diff: sandbox/win/src/broker_services.cc

Issue 1000863006: Adding one more error code to convey process creation/spawn target error to the caller BrokerServic… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Changed name. Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | sandbox/win/src/sandbox_types.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 469 matching lines...) Expand 10 before | Expand all | Expand 10 after
480 // Brokerservices does not own the target object. It is owned by the Policy. 480 // Brokerservices does not own the target object. It is owned by the Policy.
481 base::win::ScopedProcessInformation process_info; 481 base::win::ScopedProcessInformation process_info;
482 TargetProcess* target = new TargetProcess(initial_token.Take(), 482 TargetProcess* target = new TargetProcess(initial_token.Take(),
483 lockdown_token.Take(), 483 lockdown_token.Take(),
484 job.Get(), 484 job.Get(),
485 thread_pool_); 485 thread_pool_);
486 486
487 DWORD win_result = target->Create(exe_path, command_line, inherit_handles, 487 DWORD win_result = target->Create(exe_path, command_line, inherit_handles,
488 policy_base->GetLowBoxSid() ? true : false, 488 policy_base->GetLowBoxSid() ? true : false,
489 startup_info, &process_info); 489 startup_info, &process_info);
490 if (ERROR_SUCCESS != win_result) 490 if (ERROR_SUCCESS != win_result) {
491 return SpawnCleanup(target, win_result); 491 SpawnCleanup(target, win_result);
492 return SBOX_ERROR_CREATE_PROCESS;
493 }
492 494
493 // Now the policy is the owner of the target. 495 // Now the policy is the owner of the target.
494 if (!policy_base->AddTarget(target)) { 496 if (!policy_base->AddTarget(target)) {
495 return SpawnCleanup(target, 0); 497 return SpawnCleanup(target, 0);
496 } 498 }
497 499
498 // We are going to keep a pointer to the policy because we'll call it when 500 // We are going to keep a pointer to the policy because we'll call it when
499 // the job object generates notifications using the completion port. 501 // the job object generates notifications using the completion port.
500 policy_base->AddRef(); 502 policy_base->AddRef();
501 if (job.IsValid()) { 503 if (job.IsValid()) {
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
590 return SBOX_ERROR_UNSUPPORTED; 592 return SBOX_ERROR_UNSUPPORTED;
591 593
592 base::string16 name = LookupAppContainer(sid); 594 base::string16 name = LookupAppContainer(sid);
593 if (name.empty()) 595 if (name.empty())
594 return SBOX_ERROR_INVALID_APP_CONTAINER; 596 return SBOX_ERROR_INVALID_APP_CONTAINER;
595 597
596 return DeleteAppContainer(sid); 598 return DeleteAppContainer(sid);
597 } 599 }
598 600
599 } // namespace sandbox 601 } // namespace sandbox
OLDNEW
« no previous file with comments | « no previous file | sandbox/win/src/sandbox_types.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698