| Index: remoting/host/desktop_session_win.cc
|
| diff --git a/remoting/host/desktop_session_win.cc b/remoting/host/desktop_session_win.cc
|
| index 36d7fb1470067fb386c0666a89d2cd6174871180..5d126d2cd75d68a2eac6dce7656db17d3200b7de 100644
|
| --- a/remoting/host/desktop_session_win.cc
|
| +++ b/remoting/host/desktop_session_win.cc
|
| @@ -20,6 +20,7 @@
|
| #include "base/utf_string_conversions.h"
|
| #include "base/win/scoped_comptr.h"
|
| #include "base/win/scoped_handle.h"
|
| +#include "base/win/windows_version.h"
|
| #include "ipc/ipc_message_macros.h"
|
| #include "ipc/ipc_platform_file.h"
|
| #include "net/base/ip_endpoint.h"
|
| @@ -512,9 +513,20 @@ void DesktopSessionWin::OnSessionAttached(uint32 session_id) {
|
|
|
| ReportElapsedTime("attached");
|
|
|
| - // Get the name of the executable the desktop process will run.
|
| + // Launch elevated on Win8 to be able to inject Alt+Tab.
|
| + bool launch_elevated = base::win::GetVersion() >= base::win::VERSION_WIN8;
|
| +
|
| + // Get the name of the executable to run. |kDesktopBinaryName| specifies
|
| + // uiAccess="true" in it's manifest.
|
| base::FilePath desktop_binary;
|
| - if (!GetInstalledBinaryPath(kDesktopBinaryName, &desktop_binary)) {
|
| + bool result;
|
| + if (launch_elevated) {
|
| + result = GetInstalledBinaryPath(kDesktopBinaryName, &desktop_binary);
|
| + } else {
|
| + result = GetInstalledBinaryPath(kHostBinaryName, &desktop_binary);
|
| + }
|
| +
|
| + if (!result) {
|
| OnPermanentError();
|
| return;
|
| }
|
| @@ -530,13 +542,17 @@ void DesktopSessionWin::OnSessionAttached(uint32 session_id) {
|
|
|
| // Create a delegate capable of launching a process in a different session.
|
| scoped_ptr<WtsSessionProcessDelegate> delegate(
|
| - new WtsSessionProcessDelegate(
|
| - caller_task_runner_, io_task_runner_, target.Pass(), session_id, true,
|
| - WideToUTF8(kDaemonIpcSecurityDescriptor)));
|
| + new WtsSessionProcessDelegate(io_task_runner_,
|
| + target.Pass(),
|
| + launch_elevated,
|
| + WideToUTF8(kDaemonIpcSecurityDescriptor)));
|
| + if (!delegate->Initialize(session_id)) {
|
| + OnPermanentError();
|
| + return;
|
| + }
|
|
|
| // Create a launcher for the desktop process, using the per-session delegate.
|
| - launcher_.reset(new WorkerProcessLauncher(
|
| - caller_task_runner_, delegate.Pass(), this));
|
| + launcher_.reset(new WorkerProcessLauncher(delegate.Pass(), this));
|
| }
|
|
|
| void DesktopSessionWin::OnSessionDetached() {
|
|
|