Chromium Code Reviews| Index: remoting/host/wts_session_process_launcher_win.cc |
| diff --git a/remoting/host/wts_session_process_launcher_win.cc b/remoting/host/wts_session_process_launcher_win.cc |
| index eced4f5cfa6c4602967bb8b924a5dd1df893b782..309fa18d3b74279693ce41c0304490edbf9ebf46 100644 |
| --- a/remoting/host/wts_session_process_launcher_win.cc |
| +++ b/remoting/host/wts_session_process_launcher_win.cc |
| @@ -26,7 +26,7 @@ |
| #include "ipc/ipc_channel_proxy.h" |
| #include "ipc/ipc_message.h" |
| #include "ipc/ipc_message_macros.h" |
| - |
| +#include "remoting/host/constants.h" |
| #include "remoting/host/chromoting_messages.h" |
| #include "remoting/host/sas_injector.h" |
| #include "remoting/host/wts_console_monitor_win.h" |
| @@ -36,9 +36,12 @@ using base::TimeDelta; |
| namespace { |
| -// The exit code returned by the host process when its configuration is not |
| -// valid. |
| -const int kInvalidHostConfigurationExitCode = 1; |
| +// The range of host exit codes that should be interpreted as a permanent error |
| +// condition. |
| +enum { |
| + kHostPermanentErrorMin = remoting::kInvalidHostConfigurationExitCode, |
| + kHostPermanentErrorMax = remoting::kInvalidOauthCredentialsExitCode |
| +}; |
|
simonmorris
2012/04/17 19:52:30
It would be safer to define these alongside the ex
alexeypa (please no reviews)
2012/04/17 20:01:05
Done.
|
| // The minimum and maximum delays between attempts to inject host process into |
| // a session. |
| @@ -350,9 +353,11 @@ void WtsSessionProcessLauncher::OnObjectSignaled(HANDLE object) { |
| // Stop trying to restart the host if its process exited due to |
| // misconfiguration. |
| - DWORD exit_code; |
| - bool stop_trying = GetExitCodeProcess(process_.handle(), &exit_code) && |
| - exit_code == kInvalidHostConfigurationExitCode; |
| + int exit_code; |
| + bool stop_trying = |
| + base::WaitForExitCodeWithTimeout(process_.handle(), &exit_code, 0) && |
| + kHostPermanentErrorMin <= exit_code && |
| + exit_code <= kHostPermanentErrorMax; |
| // The host process has been terminated for some reason. The handle can now be |
| // closed. |