Avi Drissman | e4622aa | 2022-09-08 20:36:06 | [diff] [blame] | 1 | // Copyright 2013 The Chromium Authors |
[email protected] | 307af21 | 2013-07-10 18:36:09 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
3 | // found in the LICENSE file. | ||||
4 | |||||
5 | #include "base/process/kill.h" | ||||
6 | |||||
[email protected] | 307af21 | 2013-07-10 18:36:09 | [diff] [blame] | 7 | #include <windows.h> |
Bruce Dawson | a1e1cfcb | 2022-11-22 20:04:35 | [diff] [blame] | 8 | |
avi | beced7c | 2015-12-24 06:47:59 | [diff] [blame] | 9 | #include <io.h> |
10 | #include <stdint.h> | ||||
[email protected] | 307af21 | 2013-07-10 18:36:09 | [diff] [blame] | 11 | |
Takuto Ikuta | c8d6b16f | 2024-04-15 16:59:19 | [diff] [blame^] | 12 | #include <algorithm> |
13 | |||||
[email protected] | 307af21 | 2013-07-10 18:36:09 | [diff] [blame] | 14 | #include "base/logging.h" |
Hans Wennborg | afeb390 | 2020-06-17 14:42:29 | [diff] [blame] | 15 | #include "base/notreached.h" |
wfh | fa40c272 | 2016-07-26 01:12:28 | [diff] [blame] | 16 | #include "base/process/memory.h" |
[email protected] | 307af21 | 2013-07-10 18:36:09 | [diff] [blame] | 17 | #include "base/process/process_iterator.h" |
[email protected] | 307af21 | 2013-07-10 18:36:09 | [diff] [blame] | 18 | |
19 | namespace base { | ||||
20 | |||||
[email protected] | 307af21 | 2013-07-10 18:36:09 | [diff] [blame] | 21 | TerminationStatus GetTerminationStatus(ProcessHandle handle, int* exit_code) { |
Wez | 05c2c68 | 2017-08-17 16:20:11 | [diff] [blame] | 22 | DCHECK(exit_code); |
23 | |||||
[email protected] | 307af21 | 2013-07-10 18:36:09 | [diff] [blame] | 24 | DWORD tmp_exit_code = 0; |
25 | |||||
26 | if (!::GetExitCodeProcess(handle, &tmp_exit_code)) { | ||||
[email protected] | ad8cfa9 | 2014-05-21 20:06:23 | [diff] [blame] |