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

Unified 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: CR feedback. 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 side-by-side diff with in-line comments
Download patch
Index: remoting/host/win/launch_process_with_token.cc
diff --git a/remoting/host/win/launch_process_with_token.cc b/remoting/host/win/launch_process_with_token.cc
index 1320e2a3dd911fa932d1c3fafc93f62109e045f1..c531ff967c3a6850a84a6d5ff2b5a193d616cf3b 100644
--- a/remoting/host/win/launch_process_with_token.cc
+++ b/remoting/host/win/launch_process_with_token.cc
@@ -32,11 +32,6 @@ const WINSTATIONINFOCLASS kCreateProcessPipeNameClass =
const int kPipeBusyWaitTimeoutMs = 2000;
const int kPipeConnectMaxAttempts = 3;
-// The minimum and maximum delays between attempts to inject host process into
-// a session.
-const int kMaxLaunchDelaySeconds = 60;
-const int kMinLaunchDelaySeconds = 1;
-
// Name of the default session desktop.
const char kDefaultDesktopName[] = "winsta0\\default";
@@ -292,6 +287,32 @@ bool CreateRemoteSessionProcess(
<< response.process_information.dwProcessId;
return false;
}
+
+ // N.B. THREAD_ALL_ACCESS is different in XP and Vista+ versions of
+ // the SDK. |desired_access| below is effectively THREAD_ALL_ACCESS from
+ // the XP version of the SDK.
+ desired_access =
+ STANDARD_RIGHTS_REQUIRED |
+ SYNCHRONIZE |
+ THREAD_TERMINATE |
+ THREAD_SUSPEND_RESUME |
+ THREAD_GET_CONTEXT |
+ THREAD_SET_CONTEXT |
+ THREAD_QUERY_INFORMATION |
+ THREAD_SET_INFORMATION |
+ THREAD_SET_THREAD_TOKEN |
+ THREAD_IMPERSONATE |
+ THREAD_DIRECT_IMPERSONATION;
+ response.process_information.hThread =
+ OpenThread(desired_access,
+ FALSE,
+ response.process_information.dwThreadId);
+ if (!response.process_information.hThread) {
+ LOG_GETLASTERROR(ERROR) << "Failed to open thread "
+ << response.process_information.dwThreadId;
+ CloseHandle(response.process_information.hProcess);
+ return false;
+ }
}
*process_information_out = response.process_information;

Powered by Google App Engine
This is Rietveld 408576698