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

Unified Diff: sandbox/src/Wow64.cc

Issue 9959018: Use ScopedProcessInformation and other RAII types in sandbox. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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/Wow64.cc
diff --git a/sandbox/src/Wow64.cc b/sandbox/src/Wow64.cc
index 60c63fd7b98d86b39b70e63d56f945c531c230a0..d5b1c3ebd69a541ab8a775d053899669b9ec025b 100644
--- a/sandbox/src/Wow64.cc
+++ b/sandbox/src/Wow64.cc
@@ -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,18 +157,16 @@ bool Wow64::RunWowHelper(void* buffer) {
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;
-
- ::CloseHandle(process_info.hProcess);
- ::CloseHandle(process_info.hThread);
+ bool ok =
+ ::GetExitCodeProcess(process_info.process_handle(), &code) ? true : false;
if (WAIT_TIMEOUT == reason)
return false;

Powered by Google App Engine
This is Rietveld 408576698