| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/process_thread_policy.h" | 5 #include "sandbox/win/src/process_thread_policy.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "sandbox/win/src/ipc_tags.h" | 10 #include "sandbox/win/src/ipc_tags.h" |
| (...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 220 const base::string16 &app_name, | 220 const base::string16 &app_name, |
| 221 const base::string16 &command_line, | 221 const base::string16 &command_line, |
| 222 PROCESS_INFORMATION* process_info) { | 222 PROCESS_INFORMATION* process_info) { |
| 223 // The only action supported is ASK_BROKER which means create the process. | 223 // The only action supported is ASK_BROKER which means create the process. |
| 224 if (GIVE_ALLACCESS != eval_result && GIVE_READONLY != eval_result) { | 224 if (GIVE_ALLACCESS != eval_result && GIVE_READONLY != eval_result) { |
| 225 return ERROR_ACCESS_DENIED; | 225 return ERROR_ACCESS_DENIED; |
| 226 } | 226 } |
| 227 | 227 |
| 228 STARTUPINFO startup_info = {0}; | 228 STARTUPINFO startup_info = {0}; |
| 229 startup_info.cb = sizeof(startup_info); | 229 startup_info.cb = sizeof(startup_info); |
| 230 scoped_ptr_malloc<wchar_t> cmd_line(_wcsdup(command_line.c_str())); | 230 scoped_ptr<wchar_t, base::FreeDeleter> |
| 231 cmd_line(_wcsdup(command_line.c_str())); |
| 231 | 232 |
| 232 BOOL should_give_full_access = (GIVE_ALLACCESS == eval_result); | 233 BOOL should_give_full_access = (GIVE_ALLACCESS == eval_result); |
| 233 if (!CreateProcessExWHelper(client_info.process, should_give_full_access, | 234 if (!CreateProcessExWHelper(client_info.process, should_give_full_access, |
| 234 app_name.c_str(), cmd_line.get(), NULL, NULL, | 235 app_name.c_str(), cmd_line.get(), NULL, NULL, |
| 235 FALSE, 0, NULL, NULL, &startup_info, | 236 FALSE, 0, NULL, NULL, &startup_info, |
| 236 process_info)) { | 237 process_info)) { |
| 237 return ERROR_ACCESS_DENIED; | 238 return ERROR_ACCESS_DENIED; |
| 238 } | 239 } |
| 239 return ERROR_SUCCESS; | 240 return ERROR_SUCCESS; |
| 240 } | 241 } |
| 241 | 242 |
| 242 } // namespace sandbox | 243 } // namespace sandbox |
| OLD | NEW |