| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "remoting/host/win/launch_process_with_token.h" | 5 #include "remoting/host/win/launch_process_with_token.h" |
| 6 | 6 |
| 7 #include <windows.h> | 7 #include <windows.h> |
| 8 #include <winternl.h> | 8 #include <winternl.h> |
| 9 | 9 |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 | 25 |
| 26 // Undocumented WINSTATIONINFOCLASS value causing | 26 // Undocumented WINSTATIONINFOCLASS value causing |
| 27 // winsta!WinStationQueryInformationW() to return the name of the pipe for | 27 // winsta!WinStationQueryInformationW() to return the name of the pipe for |
| 28 // requesting cross-session process creation. | 28 // requesting cross-session process creation. |
| 29 const WINSTATIONINFOCLASS kCreateProcessPipeNameClass = | 29 const WINSTATIONINFOCLASS kCreateProcessPipeNameClass = |
| 30 static_cast<WINSTATIONINFOCLASS>(0x21); | 30 static_cast<WINSTATIONINFOCLASS>(0x21); |
| 31 | 31 |
| 32 const int kPipeBusyWaitTimeoutMs = 2000; | 32 const int kPipeBusyWaitTimeoutMs = 2000; |
| 33 const int kPipeConnectMaxAttempts = 3; | 33 const int kPipeConnectMaxAttempts = 3; |
| 34 | 34 |
| 35 // The minimum and maximum delays between attempts to inject host process into | |
| 36 // a session. | |
| 37 const int kMaxLaunchDelaySeconds = 60; | |
| 38 const int kMinLaunchDelaySeconds = 1; | |
| 39 | |
| 40 // Name of the default session desktop. | 35 // Name of the default session desktop. |
| 41 const char kDefaultDesktopName[] = "winsta0\\default"; | 36 const char kDefaultDesktopName[] = "winsta0\\default"; |
| 42 | 37 |
| 43 // Terminates the process and closes process and thread handles in | 38 // Terminates the process and closes process and thread handles in |
| 44 // |process_information| structure. | 39 // |process_information| structure. |
| 45 void CloseHandlesAndTerminateProcess(PROCESS_INFORMATION* process_information) { | 40 void CloseHandlesAndTerminateProcess(PROCESS_INFORMATION* process_information) { |
| 46 if (process_information->hThread) { | 41 if (process_information->hThread) { |
| 47 CloseHandle(process_information->hThread); | 42 CloseHandle(process_information->hThread); |
| 48 process_information->hThread = NULL; | 43 process_information->hThread = NULL; |
| 49 } | 44 } |
| (...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 510 return false; | 505 return false; |
| 511 } | 506 } |
| 512 | 507 |
| 513 CHECK(process_info.IsValid()); | 508 CHECK(process_info.IsValid()); |
| 514 process_out->Set(process_info.TakeProcessHandle()); | 509 process_out->Set(process_info.TakeProcessHandle()); |
| 515 thread_out->Set(process_info.TakeThreadHandle()); | 510 thread_out->Set(process_info.TakeThreadHandle()); |
| 516 return true; | 511 return true; |
| 517 } | 512 } |
| 518 | 513 |
| 519 } // namespace remoting | 514 } // namespace remoting |
| OLD | NEW |