Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(476)

Side by Side Diff: remoting/host/win/launch_process_with_token.cc

Issue 11040065: [Chromoting] Reimplemented the worker process launcher to take into account the encountered issues: (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « remoting/host/win/host_service.cc ('k') | remoting/host/win/unprivileged_process_delegate.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « remoting/host/win/host_service.cc ('k') | remoting/host/win/unprivileged_process_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698