| 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 c417144424f974e483b77ac3e8b87b219fbc1ae5..fe1d7d7f301c26cd6a90d23997832075ffae5f34 100644
|
| --- a/remoting/host/wts_session_process_launcher_win.cc
|
| +++ b/remoting/host/wts_session_process_launcher_win.cc
|
| @@ -27,7 +27,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"
|
| @@ -37,10 +37,6 @@ using base::TimeDelta;
|
|
|
| namespace {
|
|
|
| -// The exit code returned by the host process when its configuration is not
|
| -// valid.
|
| -const int kInvalidHostConfigurationExitCode = 1;
|
| -
|
| // The minimum and maximum delays between attempts to inject host process into
|
| // a session.
|
| const int kMaxLaunchDelaySeconds = 60;
|
| @@ -352,9 +348,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) &&
|
| + kMinPermanentErrorExitCode <= exit_code &&
|
| + exit_code <= kMaxPermanentErrorExitCode;
|
|
|
| // The host process has been terminated for some reason. The handle can now be
|
| // closed.
|
|
|