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

Side by Side Diff: sandbox/win/tests/common/controller.cc

Issue 1225183003: CreateThread interception, to use CreateRemoteThread (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix up casts Created 4 years, 10 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 | « sandbox/win/src/top_level_dispatcher.cc ('k') | no next file » | 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/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
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
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
OLDNEW
« no previous file with comments | « sandbox/win/src/top_level_dispatcher.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698