summaryrefslogtreecommitdiffstats
path: root/base/process_util_win.cc
diff options
context:
space:
mode:
Diffstat (limited to 'base/process_util_win.cc')
-rw-r--r--base/process_util_win.cc29
1 files changed, 20 insertions, 9 deletions
diff --git a/base/process_util_win.cc b/base/process_util_win.cc
index 940ee77..f09228fb 100644
--- a/base/process_util_win.cc
+++ b/base/process_util_win.cc
@@ -164,15 +164,26 @@ bool KillProcess(int process_id, int exit_code, bool wait) {
bool DidProcessCrash(ProcessHandle handle) {
DWORD exitcode = 0;
- BOOL success = ::GetExitCodeProcess(handle, &exitcode);
- DCHECK(success);
- DCHECK(exitcode != STILL_ACTIVE);
-
- if (exitcode == 0 || // Normal termination.
- exitcode == 1 || // Killed by task manager.
- exitcode == 0xC0000354 || // STATUS_DEBUGGER_INACTIVE
- exitcode == 0xC000013A || // Control-C/end session.
- exitcode == 0x40010004) { // Debugger terminated process/end session.
+ if (!::GetExitCodeProcess(handle, &exitcode)) {
+ NOTREACHED();
+ return false;
+ }
+ if (exitcode == STILL_ACTIVE) {
+ // The process is likely not dead or it used 0x103 as exit code.
+ NOTREACHED();
+ return false;
+ }
+
+ // Warning, this is not generic code; it heavily depends on the way
+ // the rest of the code kills a process.
+
+ if (exitcode == 0 || // Normal termination.
+ exitcode == 1 || // Killed by task manager.
+ exitcode == 14 || // Killed because of a bad message.
+ exitcode == 16 || // Killed by hung detector (see ResultCodes)
+ exitcode == 0xC0000354 || // STATUS_DEBUGGER_INACTIVE.
+ exitcode == 0xC000013A || // Control-C/end session.
+ exitcode == 0x40010004) { // Debugger terminated process/end session.
return false;
}