Index: base/process/kill_win.cc |
diff --git a/base/process/kill_win.cc b/base/process/kill_win.cc |
index 0da3a26ae4f78e9af924609904e81db7872958e2..b35dd6321696e982580ba2704d78b4811e524ff2 100644 |
--- a/base/process/kill_win.cc |
+++ b/base/process/kill_win.cc |
@@ -159,11 +159,8 @@ bool WaitForProcessesToExit(const FilePath::StringType& executable_name, |
DWORD remaining_wait = static_cast<DWORD>(std::max( |
static_cast<int64>(0), |
wait.InMilliseconds() - (GetTickCount() - start_time))); |
- HANDLE process = OpenProcess(SYNCHRONIZE, |
- FALSE, |
- entry->th32ProcessID); |
- DWORD wait_result = WaitForSingleObject(process, remaining_wait); |
- CloseHandle(process); |
+ Process process(Process::OpenWithAccess(entry->th32ProcessID, SYNCHRONIZE)); |
+ DWORD wait_result = WaitForSingleObject(process.Handle(), remaining_wait); |
result &= (wait_result == WAIT_OBJECT_0); |
} |