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

Unified Diff: sandbox/src/Wow64.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 | « no previous file | sandbox/src/broker_services.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sandbox/src/Wow64.cc
===================================================================
--- sandbox/src/Wow64.cc (revision 144078)
+++ sandbox/src/Wow64.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.
@@ -8,6 +8,7 @@
#include "base/logging.h"
#include "base/memory/scoped_ptr.h"
+#include "base/win/scoped_process_information.h"
#include "base/win/windows_version.h"
#include "sandbox/src/target_process.h"
@@ -156,19 +157,17 @@
STARTUPINFO startup_info = {0};
startup_info.cb = sizeof(startup_info);
- PROCESS_INFORMATION process_info;
+ base::win::ScopedProcessInformation process_info;
if (!::CreateProcess(NULL, writable_command.get(), NULL, NULL, FALSE, 0, NULL,
- NULL, &startup_info, &process_info))
+ NULL, &startup_info, process_info.Receive()))
return false;
- DWORD reason = ::WaitForSingleObject(process_info.hProcess, INFINITE);
+ DWORD reason = ::WaitForSingleObject(process_info.process_handle(), INFINITE);
DWORD code;
- bool ok = ::GetExitCodeProcess(process_info.hProcess, &code) ? true : false;
+ bool ok =
+ ::GetExitCodeProcess(process_info.process_handle(), &code) ? true : false;
- ::CloseHandle(process_info.hProcess);
- ::CloseHandle(process_info.hThread);
-
if (WAIT_TIMEOUT == reason)
return false;
« no previous file with comments | « no previous file | sandbox/src/broker_services.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698