| 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/tests/common/controller.h" | 5 #include "sandbox/win/tests/common/controller.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/memory/shared_memory.h" | 9 #include "base/memory/shared_memory.h" |
| 10 #include "base/process/process.h" | 10 #include "base/process/process.h" |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 return SBOX_TEST_FAILED_TO_RUN_TEST; | 206 return SBOX_TEST_FAILED_TO_RUN_TEST; |
| 207 | 207 |
| 208 // For simplicity TestRunner supports only one process per instance. | 208 // For simplicity TestRunner supports only one process per instance. |
| 209 if (target_process_.IsValid()) { | 209 if (target_process_.IsValid()) { |
| 210 if (IsProcessRunning(target_process_.Get())) | 210 if (IsProcessRunning(target_process_.Get())) |
| 211 return SBOX_TEST_FAILED_TO_RUN_TEST; | 211 return SBOX_TEST_FAILED_TO_RUN_TEST; |
| 212 target_process_.Close(); | 212 target_process_.Close(); |
| 213 target_process_id_ = 0; | 213 target_process_id_ = 0; |
| 214 } | 214 } |
| 215 | 215 |
| 216 if (disable_csrss_) { | 216 if (disable_csrss_) |
| 217 // Close all ALPC ports to disable CSRSS. | 217 policy_->SetDisconnectCsrss(); |
| 218 if (base::win::GetVersion() >= base::win::VERSION_WIN8) { | |
| 219 policy_->AddKernelObjectToClose(L"ALPC Port", NULL); | |
| 220 } | |
| 221 } | |
| 222 | 218 |
| 223 // Get the path to the sandboxed process. | 219 // Get the path to the sandboxed process. |
| 224 wchar_t prog_name[MAX_PATH]; | 220 wchar_t prog_name[MAX_PATH]; |
| 225 GetModuleFileNameW(NULL, prog_name, MAX_PATH); | 221 GetModuleFileNameW(NULL, prog_name, MAX_PATH); |
| 226 | 222 |
| 227 // Launch the sandboxed process. | 223 // Launch the sandboxed process. |
| 228 ResultCode result = SBOX_ALL_OK; | 224 ResultCode result = SBOX_ALL_OK; |
| 229 PROCESS_INFORMATION target = {0}; | 225 PROCESS_INFORMATION target = {0}; |
| 230 | 226 |
| 231 base::string16 arguments(L"\""); | 227 base::string16 arguments(L"\""); |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 371 | 367 |
| 372 target->LowerToken(); | 368 target->LowerToken(); |
| 373 } else if (0 != _wcsicmp(argv[1], L"-child-no-sandbox")) { | 369 } else if (0 != _wcsicmp(argv[1], L"-child-no-sandbox")) { |
| 374 return SBOX_TEST_FAILED_TO_EXECUTE_COMMAND; | 370 return SBOX_TEST_FAILED_TO_EXECUTE_COMMAND; |
| 375 } | 371 } |
| 376 | 372 |
| 377 return command(argc - 4, argv + 4); | 373 return command(argc - 4, argv + 4); |
| 378 } | 374 } |
| 379 | 375 |
| 380 } // namespace sandbox | 376 } // namespace sandbox |
| OLD | NEW |