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

Unified Diff: sandbox/src/interception_unittest.cc

Issue 10605002: Sandbox: Use ScopedProcessInformation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sandbox/src/broker_services.cc ('k') | sandbox/src/job_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sandbox/src/interception_unittest.cc
===================================================================
--- sandbox/src/interception_unittest.cc (revision 142999)
+++ sandbox/src/interception_unittest.cc (working copy)
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -79,7 +79,13 @@
wchar_t exe_name[MAX_PATH];
ASSERT_NE(0u, GetModuleFileName(NULL, exe_name, MAX_PATH - 1));
- TargetProcess *target = MakeTestTargetProcess(::GetCurrentProcess(),
+ base::win::ScopedHandle current_process;
+ ASSERT_TRUE(
+ ::DuplicateHandle(::GetCurrentProcess(), ::GetCurrentProcess(),
+ ::GetCurrentProcess(), current_process.Receive(),
+ 0, FALSE, DUPLICATE_SAME_ACCESS));
+
+ TargetProcess *target = MakeTestTargetProcess(current_process.Take(),
rvargas (doing something else) 2012/06/26 20:55:07 reverted changes to this file.
::GetModuleHandle(exe_name));
InterceptionManager interceptions(target, true);
@@ -166,7 +172,13 @@
wchar_t exe_name[MAX_PATH];
ASSERT_NE(0u, GetModuleFileName(NULL, exe_name, MAX_PATH - 1));
- TargetProcess *target = MakeTestTargetProcess(::GetCurrentProcess(),
+ base::win::ScopedHandle current_process;
+ ASSERT_TRUE(
+ ::DuplicateHandle(::GetCurrentProcess(), ::GetCurrentProcess(),
+ ::GetCurrentProcess(), current_process.Receive(),
+ 0, FALSE, DUPLICATE_SAME_ACCESS));
+
+ TargetProcess *target = MakeTestTargetProcess(current_process.Take(),
::GetModuleHandle(exe_name));
InterceptionManager interceptions(target, true);
« no previous file with comments | « sandbox/src/broker_services.cc ('k') | sandbox/src/job_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698