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

Unified Diff: sandbox/src/policy_target_test.cc

Issue 9700038: ScopedProcessInformation protects against process/thread handle leaks from CreateProcess calls. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove changes from another CL. Created 8 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 side-by-side diff with in-line comments
Download patch
Index: sandbox/src/policy_target_test.cc
diff --git a/sandbox/src/policy_target_test.cc b/sandbox/src/policy_target_test.cc
index 577c8c56cd2bb3e3aeccc8002a5fc44e5fb6569b..f2f48632224fe3927347732df7290086fab87e2d 100644
--- a/sandbox/src/policy_target_test.cc
+++ b/sandbox/src/policy_target_test.cc
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "base/win/scoped_process_information.h"
#include "base/win/windows_version.h"
#include "sandbox/src/sandbox.h"
#include "sandbox/src/sandbox_factory.h"
@@ -149,9 +150,9 @@ SBOX_TESTS_COMMAND int PolicyTargetTest_process(int argc, wchar_t **argv) {
// Use default values to create a new process.
STARTUPINFO startup_info = {0};
startup_info.cb = sizeof(startup_info);
- PROCESS_INFORMATION process_info;
+ base::win::ScopedProcessInformation process_info;
if (!::CreateProcessW(L"foo.exe", L"foo.exe", NULL, NULL, FALSE, 0,
- NULL, NULL, &startup_info, &process_info))
+ NULL, NULL, &startup_info, process_info.Receive()))
return SBOX_TEST_SUCCEEDED;
return SBOX_TEST_FAILED;
}

Powered by Google App Engine
This is Rietveld 408576698