diff options
41 files changed, 543 insertions, 721 deletions
diff --git a/chrome/tools/build/win/FILES.cfg b/chrome/tools/build/win/FILES.cfg index 35afa39..cade381 100644 --- a/chrome/tools/build/win/FILES.cfg +++ b/chrome/tools/build/win/FILES.cfg @@ -367,22 +367,10 @@ FILES = [ 'optional': ['dev'], }, { - 'filename': 'remoting_controller.exe', - 'buildtype': ['official'], - 'archive': 'remoting-win32.zip', - 'filegroup': ['symsrc'], - }, - { - 'filename': 'remoting_controller.exe.pdb', - 'buildtype': ['official'], - 'archive': 'remoting-win32.zip', - }, - { 'filename': 'remoting_core.dll', 'buildtype': ['official'], 'archive': 'remoting-win32.zip', 'filegroup': ['symsrc'], - 'optional': ['official'], }, { 'filename': 'remoting_core.dll.pdb', @@ -395,7 +383,6 @@ FILES = [ 'buildtype': ['official'], 'archive': 'remoting-win32.zip', 'filegroup': ['symsrc'], - 'optional': ['official'], }, { 'filename': 'remoting_desktop.exe.pdb', @@ -404,17 +391,6 @@ FILES = [ 'optional': ['official'], }, { - 'filename': 'remoting_daemon.exe', - 'buildtype': ['official'], - 'archive': 'remoting-win32.zip', - 'filegroup': ['symsrc'], - }, - { - 'filename': 'remoting_daemon.exe.pdb', - 'buildtype': ['official'], - 'archive': 'remoting-win32.zip', - }, - { 'filename': 'remoting_host.exe', 'buildtype': ['official'], 'archive': 'remoting-win32.zip', diff --git a/remoting/branding_Chrome b/remoting/branding_Chrome index e199668..1307495 100644 --- a/remoting/branding_Chrome +++ b/remoting/branding_Chrome @@ -6,8 +6,6 @@ HOST_PLUGIN_DESCRIPTION=Allow another user to access your computer securely over HOST_ME2ME_FILE_NAME=Chrome Remote Desktop Host HOST_ME2ME_DESCRIPTION=Chrome Remote Desktop Host DAEMON_FILE_NAME=Chrome Remote Desktop Host Service -DAEMON_DESCRIPTION=Chrome Remote Desktop Host Service -CONTROLLER_DESCRIPTION=Chrome Remote Desktop Host Controller DESKTOP_DESCRIPTION=Chrome Remote Desktop Integration Process CORE_DESCRIPTION=Chrome Remote Desktop Core MAC_BUNDLE_ID=com.google.Chrome diff --git a/remoting/branding_Chromium b/remoting/branding_Chromium index 83f9085..5d3d740 100644 --- a/remoting/branding_Chromium +++ b/remoting/branding_Chromium @@ -6,8 +6,6 @@ HOST_PLUGIN_DESCRIPTION=Allow another user to access your computer securely over HOST_ME2ME_FILE_NAME=Chromoting Host HOST_ME2ME_DESCRIPTION=Chromoting Host DAEMON_FILE_NAME=Chromoting Host Service -DAEMON_DESCRIPTION=Chromoting Host Service -CONTROLLER_DESCRIPTION=Chromoting Host Controller DESKTOP_DESCRIPTION=Chromoting Integration Process CORE_DESCRIPTION=Chromoting Core MAC_BUNDLE_ID=org.chromium.Chromium diff --git a/remoting/host/daemon_process_win.cc b/remoting/host/daemon_process_win.cc index 9c9ea48..dfd61db 100644 --- a/remoting/host/daemon_process_win.cc +++ b/remoting/host/daemon_process_win.cc @@ -22,6 +22,7 @@ #include "remoting/host/chromoting_messages.h" #include "remoting/host/desktop_session_win.h" #include "remoting/host/host_exit_codes.h" +#include "remoting/host/host_main.h" #include "remoting/host/ipc_constants.h" #include "remoting/host/win/host_service.h" #include "remoting/host/win/launch_process_with_token.h" @@ -35,6 +36,10 @@ namespace remoting { class WtsConsoleMonitor; +// The command line parameters that should be copied from the service's command +// line to the host process. +const char* kCopiedSwitchNames[] = { switches::kV, switches::kVModule }; + class DaemonProcessWin : public DaemonProcess { public: DaemonProcessWin( @@ -155,9 +160,15 @@ void DaemonProcessWin::LaunchNetworkProcess() { return; } + scoped_ptr<CommandLine> target(new CommandLine(host_binary)); + target->AppendSwitchASCII(kProcessTypeSwitchName, kProcessTypeHost); + target->CopySwitchesFrom(*CommandLine::ForCurrentProcess(), + kCopiedSwitchNames, + arraysize(kCopiedSwitchNames)); + scoped_ptr<UnprivilegedProcessDelegate> delegate( new UnprivilegedProcessDelegate(caller_task_runner(), io_task_runner(), - host_binary)); + target.Pass())); network_launcher_.reset(new WorkerProcessLauncher( caller_task_runner(), delegate.Pass(), this)); } diff --git a/remoting/host/desktop_process_main.cc b/remoting/host/desktop_process_main.cc index 0b121d3..9432108 100644 --- a/remoting/host/desktop_process_main.cc +++ b/remoting/host/desktop_process_main.cc @@ -5,121 +5,29 @@ // This file implements the Windows service controlling Me2Me host processes // running within user sessions. -#include "remoting/host/desktop_process_main.h" - -#include "base/at_exit.h" #include "base/bind.h" #include "base/bind_helpers.h" #include "base/command_line.h" -#include "base/file_path.h" #include "base/memory/scoped_ptr.h" #include "base/message_loop.h" #include "base/run_loop.h" -#include "base/scoped_native_library.h" -#include "base/stringprintf.h" -#include "base/utf_string_conversions.h" -#include "base/win/windows_version.h" #include "remoting/base/auto_thread_task_runner.h" -#include "remoting/base/breakpad.h" #include "remoting/host/basic_desktop_environment.h" #include "remoting/host/desktop_process.h" #include "remoting/host/host_exit_codes.h" -#include "remoting/host/logging.h" -#include "remoting/host/usage_stats_consent.h" +#include "remoting/host/host_main.h" +#include "remoting/host/ipc_constants.h" #include "remoting/host/win/session_desktop_environment.h" -#if defined(OS_MACOSX) -#include "base/mac/scoped_nsautorelease_pool.h" -#endif // defined(OS_MACOSX) - -#if defined(OS_WIN) -#include <commctrl.h> -#endif // defined(OS_WIN) - -namespace { - -// The command line switch specifying the name of the daemon IPC endpoint. -const char kDaemonIpcSwitchName[] = "daemon-pipe"; - -// "--help" or "--?" prints the usage message. -const char kHelpSwitchName[] = "help"; -const char kQuestionSwitchName[] = "?"; - -const char kUsageMessage[] = - "\n" - "Usage: %s [options]\n" - "\n" - "Options:\n" - " --help, --? - Print this message.\n"; - -void Usage(const base::FilePath& program_name) { - std::string display_name = UTF16ToUTF8(program_name.LossyDisplayName()); - LOG(INFO) << StringPrintf(kUsageMessage, display_name.c_str()); -} - -} // namespace - namespace remoting { -int DesktopProcessMain(int argc, char** argv) { -#if defined(OS_MACOSX) - // Needed so we don't leak objects when threads are created. - base::mac::ScopedNSAutoreleasePool pool; -#endif - - CommandLine::Init(argc, argv); - - // Initialize Breakpad as early as possible. On Mac the command-line needs to - // be initialized first, so that the preference for crash-reporting can be - // looked up in the config file. -#if defined(OFFICIAL_BUILD) && (defined(MAC_BREAKPAD) || defined(OS_WIN)) - if (IsUsageStatsAllowed()) { - InitializeCrashReporting(); - } -#endif // defined(OFFICIAL_BUILD) && (defined(MAC_BREAKPAD) || defined(OS_WIN)) - - // This object instance is required by Chrome code (for example, - // LazyInstance, MessageLoop). - base::AtExitManager exit_manager; - - InitHostLogging(); - -#if defined(OS_WIN) - // Register and initialize common controls. - INITCOMMONCONTROLSEX info; - info.dwSize = sizeof(info); - info.dwICC = ICC_STANDARD_CLASSES; - InitCommonControlsEx(&info); - - // Mark the process as DPI-aware, so Windows won't scale coordinates in APIs. - // N.B. This API exists on Vista and above. - if (base::win::GetVersion() >= base::win::VERSION_VISTA) { - base::FilePath path(base::GetNativeLibraryName(UTF8ToUTF16("user32"))); - base::ScopedNativeLibrary user32(path); - CHECK(user32.is_valid()); - - typedef BOOL (WINAPI * SetProcessDPIAwareFn)(); - SetProcessDPIAwareFn set_process_dpi_aware = - static_cast<SetProcessDPIAwareFn>( - user32.GetFunctionPointer("SetProcessDPIAware")); - set_process_dpi_aware(); - } -#endif // defined(OS_WIN) - +int DesktopProcessMain() { const CommandLine* command_line = CommandLine::ForCurrentProcess(); - if (command_line->HasSwitch(kHelpSwitchName) || - command_line->HasSwitch(kQuestionSwitchName)) { - Usage(command_line->GetProgram()); - return kSuccessExitCode; - } - std::string channel_name = - command_line->GetSwitchValueASCII(kDaemonIpcSwitchName); + command_line->GetSwitchValueASCII(kDaemonPipeSwitchName); - if (channel_name.empty()) { - Usage(command_line->GetProgram()); + if (channel_name.empty()) return kUsageExitCode; - } MessageLoop message_loop(MessageLoop::TYPE_UI); base::RunLoop run_loop; @@ -155,6 +63,6 @@ int DesktopProcessMain(int argc, char** argv) { #if !defined(OS_WIN) int main(int argc, char** argv) { - return remoting::DesktopProcessMain(argc, argv); + return remoting::HostMain(argc, argv); } #endif // !defined(OS_WIN) diff --git a/remoting/host/desktop_process_main.h b/remoting/host/desktop_process_main.h deleted file mode 100644 index f9724f9..0000000 --- a/remoting/host/desktop_process_main.h +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef REMOTING_HOST_DESKTOP_PROCESS_MAIN_H_ -#define REMOTING_HOST_DESKTOP_PROCESS_MAIN_H_ - -#include "remoting/host/host_export.h" - -namespace remoting { - -// The desktop process's entry point. -HOST_EXPORT int DesktopProcessMain(int argc, char** argv); - -} // namespace remoting - -#endif // REMOTING_HOST_DESKTOP_PROCESS_MAIN_H_ diff --git a/remoting/host/desktop_session_win.cc b/remoting/host/desktop_session_win.cc index 288aba5..59730d3 100644 --- a/remoting/host/desktop_session_win.cc +++ b/remoting/host/desktop_session_win.cc @@ -4,11 +4,15 @@ #include "remoting/host/desktop_session_win.h" +#include "base/base_switches.h" +#include "base/command_line.h" #include "base/path_service.h" #include "ipc/ipc_message_macros.h" #include "remoting/base/auto_thread_task_runner.h" #include "remoting/host/chromoting_messages.h" #include "remoting/host/daemon_process.h" +#include "remoting/host/host_main.h" +#include "remoting/host/ipc_constants.h" #include "remoting/host/sas_injector.h" #include "remoting/host/win/worker_process_launcher.h" #include "remoting/host/win/wts_console_monitor.h" @@ -18,13 +22,14 @@ using base::win::ScopedHandle; namespace { -const base::FilePath::CharType kDesktopBinaryName[] = - FILE_PATH_LITERAL("remoting_desktop.exe"); - // The security descriptor of the daemon IPC endpoint. It gives full access // to LocalSystem and denies access by anyone else. const char kDaemonIpcSecurityDescriptor[] = "O:SYG:SYD:(A;;GA;;;SY)"; +// The command line parameters that should be copied from the service's command +// line to the host process. +const char* kCopiedSwitchNames[] = { switches::kV, switches::kVModule }; + } // namespace namespace remoting { @@ -93,21 +98,23 @@ void DesktopSessionWin::OnSessionAttached(uint32 session_id) { DCHECK(main_task_runner_->BelongsToCurrentThread()); DCHECK(launcher_.get() == NULL); - // Construct the host binary name. - if (desktop_binary_.empty()) { - base::FilePath dir_path; - if (!PathService::Get(base::DIR_EXE, &dir_path)) { - LOG(ERROR) << "Failed to get the executable file name."; - OnPermanentError(); - return; - } - desktop_binary_ = dir_path.Append(kDesktopBinaryName); + // Get the desktop binary name. + base::FilePath desktop_binary; + if (!GetInstalledBinaryPath(kDesktopBinaryName, &desktop_binary)) { + OnPermanentError(); + return; } + scoped_ptr<CommandLine> target(new CommandLine(desktop_binary)); + target->AppendSwitchASCII(kProcessTypeSwitchName, kProcessTypeDesktop); + target->CopySwitchesFrom(*CommandLine::ForCurrentProcess(), + kCopiedSwitchNames, + arraysize(kCopiedSwitchNames)); + // Create a delegate to launch a process into the session. scoped_ptr<WtsSessionProcessDelegate> delegate( new WtsSessionProcessDelegate(main_task_runner_, io_task_runner_, - desktop_binary_, session_id, + target.Pass(), session_id, true, kDaemonIpcSecurityDescriptor)); // Create a launcher for the desktop process, using the per-session delegate. diff --git a/remoting/host/host_main.cc b/remoting/host/host_main.cc new file mode 100644 index 0000000..c6af95d --- /dev/null +++ b/remoting/host/host_main.cc @@ -0,0 +1,234 @@ +// Copyright (c) 2013 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. +// +// This file implements the common entry point shared by all Chromoting Host +// processes. + +#include "remoting/host/host_main.h" + +#include <string> + +#include "base/at_exit.h" +#include "base/command_line.h" +#include "base/file_path.h" +#include "base/logging.h" +#include "base/stringprintf.h" +#include "base/strings/stringize_macros.h" +#include "base/utf_string_conversions.h" +#include "remoting/base/breakpad.h" +#include "remoting/host/host_exit_codes.h" +#include "remoting/host/logging.h" +#include "remoting/host/usage_stats_consent.h" + +#if defined(OS_MACOSX) +#include "base/mac/scoped_nsautorelease_pool.h" +#endif // defined(OS_MACOSX) + +#if defined(OS_WIN) +#include <commctrl.h> +#include <shellapi.h> +#endif // defined(OS_WIN) + +namespace remoting { + +// Known entry points. +int HostProcessMain(); + +#if defined(REMOTING_MULTI_PROCESS) +int DaemonProcessMain(); +int DesktopProcessMain(); +#endif // defined(REMOTING_MULTI_PROCESS) + +#if defined(OS_WIN) +int ElevatedControllerMain(); +#endif // defined(OS_WIN) + +const char kElevateSwitchName[] = "elevate"; +const char kProcessTypeSwitchName[] = "type"; + +const char kProcessTypeHost[] = "host"; + +#if defined(REMOTING_MULTI_PROCESS) +const char kProcessTypeDaemon[] = "daemon"; +const char kProcessTypeDesktop[] = "desktop"; +#endif // defined(REMOTING_MULTI_PROCESS) + +#if defined(OS_WIN) +const char kProcessTypeController[] = "controller"; +#endif // defined(OS_WIN) + +namespace { + +typedef int (*MainRoutineFn)(); + +// "--help" or "--?" prints the usage message. +const char kHelpSwitchName[] = "help"; +const char kQuestionSwitchName[] = "?"; + +// The command line switch used to get version of the daemon. +const char kVersionSwitchName[] = "version"; + +const char kUsageMessage[] = + "Usage: %s [options]\n" + "\n" + "Options:\n" + " --audio-pipe-name=<pipe> - Sets the pipe name to capture audio on Linux.\n" + " --console - Runs the daemon interactively.\n" + " --daemon-pipe=<pipe> - Specifies the pipe to connect to the daemon.\n" + " --elevate=<binary> - Runs <binary> elevated.\n" + " --host-config=<config> - Specifies the host configuration.\n" + " --help, -? - Print this message.\n" + " --type - Specifies process type.\n" + " --version - Prints the host version and exits.\n"; + +void Usage(const base::FilePath& program_name) { + printf(kUsageMessage, program_name.MaybeAsASCII().c_str()); +} + +#if defined(OS_WIN) + +// Runs the binary specified by the command line, elevated. +int RunElevated() { + const CommandLine::SwitchMap& switches = + CommandLine::ForCurrentProcess()->GetSwitches(); + const CommandLine::StringVector& args = + CommandLine::ForCurrentProcess()->GetArgs(); + + // Create the child process command line by copying switches from the current + // command line. + CommandLine command_line(CommandLine::NO_PROGRAM); + for (CommandLine::SwitchMap::const_iterator i = switches.begin(); + i != switches.end(); ++i) { + if (i->first != kElevateSwitchName) + command_line.AppendSwitchNative(i->first, i->second); + } + for (CommandLine::StringVector::const_iterator i = args.begin(); + i != args.end(); ++i) { + command_line.AppendArgNative(*i); + } + + // Get the name of the binary to launch. + base::FilePath binary = + CommandLine::ForCurrentProcess()->GetSwitchValuePath(kElevateSwitchName); + CommandLine::StringType parameters = command_line.GetCommandLineString(); + + // Launch the child process requesting elevation. + SHELLEXECUTEINFO info; + memset(&info, 0, sizeof(info)); + info.cbSize = sizeof(info); + info.lpVerb = L"runas"; + info.lpFile = binary.value().c_str(); + info.lpParameters = parameters.c_str(); + info.nShow = SW_SHOWNORMAL; + + if (!ShellExecuteEx(&info)) { + return GetLastError(); + } + + return kSuccessExitCode; +} + +#endif // defined(OS_WIN) + +// Select the entry point corresponding to the process type. +MainRoutineFn SelectMainRoutine(const std::string& process_type) { + MainRoutineFn main_routine = NULL; + +#if defined(REMOTING_MULTI_PROCESS) + if (process_type == kProcessTypeDaemon) { + main_routine = &DaemonProcessMain; + } else if (process_type == kProcessTypeDesktop) { + main_routine = &DesktopProcessMain; + } +#endif // defined(REMOTING_MULTI_PROCESS) + +#if defined(OS_WIN) + if (process_type == kProcessTypeController) { + main_routine = &ElevatedControllerMain; + } +#endif // defined(OS_WIN) + + if (process_type == kProcessTypeHost) { + main_routine = &HostProcessMain; + } + + return main_routine; +} + +} // namespace + +int HostMain(int argc, char** argv) { +#if defined(OS_MACOSX) + // Needed so we don't leak objects when threads are created. + base::mac::ScopedNSAutoreleasePool pool; +#endif + + CommandLine::Init(argc, argv); + + // Initialize Breakpad as early as possible. On Mac the command-line needs to + // be initialized first, so that the preference for crash-reporting can be + // looked up in the config file. +#if defined(REMOTING_ENABLE_BREAKPAD) + if (IsUsageStatsAllowed()) { + InitializeCrashReporting(); + } +#endif // defined(REMOTING_ENABLE_BREAKPAD) + + // This object instance is required by Chrome code (for example, + // LazyInstance, MessageLoop). + base::AtExitManager exit_manager; + + // Enable debug logs. + InitHostLogging(); + + // Register and initialize common controls. +#if defined(OS_WIN) + INITCOMMONCONTROLSEX info; + info.dwSize = sizeof(info); + info.dwICC = ICC_STANDARD_CLASSES; + InitCommonControlsEx(&info); +#endif // defined(OS_WIN) + + // Parse the command line. + const CommandLine* command_line = CommandLine::ForCurrentProcess(); + if (command_line->HasSwitch(kHelpSwitchName) || + command_line->HasSwitch(kQuestionSwitchName)) { + Usage(command_line->GetProgram()); + return kSuccessExitCode; + } + + if (command_line->HasSwitch(kVersionSwitchName)) { + printf("%s\n", STRINGIZE(VERSION)); + return kSuccessExitCode; + } + +#if defined(OS_WIN) + if (command_line->HasSwitch(kElevateSwitchName)) { + return RunElevated(); + } +#endif // defined(OS_WIN) + + // Assume the host process by default. + std::string process_type = kProcessTypeHost; + if (command_line->HasSwitch(kProcessTypeSwitchName)) { + process_type = command_line->GetSwitchValueASCII(kProcessTypeSwitchName); + } + + MainRoutineFn main_routine = SelectMainRoutine(process_type); + if (!main_routine) { + fprintf(stderr, "Unknown process type '%s' specified.", + process_type.c_str()); + Usage(command_line->GetProgram()); + return kUsageExitCode; + } + + // Invoke the entry point. + int exit_code = main_routine(); + if (exit_code == kUsageExitCode) { + Usage(command_line->GetProgram()); + } + return exit_code; +} + +} // namespace remoting diff --git a/remoting/host/host_main.h b/remoting/host/host_main.h new file mode 100644 index 0000000..5dbdd35 --- /dev/null +++ b/remoting/host/host_main.h @@ -0,0 +1,37 @@ +// Copyright (c) 2013 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef REMOTING_HOST_ENTRY_POINT_H_ +#define REMOTING_HOST_ENTRY_POINT_H_ + +#include "remoting/host/host_export.h" + +namespace remoting { + +// "--elevate=<binary>" requests |binary| to be launched elevated (possibly +// causing a UAC prompt). +extern const char kElevateSwitchName[]; + +// "--type=<type>" specifies the kind of process to run. +extern const char kProcessTypeSwitchName[]; + +extern const char kProcessTypeHost[]; + +#if defined(REMOTING_MULTI_PROCESS) +extern const char kProcessTypeDaemon[]; +extern const char kProcessTypeDesktop[]; +#endif // defined(REMOTING_MULTI_PROCESS) + +#if defined(OS_WIN) +extern const char kProcessTypeController[]; +#endif // defined(OS_WIN) + +// The common entry point exported from remoting_core.dll. It uses +// "--type==<type>" command line parameter to determine the kind of process it +// needs to run. +HOST_EXPORT int HostMain(int argc, char** argv); + +} // namespace remoting + +#endif // REMOTING_HOST_ENTRY_POINT_H_ diff --git a/remoting/host/installer/win/chromoting.wxs b/remoting/host/installer/win/chromoting.wxs index 34ab9fe..47a2189 100644 --- a/remoting/host/installer/win/chromoting.wxs +++ b/remoting/host/installer/win/chromoting.wxs @@ -26,7 +26,7 @@ <?define CoreBinary = "remoting_core.dll" ?> <?define ControllerAppid = "{4ff35d5e-d226-4550-9248-03e7779e67de}" ?> - <?define ControllerBinary = "remoting_controller.exe" ?> + <?define ControllerBinary = "remoting_host.exe" ?> <?define ControllerClass = "ElevatedController Class" ?> <?define ControllerProgid = "ChromotingElevatedController.ElevatedController" ?> @@ -155,21 +155,28 @@ SupportsInformationals="yes"/> </Component> - <?if $(var.RemotingMultiProcess) != 0 ?> - <Component Id="remoting_desktop" Guid="*"> - <File Id="remoting_desktop.exe" - DiskId="1" - KeyPath="yes" - Name="remoting_desktop.exe" - Vital="yes"/> - </Component> - <?endif?> - - <Component Id="remoting_daemon" Guid="*"> - <File Id="remoting_daemon.exe" + <Component Id="remoting_desktop" Guid="*"> + <File Id="remoting_desktop.exe" DiskId="1" KeyPath="yes" - Name="remoting_daemon.exe" + Name="remoting_desktop.exe" + Vital="yes"/> + + <?if $(var.RemotingMultiProcess) = 0 ?> + <fire:FirewallException xmlns:fire="http://schemas.microsoft.com/wix/FirewallExtension" + Id="me2me_firewall_exception" + IgnoreFailure="yes" + Name="$(var.FirewallName)" + Profile="all" + Program="[#remoting_desktop.exe]" + Scope="any" /> + <?endif?> + </Component> + + <Component Id="remoting_host" Guid="*"> + <File Id="remoting_host.exe" + DiskId="1" + Name="remoting_host.exe" Vital="yes"/> <ServiceInstall Id="install_service" @@ -178,7 +185,7 @@ Name="$(var.ServiceName)" DisplayName="[chromoting_service_display_name]" Description="[chromoting_service_description]" - Arguments="--host-config="[config_files]host.json"" + Arguments="--type=daemon --host-config="[config_files]host.json"" Start="demand" Account="LocalSystem" ErrorControl="ignore" @@ -189,20 +196,16 @@ Remove="uninstall" Name="$(var.ServiceName)" Wait="yes" /> - </Component> - <Component Id="remoting_host" Guid="*"> - <File Id="remoting_host.exe" - DiskId="1" - Name="remoting_host.exe" - Vital="yes"/> - <fire:FirewallException xmlns:fire="http://schemas.microsoft.com/wix/FirewallExtension" - Id="me2me_firewall_exception" - IgnoreFailure="yes" - Name="$(var.FirewallName)" - Profile="all" - Program="[#remoting_host.exe]" - Scope="any" /> + <?if $(var.RemotingMultiProcess) != 0 ?> + <fire:FirewallException xmlns:fire="http://schemas.microsoft.com/wix/FirewallExtension" + Id="me2me_firewall_exception" + IgnoreFailure="yes" + Name="$(var.FirewallName)" + Profile="all" + Program="[#remoting_host.exe]" + Scope="any" /> + <?endif?> </Component> <?if $(var.OfficialBuild) != 0 ?> @@ -223,11 +226,6 @@ <?endif?> <Component Id="remoting_controller" Guid="*"> - <File Id="$(var.ControllerBinary)" - DiskId="1" - Name="$(var.ControllerBinary)" - Vital="yes"/> - <RegistryKey Root="HKLM" Key="SOFTWARE\Classes"> <RegistryKey Key="AppId"> @@ -287,7 +285,7 @@ <RegistryKey Key="LocalServer32" Action="create"> <RegistryValue Type="string" - Value="[#$(var.ControllerBinary)]"/> + Value="[binaries]$(var.ControllerBinary) --type=controller"/> </RegistryKey> <RegistryKey Key="ProgID" Action="create"> @@ -471,10 +469,7 @@ <?endif?> <ComponentRef Id="remoting_controller"/> <ComponentRef Id="remoting_core"/> - <ComponentRef Id="remoting_daemon"/> - <?if $(var.RemotingMultiProcess) != 0 ?> - <ComponentRef Id="remoting_desktop"/> - <?endif?> + <ComponentRef Id="remoting_desktop"/> <ComponentRef Id="remoting_host"/> <ComponentRef Id="sas"/> <ComponentRef Id="sawbuck_provider"/> diff --git a/remoting/host/installer/win/parameters.json b/remoting/host/installer/win/parameters.json index 257fbca..d5c13cd 100644 --- a/remoting/host/installer/win/parameters.json +++ b/remoting/host/installer/win/parameters.json @@ -12,9 +12,7 @@ "WixUtilExtension.dll" ], "sign": [ - "remoting_controller.exe", "remoting_core.dll", - "remoting_daemon.exe", "remoting_desktop.exe", "remoting_host.exe" ], diff --git a/remoting/host/ipc_constants.cc b/remoting/host/ipc_constants.cc index 9aac903..9702c65 100644 --- a/remoting/host/ipc_constants.cc +++ b/remoting/host/ipc_constants.cc @@ -12,12 +12,12 @@ namespace remoting { const char kDaemonPipeSwitchName[] = "daemon-pipe"; -const base::FilePath::CharType kDaemonBinaryName[] = - FILE_PATH_LITERAL("remoting_daemon"); - const base::FilePath::CharType kHostBinaryName[] = FILE_PATH_LITERAL("remoting_host"); +const base::FilePath::CharType kDesktopBinaryName[] = + FILE_PATH_LITERAL("remoting_desktop"); + bool GetInstalledBinaryPath(const base::FilePath::StringType& binary, base::FilePath* full_path) { base::FilePath dir_path; diff --git a/remoting/host/ipc_constants.h b/remoting/host/ipc_constants.h index d990206..abe6899 100644 --- a/remoting/host/ipc_constants.h +++ b/remoting/host/ipc_constants.h @@ -12,12 +12,12 @@ namespace remoting { // The command line switch specifying the daemon IPC endpoint. extern const char kDaemonPipeSwitchName[]; -// Name of the daemon process binary. -extern const base::FilePath::CharType kDaemonBinaryName[]; - // Name of the host process binary. extern const base::FilePath::CharType kHostBinaryName[]; +// Name of the desktop process binary. +extern const base::FilePath::CharType kDesktopBinaryName[]; + // Returns the full path to an installed |binary| in |full_path|. bool GetInstalledBinaryPath(const base::FilePath::StringType& binary, base::FilePath* full_path); diff --git a/remoting/host/remoting_me2me_host.cc b/remoting/host/remoting_me2me_host.cc index 4f358ec..b607e76 100644 --- a/remoting/host/remoting_me2me_host.cc +++ b/remoting/host/remoting_me2me_host.cc @@ -4,8 +4,6 @@ // // This file implements a standalone host process for Me2Me. -#include "remoting/host/remoting_me2me_host.h" - #include <string> #include "base/at_exit.h" @@ -17,15 +15,12 @@ #include "base/logging.h" #include "base/memory/scoped_ptr.h" #include "base/message_loop.h" -#include "base/scoped_native_library.h" #include "base/single_thread_task_runner.h" #include "base/string_number_conversions.h" #include "base/string_util.h" -#include "base/strings/stringize_macros.h" #include "base/synchronization/waitable_event.h" #include "base/threading/thread.h" #include "base/utf_string_conversions.h" -#include "base/win/windows_version.h" #include "build/build_config.h" #include "crypto/nss_util.h" #include "ipc/ipc_channel.h" @@ -55,6 +50,7 @@ #include "remoting/host/host_config.h" #include "remoting/host/host_event_logger.h" #include "remoting/host/host_exit_codes.h" +#include "remoting/host/host_main.h" #include "remoting/host/host_user_interface.h" #include "remoting/host/ipc_constants.h" #include "remoting/host/ipc_desktop_environment.h" @@ -82,7 +78,6 @@ #if defined(OS_MACOSX) #include "base/mac/scoped_cftyperef.h" -#include "base/mac/scoped_nsautorelease_pool.h" #endif // defined(OS_MACOSX) #if defined(OS_LINUX) @@ -104,9 +99,6 @@ namespace { // This is used for tagging system event logs. const char kApplicationName[] = "chromoting"; -// The command line switch used to get version of the daemon. -const char kVersionSwitchName[] = "version"; - // The command line switch used to pass name of the pipe to capture audio on // linux. const char kAudioPipeSwitchName[] = "audio-pipe-name"; @@ -1072,62 +1064,12 @@ void HostProcess::OnCrash(const std::string& function_name, CHECK(false); } -int HostProcessMain(int argc, char** argv) { -#if defined(OS_MACOSX) - // Needed so we don't leak objects when threads are created. - base::mac::ScopedNSAutoreleasePool pool; -#endif - - CommandLine::Init(argc, argv); - - // Initialize Breakpad as early as possible. On Mac the command-line needs to - // be initialized first, so that the preference for crash-reporting can be - // looked up in the config file. -#if defined(OFFICIAL_BUILD) && (defined(MAC_BREAKPAD) || defined(OS_WIN)) - if (IsUsageStatsAllowed()) { - InitializeCrashReporting(); - } -#endif // defined(OFFICIAL_BUILD) && (defined(MAC_BREAKPAD) || defined(OS_WIN)) - - // This object instance is required by Chrome code (for example, - // LazyInstance, MessageLoop). - base::AtExitManager exit_manager; - - if (CommandLine::ForCurrentProcess()->HasSwitch(kVersionSwitchName)) { - printf("%s\n", STRINGIZE(VERSION)); - return 0; - } - - InitHostLogging(); - -#if defined(OS_WIN) - // Register and initialize common controls. - INITCOMMONCONTROLSEX info; - info.dwSize = sizeof(info); - info.dwICC = ICC_STANDARD_CLASSES; - InitCommonControlsEx(&info); - - // Mark the process as DPI-aware, so Windows won't scale coordinates in APIs. - // N.B. This API exists on Vista and above. - if (base::win::GetVersion() >= base::win::VERSION_VISTA) { - base::FilePath path(base::GetNativeLibraryName(UTF8ToUTF16("user32"))); - base::ScopedNativeLibrary user32(path); - CHECK(user32.is_valid()); - - typedef BOOL (WINAPI * SetProcessDPIAwareFn)(); - SetProcessDPIAwareFn set_process_dpi_aware = - static_cast<SetProcessDPIAwareFn>( - user32.GetFunctionPointer("SetProcessDPIAware")); - set_process_dpi_aware(); - } -#endif // defined(OS_WIN) - +int HostProcessMain() { #if defined(TOOLKIT_GTK) // Required for any calls into GTK functions, such as the Disconnect and // Continue windows, though these should not be used for the Me2Me case // (crbug.com/104377). - const CommandLine* cmd_line = CommandLine::ForCurrentProcess(); - gfx::GtkInitFromCommandLine(*cmd_line); + gfx::GtkInitFromCommandLine(*CommandLine::ForCurrentProcess()); #endif // TOOLKIT_GTK // Enable support for SSL server sockets, which must be done while still @@ -1159,6 +1101,6 @@ int HostProcessMain(int argc, char** argv) { #if !defined(OS_WIN) int main(int argc, char** argv) { - return remoting::HostProcessMain(argc, argv); + return remoting::HostMain(argc, argv); } #endif // !defined(OS_WIN) diff --git a/remoting/host/remoting_me2me_host.h b/remoting/host/remoting_me2me_host.h deleted file mode 100644 index 59443a4..0000000 --- a/remoting/host/remoting_me2me_host.h +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright (c) 2013 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef REMOTING_HOST_REMOTING_ME2ME_HOST_H_ -#define REMOTING_HOST_REMOTING_ME2ME_HOST_H_ - -#include "remoting/host/host_export.h" - -namespace remoting { - -// The host process's entry point exported from remoting_core.dll. -HOST_EXPORT int HostProcessMain(int argc, char** argv); - -} // namespace remoting - -#endif // REMOTING_HOST_REMOTING_ME2ME_HOST_H_ diff --git a/remoting/host/plugin/remoting_host_plugin.manifest b/remoting/host/win/comctl32_v6.manifest index d351754..d351754 100644 --- a/remoting/host/plugin/remoting_host_plugin.manifest +++ b/remoting/host/win/comctl32_v6.manifest diff --git a/remoting/host/win/core.cc b/remoting/host/win/core.cc index 2acbb05..aeeb457 100644 --- a/remoting/host/win/core.cc +++ b/remoting/host/win/core.cc @@ -4,8 +4,6 @@ #include <windows.h> -#include "remoting/host/remoting_me2me_host.h" - BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, void* reserved) { if (reason == DLL_PROCESS_ATTACH) DisableThreadLibraryCalls(instance); diff --git a/remoting/host/win/daemon_process_entry_point.cc b/remoting/host/win/daemon_process_entry_point.cc deleted file mode 100644 index 9367a8b..0000000 --- a/remoting/host/win/daemon_process_entry_point.cc +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright (c) 2013 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include <windows.h> - -#include "remoting/host/win/daemon_process_main.h" - -// The entry point of the daemon process binary. In order to be really small -// the app doesn't link against the CRT. -void DaemonProcessEntryPoint() { - int exit_code = remoting::DaemonProcessMain(); - ExitProcess(exit_code); -} diff --git a/remoting/host/win/daemon_process_main.cc b/remoting/host/win/daemon_process_main.cc deleted file mode 100644 index 43b4d0c..0000000 --- a/remoting/host/win/daemon_process_main.cc +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. -// -// This file implements the Windows service controlling Me2Me host processes -// running within user sessions. - -#include "remoting/host/win/daemon_process_main.h" - -#include "base/at_exit.h" -#include "base/base_switches.h" -#include "base/command_line.h" -#include "base/file_path.h" -#include "base/stringprintf.h" -#include "base/utf_string_conversions.h" -#include "remoting/base/breakpad.h" -#include "remoting/host/branding.h" -#include "remoting/host/host_exit_codes.h" -#include "remoting/host/logging.h" -#include "remoting/host/usage_stats_consent.h" -#include "remoting/host/win/host_service.h" - -using base::StringPrintf; - -namespace { - -// Command line switches: - -// "--help" or "--?" prints the usage message. -const char kHelpSwitchName[] = "help"; -const char kQuestionSwitchName[] = "?"; - -const wchar_t kUsageMessage[] = - L"\n" - L"Usage: %ls [options]\n" - L"\n" - L"Options:\n" - L" --console - Run the service interactively for debugging purposes.\n" - L" --elevate=<...> - Run <...> elevated.\n" - L" --help, --? - Print this message.\n"; - -// The command line parameters that should be copied from the service's command -// line when launching an elevated child. -const char* kCopiedSwitchNames[] = { - "host-config", "daemon-pipe", switches::kV, switches::kVModule }; - -void usage(const base::FilePath& program_name) { - LOG(INFO) << StringPrintf(kUsageMessage, - UTF16ToWide(program_name.value()).c_str()); -} - -} // namespace - -namespace remoting { - -int DaemonProcessMain() { -#ifdef OFFICIAL_BUILD - if (IsUsageStatsAllowed()) { - InitializeCrashReporting(); - } -#endif // OFFICIAL_BUILD - - // This object instance is required by Chrome code (for example, - // FilePath, LazyInstance, MessageLoop, Singleton, etc). - base::AtExitManager exit_manager; - - // CommandLine::Init() ignores the passed |argc| and |argv| on Windows getting - // the command line from GetCommandLineW(), so we can safely pass NULL here. - CommandLine::Init(0, NULL); - - InitHostLogging(); - - const CommandLine* command_line = CommandLine::ForCurrentProcess(); - if (command_line->HasSwitch(kHelpSwitchName) || - command_line->HasSwitch(kQuestionSwitchName)) { - usage(command_line->GetProgram()); - return kSuccessExitCode; - } - - HostService* service = HostService::GetInstance(); - if (!service->InitWithCommandLine(command_line)) { - usage(command_line->GetProgram()); - return kUsageExitCode; - } - - return service->Run(); -} - -} // namespace remoting diff --git a/remoting/host/win/daemon_process_main.h b/remoting/host/win/daemon_process_main.h deleted file mode 100644 index ef79c80..0000000 --- a/remoting/host/win/daemon_process_main.h +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef REMOTING_HOST_WIN_DAEMON_PROCESS_MAIN_H_ -#define REMOTING_HOST_WIN_DAEMON_PROCESS_MAIN_H_ - -#include "remoting/host/host_export.h" - -namespace remoting { - -// The daemon process's entry point. -HOST_EXPORT int DaemonProcessMain(); - -} // namespace remoting - -#endif // REMOTING_HOST_WIN_DAEMON_PROCESS_MAIN_H_ diff --git a/remoting/host/win/desktop_process_entry_point.cc b/remoting/host/win/desktop_process_entry_point.cc deleted file mode 100644 index e54710e..0000000 --- a/remoting/host/win/desktop_process_entry_point.cc +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright (c) 2013 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include <windows.h> - -#include "remoting/host/desktop_process_main.h" - -// The entry point of the desktop process binary. In order to be really small -// the app doesn't link against the CRT. -void DesktopProcessEntryPoint() { - int exit_code = remoting::DesktopProcessMain(0, NULL); - ExitProcess(exit_code); -} diff --git a/remoting/host/win/dpi_aware.manifest b/remoting/host/win/dpi_aware.manifest new file mode 100644 index 0000000..2944ef3 --- /dev/null +++ b/remoting/host/win/dpi_aware.manifest @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="UTF-8" standalone="yes"?> +<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> + <asmv3:application xmlns:asmv3="urn:schemas-microsoft-com:asm.v3"> + <asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings"> + <dpiAware>true</dpiAware> + </asmv3:windowsSettings> + </asmv3:application> +</assembly> diff --git a/remoting/host/win/elevated_controller_entry_point.cc b/remoting/host/win/elevated_controller_entry_point.cc deleted file mode 100644 index 747ff4d..0000000 --- a/remoting/host/win/elevated_controller_entry_point.cc +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright (c) 2013 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include <windows.h> - -#include "remoting/host/win/elevated_controller_module.h" - -// The entry point of the elevated controller binary. In order to be really -// small the app doesn't link against the CRT. -void ElevatedControllerEntryPoint() { - int exit_code = remoting::ElevatedControllerMain(); - ExitProcess(exit_code); -} diff --git a/remoting/host/win/elevated_controller_module.cc b/remoting/host/win/elevated_controller_module.cc index 315da8f..a230e51 100644 --- a/remoting/host/win/elevated_controller_module.cc +++ b/remoting/host/win/elevated_controller_module.cc @@ -2,17 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "remoting/host/win/elevated_controller_module.h" - #include <atlbase.h> #include <atlcom.h> #include <atlctl.h> -#include "base/at_exit.h" -#include "base/command_line.h" -#include "remoting/base/breakpad.h" -#include "remoting/host/logging.h" -#include "remoting/host/usage_stats_consent.h" #include "remoting/host/win/elevated_controller.h" namespace remoting { @@ -24,26 +17,6 @@ class ElevatedControllerModule }; int ElevatedControllerMain() { -#ifdef OFFICIAL_BUILD - if (IsUsageStatsAllowed()) { - InitializeCrashReporting(); - } -#endif // OFFICIAL_BUILD - - CommandLine::Init(0, NULL); - - // Register and initialize common controls. - INITCOMMONCONTROLSEX info; - info.dwSize = sizeof(info); - info.dwICC = ICC_STANDARD_CLASSES; - InitCommonControlsEx(&info); - - // This object instance is required by Chrome code (for example, - // FilePath, LazyInstance, MessageLoop). - base::AtExitManager exit_manager; - - InitHostLogging(); - ElevatedControllerModule module; return module.WinMain(SW_HIDE); } diff --git a/remoting/host/win/elevated_controller_module.h b/remoting/host/win/elevated_controller_module.h deleted file mode 100644 index 6b67cdc..0000000 --- a/remoting/host/win/elevated_controller_module.h +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright (c) 2013 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef REMOTING_HOST_WIN_ELEVATED_CONTROLLER_MODULE_H_ -#define REMOTING_HOST_WIN_ELEVATED_CONTROLLER_MODULE_H_ - -#include "remoting/host/host_export.h" - -namespace remoting { - -// The elevated controller's entry point exported from remoting_core.dll. -HOST_EXPORT int ElevatedControllerMain(); - -} // namespace remoting - -#endif // REMOTING_HOST_WIN_ELEVATED_CONTROLLER_MODULE_H_ diff --git a/remoting/host/win/entry_point.cc b/remoting/host/win/entry_point.cc new file mode 100644 index 0000000..26ab33d --- /dev/null +++ b/remoting/host/win/entry_point.cc @@ -0,0 +1,16 @@ +// Copyright (c) 2013 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include <windows.h> + +#include "remoting/host/host_main.h" + +// The common entry point for all Me2Me host binaries. In order to be really +// small the app doesn't link against the CRT. +void HostEntryPoint() { + // CommandLine::Init() ignores the passed parameters on Windows, so it is safe + // to pass NULL here. + int exit_code = remoting::HostMain(0, NULL); + ExitProcess(exit_code); +} diff --git a/remoting/host/win/host_process_entry_point.cc b/remoting/host/win/host_process_entry_point.cc deleted file mode 100644 index e89c9ca..0000000 --- a/remoting/host/win/host_process_entry_point.cc +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright (c) 2013 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include <windows.h> - -#include "remoting/host/remoting_me2me_host.h" - -// The entry point of the host process binary. In order to be really small -// the app doesn't link against the CRT. -void HostProcessEntryPoint() { - int exit_code = remoting::HostProcessMain(0, NULL); - ExitProcess(exit_code); -} diff --git a/remoting/host/win/host_service.cc b/remoting/host/win/host_service.cc index 2e0cbf7..b4f1c8a 100644 --- a/remoting/host/win/host_service.cc +++ b/remoting/host/win/host_service.cc @@ -8,7 +8,6 @@ #include "remoting/host/win/host_service.h" #include <windows.h> -#include <shellapi.h> #include <wtsapi32.h> #include "base/base_paths.h" @@ -55,15 +54,6 @@ const wchar_t kSessionNotificationWindowClass[] = // "--console" runs the service interactively for debugging purposes. const char kConsoleSwitchName[] = "console"; -// "--elevate=<binary>" requests <binary> to be launched elevated, presenting -// a UAC prompt if necessary. -const char kElevateSwitchName[] = "elevate"; - -// The command line parameters that should be copied from the service's command -// line when launching an elevated child. -const char* kCopiedSwitchNames[] = { - "host-config", "daemon-pipe", switches::kV, switches::kVModule }; - } // namespace namespace remoting { @@ -149,12 +139,6 @@ HostService* HostService::GetInstance() { bool HostService::InitWithCommandLine(const CommandLine* command_line) { CommandLine::StringVector args = command_line->GetArgs(); - // Check if launch with elevation was requested. - if (command_line->HasSwitch(kElevateSwitchName)) { - run_routine_ = &HostService::Elevate; - return true; - } - if (!args.empty()) { LOG(ERROR) << "No positional parameters expected."; return false; @@ -204,35 +188,6 @@ void HostService::CreateLauncher( #endif // !defined(REMOTING_MULTI_PROCESS) } -int HostService::Elevate() { - // Get the name of the binary to launch. - base::FilePath binary = - CommandLine::ForCurrentProcess()->GetSwitchValuePath(kElevateSwitchName); - - // Create the child process command line by copying known switches from our - // command line. - CommandLine command_line(CommandLine::NO_PROGRAM); - command_line.CopySwitchesFrom(*CommandLine::ForCurrentProcess(), - kCopiedSwitchNames, - arraysize(kCopiedSwitchNames)); - CommandLine::StringType parameters = command_line.GetCommandLineString(); - - // Launch the child process requesting elevation. - SHELLEXECUTEINFO info; - memset(&info, 0, sizeof(info)); - info.cbSize = sizeof(info); - info.lpVerb = L"runas"; - info.lpFile = binary.value().c_str(); - info.lpParameters = parameters.c_str(); - info.nShow = SW_SHOWNORMAL; - - if (!ShellExecuteEx(&info)) { - return GetLastError(); - } - - return kSuccessExitCode; -} - int HostService::RunAsService() { SERVICE_TABLE_ENTRYW dispatch_table[] = { { const_cast<LPWSTR>(kWindowsServiceName), &HostService::ServiceMain }, @@ -431,4 +386,13 @@ LRESULT CALLBACK HostService::SessionChangeNotificationProc(HWND hwnd, } } +int DaemonProcessMain() { + HostService* service = HostService::GetInstance(); + if (!service->InitWithCommandLine(CommandLine::ForCurrentProcess())) { + return kUsageExitCode; + } + + return service->Run(); +} + } // namespace remoting diff --git a/remoting/host/win/host_service.h b/remoting/host/win/host_service.h index a79ad2f..1b26f99 100644 --- a/remoting/host/win/host_service.h +++ b/remoting/host/win/host_service.h @@ -52,9 +52,6 @@ class HostService : public WtsConsoleMonitor { // Creates the process launcher. void CreateLauncher(scoped_refptr<AutoThreadTaskRunner> task_runner); - // Runs the binary specified by the command line, elevated. - int Elevate(); - // This function handshakes with the service control manager and starts // the service. int RunAsService(); diff --git a/remoting/host/win/remoting_controller.ver b/remoting/host/win/remoting_controller.ver deleted file mode 100644 index c635156..0000000 --- a/remoting/host/win/remoting_controller.ver +++ /dev/null @@ -1,4 +0,0 @@ -BINARY=BINARY_CONTROLLER -FILE_TYPE=VFT_APP -INTERNAL_NAME=remoting_controller.exe -ORIGINAL_FILENAME=remoting_controller.exe diff --git a/remoting/host/win/remoting_core.manifest b/remoting/host/win/remoting_core.manifest deleted file mode 100644 index d351754..0000000 --- a/remoting/host/win/remoting_core.manifest +++ /dev/null @@ -1,8 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="yes"?> -<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> - <dependency> - <dependentAssembly> - <assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="*" publicKeyToken="6595b64144ccf1df" language="*" /> - </dependentAssembly> - </dependency> -</assembly> diff --git a/remoting/host/win/remoting_daemon.ver b/remoting/host/win/remoting_daemon.ver deleted file mode 100644 index 5ca00f0..0000000 --- a/remoting/host/win/remoting_daemon.ver +++ /dev/null @@ -1,4 +0,0 @@ -BINARY=BINARY_DAEMON -FILE_TYPE=VFT_APP -INTERNAL_NAME=remoting_daemon.exe -ORIGINAL_FILENAME=remoting_daemon.exe diff --git a/remoting/host/win/remoting_host.manifest b/remoting/host/win/remoting_host.manifest deleted file mode 100644 index e132793..0000000 --- a/remoting/host/win/remoting_host.manifest +++ /dev/null @@ -1,10 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
- <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
- <security>
- <requestedPrivileges>
- <requestedExecutionLevel level="requireAdministrator" uiAccess="true" />
- </requestedPrivileges>
- </security>
- </trustInfo>
-</assembly>
diff --git a/remoting/host/win/remoting_desktop.manifest b/remoting/host/win/require_administrator.manifest index e132793..e132793 100644 --- a/remoting/host/win/remoting_desktop.manifest +++ b/remoting/host/win/require_administrator.manifest diff --git a/remoting/host/win/unprivileged_process_delegate.cc b/remoting/host/win/unprivileged_process_delegate.cc index f5c1e76..2a5d20e 100644 --- a/remoting/host/win/unprivileged_process_delegate.cc +++ b/remoting/host/win/unprivileged_process_delegate.cc @@ -10,7 +10,6 @@ #include <sddl.h> -#include "base/base_switches.h" #include "base/command_line.h" #include "base/logging.h" #include "base/process_util.h" @@ -39,11 +38,6 @@ namespace remoting { namespace { -// The command line parameters that should be copied from the service's command -// line to the host process. -const char* kCopiedSwitchNames[] = { - "host-config", switches::kV, switches::kVModule }; - // The security descriptors below are used to lock down access to the worker // process launched by UnprivilegedProcessDelegate. UnprivilegedProcessDelegate // assumes that it runs under SYSTEM. The worker process is launched under @@ -222,10 +216,10 @@ bool CreateWindowStationAndDesktop(ScopedSid logon_sid, UnprivilegedProcessDelegate::UnprivilegedProcessDelegate( scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, scoped_refptr<base::SingleThreadTaskRunner> io_task_runner, - const base::FilePath& binary_path) + scoped_ptr<CommandLine> target_command) : main_task_runner_(main_task_runner), io_task_runner_(io_task_runner), - binary_path_(binary_path) { + target_command_(target_command.Pass()) { } UnprivilegedProcessDelegate::~UnprivilegedProcessDelegate() { @@ -334,14 +328,9 @@ bool UnprivilegedProcessDelegate::LaunchProcess( std::string pipe_handle = base::StringPrintf( "%d", reinterpret_cast<ULONG_PTR>(client.Get())); - // Create the command line passing the name of the IPC channel to use and - // copying known switches from the caller's command line. - CommandLine command_line(binary_path_); + // Pass the IPC channel via the command line. + CommandLine command_line(target_command_->argv()); command_line.AppendSwitchASCII(kDaemonPipeSwitchName, pipe_handle); - command_line.CopySwitchesFrom(*CommandLine::ForCurrentProcess(), - kCopiedSwitchNames, - arraysize(kCopiedSwitchNames)); - // Create our own window station and desktop accessible by |logon_sid|. WindowStationAndDesktop handles; diff --git a/remoting/host/win/unprivileged_process_delegate.h b/remoting/host/win/unprivileged_process_delegate.h index d1da1d0..a0781d3 100644 --- a/remoting/host/win/unprivileged_process_delegate.h +++ b/remoting/host/win/unprivileged_process_delegate.h @@ -9,9 +9,12 @@ #include "base/compiler_specific.h" #include "base/file_path.h" #include "base/memory/ref_counted.h" +#include "base/memory/scoped_ptr.h" #include "base/win/scoped_handle.h" #include "remoting/host/win/worker_process_launcher.h" +class CommandLine; + namespace base { class SingleThreadTaskRunner; } // namespace base @@ -31,7 +34,7 @@ class UnprivilegedProcessDelegate : public WorkerProcessLauncher::Delegate { UnprivilegedProcessDelegate( scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, scoped_refptr<base::SingleThreadTaskRunner> io_task_runner, - const base::FilePath& binary_path); + scoped_ptr<CommandLine> target_command); virtual ~UnprivilegedProcessDelegate(); // IPC::Sender implementation. @@ -52,8 +55,8 @@ class UnprivilegedProcessDelegate : public WorkerProcessLauncher::Delegate { // The task runner serving job object notifications. scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_; - // Path to the worker process binary. - base::FilePath binary_path_; + // Command line of the launched process. + scoped_ptr<CommandLine> target_command_; // The server end of the IPC channel used to communicate to the worker // process. diff --git a/remoting/host/win/wts_console_session_process_driver.cc b/remoting/host/win/wts_console_session_process_driver.cc index d321e13..638eaf3 100644 --- a/remoting/host/win/wts_console_session_process_driver.cc +++ b/remoting/host/win/wts_console_session_process_driver.cc @@ -5,12 +5,14 @@ #include "remoting/host/win/wts_console_session_process_driver.h" #include "base/base_switches.h" +#include "base/command_line.h" #include "base/file_path.h" #include "base/logging.h" #include "base/single_thread_task_runner.h" #include "ipc/ipc_message.h" #include "ipc/ipc_message_macros.h" #include "remoting/host/chromoting_messages.h" +#include "remoting/host/host_main.h" #include "remoting/host/ipc_constants.h" #include "remoting/host/sas_injector.h" #include "remoting/host/win/worker_process_launcher.h" @@ -22,6 +24,12 @@ // anyone else. const char kDaemonIpcSecurityDescriptor[] = "O:SYG:SYD:(A;;GA;;;SY)"; +// The command line parameters that should be copied from the service's command +// line to the host process. +const char* kCopiedSwitchNames[] = { + "host-config", switches::kV, switches::kVModule +}; + namespace remoting { WtsConsoleSessionProcessDriver::WtsConsoleSessionProcessDriver( @@ -81,18 +89,24 @@ void WtsConsoleSessionProcessDriver::OnSessionAttached(uint32 session_id) { DCHECK(launcher_.get() == NULL); - // Construct the host binary name. - base::FilePath host_binary; - if (!GetInstalledBinaryPath(kHostBinaryName, &host_binary)) { + // Get the host binary name. + base::FilePath desktop_binary; + if (!GetInstalledBinaryPath(kDesktopBinaryName, &desktop_binary)) { Stop(); return; } + scoped_ptr<CommandLine> target(new CommandLine(desktop_binary)); + target->AppendSwitchASCII(kProcessTypeSwitchName, kProcessTypeHost); + target->CopySwitchesFrom(*CommandLine::ForCurrentProcess(), + kCopiedSwitchNames, + arraysize(kCopiedSwitchNames)); + // Create a Delegate capable of launching an elevated process in the session. scoped_ptr<WtsSessionProcessDelegate> delegate( new WtsSessionProcessDelegate(caller_task_runner_, io_task_runner_, - host_binary, + target.Pass(), session_id, true, kDaemonIpcSecurityDescriptor)); diff --git a/remoting/host/win/wts_session_process_delegate.cc b/remoting/host/win/wts_session_process_delegate.cc index 8c7d552..696cefd 100644 --- a/remoting/host/win/wts_session_process_delegate.cc +++ b/remoting/host/win/wts_session_process_delegate.cc @@ -7,7 +7,6 @@ #include "remoting/host/win/wts_session_process_delegate.h" -#include "base/base_switches.h" #include "base/bind.h" #include "base/bind_helpers.h" #include "base/command_line.h" @@ -24,6 +23,7 @@ #include "ipc/ipc_channel_proxy.h" #include "ipc/ipc_message.h" #include "remoting/host/host_exit_codes.h" +#include "remoting/host/host_main.h" #include "remoting/host/ipc_constants.h" #include "remoting/host/win/launch_process_with_token.h" #include "remoting/host/win/worker_process_launcher.h" @@ -35,13 +35,6 @@ using base::win::ScopedHandle; // Name of the default session desktop. const char kDefaultDesktopName[] = "winsta0\\default"; -const char kElevateSwitchName[] = "elevate"; - -// The command line parameters that should be copied from the service's command -// line to the host process. -const char* kCopiedSwitchNames[] = { - "host-config", switches::kV, switches::kVModule }; - namespace remoting { // A private class actually implementing the functionality provided by @@ -56,7 +49,7 @@ class WtsSessionProcessDelegate::Core // Stop() method has been called. Core(scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, scoped_refptr<base::SingleThreadTaskRunner> io_task_runner, - const base::FilePath& binary_path, + scoped_ptr<CommandLine> target_command, bool launch_elevated, const std::string& channel_security); @@ -109,8 +102,8 @@ class WtsSessionProcessDelegate::Core // The task runner serving job object notifications. scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_; - // Path to the worker process binary. - base::FilePath binary_path_; + // Command line of the launched process. + scoped_ptr<CommandLine> target_command_; // The server end of the IPC channel used to communicate to the worker // process. @@ -151,12 +144,12 @@ class WtsSessionProcessDelegate::Core WtsSessionProcessDelegate::Core::Core( scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, scoped_refptr<base::SingleThreadTaskRunner> io_task_runner, - const base::FilePath& binary_path, + scoped_ptr<CommandLine> target_command, bool launch_elevated, const std::string& channel_security) : main_task_runner_(main_task_runner), io_task_runner_(io_task_runner), - binary_path_(binary_path), + target_command_(target_command.Pass()), channel_security_(channel_security), get_named_pipe_client_pid_(NULL), launch_elevated_(launch_elevated), @@ -241,7 +234,7 @@ bool WtsSessionProcessDelegate::Core::LaunchProcess( ScopedHandle* process_exit_event_out) { DCHECK(main_task_runner_->BelongsToCurrentThread()); - CommandLine command_line(CommandLine::NO_PROGRAM); + CommandLine command_line(target_command_->argv()); if (launch_elevated_) { // The job object is not ready. Retry starting the host process later. if (!job_.IsValid()) { @@ -249,18 +242,17 @@ bool WtsSessionProcessDelegate::Core::LaunchProcess( } // Construct the helper binary name. - base::FilePath daemon_binary; - if (!GetInstalledBinaryPath(kDaemonBinaryName, &daemon_binary)) + base::FilePath helper_binary; + if (!GetInstalledBinaryPath(kHostBinaryName, &helper_binary)) return false; // Create the command line passing the name of the IPC channel to use and // copying known switches from the caller's command line. - command_line.SetProgram(daemon_binary); - command_line.AppendSwitchPath(kElevateSwitchName, binary_path_); + command_line.SetProgram(helper_binary); + command_line.AppendSwitchPath(kElevateSwitchName, + target_command_->GetProgram()); CHECK(ResetEvent(process_exit_event_)); - } else { - command_line.SetProgram(binary_path_); } // Create the server end of the IPC channel. @@ -276,13 +268,9 @@ bool WtsSessionProcessDelegate::Core::LaunchProcess( delegate, io_task_runner_)); - // Create the command line passing the name of the IPC channel to use and - // copying known switches from the caller's command line. + // Pass the name of the IPC channel to use. command_line.AppendSwitchNative(kDaemonPipeSwitchName, UTF8ToWide(channel_name)); - command_line.CopySwitchesFrom(*CommandLine::ForCurrentProcess(), - kCopiedSwitchNames, - arraysize(kCopiedSwitchNames)); // Try to launch the process. ScopedHandle worker_process; @@ -485,11 +473,11 @@ void WtsSessionProcessDelegate::Core::OnJobNotification(DWORD message, WtsSessionProcessDelegate::WtsSessionProcessDelegate( scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, scoped_refptr<base::SingleThreadTaskRunner> io_task_runner, - const base::FilePath& binary_path, + scoped_ptr<CommandLine> target_command, uint32 session_id, bool launch_elevated, const std::string& channel_security) { - core_ = new Core(main_task_runner, io_task_runner, binary_path, + core_ = new Core(main_task_runner, io_task_runner, target_command.Pass(), launch_elevated, channel_security); if (!core_->Initialize(session_id)) { core_->Stop(); diff --git a/remoting/host/win/wts_session_process_delegate.h b/remoting/host/win/wts_session_process_delegate.h index 5d55c98..7c637c1 100644 --- a/remoting/host/win/wts_session_process_delegate.h +++ b/remoting/host/win/wts_session_process_delegate.h @@ -8,8 +8,11 @@ #include "base/basictypes.h" #include "base/compiler_specific.h" #include "base/memory/ref_counted.h" +#include "base/memory/scoped_ptr.h" #include "remoting/host/win/worker_process_launcher.h" +class CommandLine; + namespace base { class FilePath; class SingleThreadTaskRunner; @@ -30,7 +33,7 @@ class WtsSessionProcessDelegate WtsSessionProcessDelegate( scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, scoped_refptr<base::SingleThreadTaskRunner> io_task_runner, - const base::FilePath& binary_path, + scoped_ptr<CommandLine> target, uint32 session_id, bool launch_elevated, const std::string& channel_security); diff --git a/remoting/remoting.gyp b/remoting/remoting.gyp index fe04c52..0dc2921 100644 --- a/remoting/remoting.gyp +++ b/remoting/remoting.gyp @@ -248,6 +248,16 @@ 'win_debug_RuntimeChecks': '0', }, 'conditions': [ + ['OS=="mac" and mac_breakpad==1', { + 'defines': [ + 'REMOTING_ENABLE_BREAKPAD' + ], + }], + ['OS=="win" and buildtype == "Official"', { + 'defines': [ + 'REMOTING_ENABLE_BREAKPAD' + ], + }], ['remoting_multi_process != 0', { 'defines': [ 'REMOTING_MULTI_PROCESS', @@ -384,8 +394,8 @@ 'host/pam_authorization_factory_posix.h', 'host/pin_hash.cc', 'host/pin_hash.h', - 'host/policy_hack/policy_watcher.h', 'host/policy_hack/policy_watcher.cc', + 'host/policy_hack/policy_watcher.h', 'host/policy_hack/policy_watcher_linux.cc', 'host/policy_hack/policy_watcher_mac.mm', 'host/policy_hack/policy_watcher_win.cc', @@ -753,8 +763,9 @@ 'VERSION=<(version_full)', ], 'sources': [ + 'host/host_main.cc', + 'host/host_main.h', 'host/remoting_me2me_host.cc', - 'host/remoting_me2me_host.h', ], 'conditions': [ ['OS=="mac"', { @@ -781,7 +792,6 @@ # A real .dSYM is needed for dump_syms to operate on. 'mac_real_dsym': 1, }, - 'defines': ['MAC_BREAKPAD'], 'copies': [ { 'destination': '<(PRODUCT_DIR)/$(CONTENTS_FOLDER_PATH)/Resources', @@ -1178,6 +1188,62 @@ }, }, }, # end of target 'remoting_configurer' + # The only difference between |remoting_console.exe| and + # |remoting_host.exe| is that the former is a console application. + # |remoting_console.exe| is used for debugging purposes. + { + 'target_name': 'remoting_console', + 'type': 'executable', + 'variables': { 'enable_wexit_time_destructors': 1, }, + 'dependencies': [ + 'remoting_core', + 'remoting_version_resources', + ], + 'sources': [ + '<(SHARED_INTERMEDIATE_DIR)/remoting/remoting_host_version.rc', + 'host/win/entry_point.cc', + ], + 'msvs_settings': { + 'VCLinkerTool': { + 'EntryPointSymbol': 'HostEntryPoint', + 'IgnoreAllDefaultLibraries': 'true', + 'SubSystem': '1', # /SUBSYSTEM:CONSOLE + }, + }, + }, # end of target 'remoting_console' + { + 'target_name': 'remoting_console_manifest', + 'type': 'none', + 'dependencies': [ + 'remoting_console', + ], + 'hard_dependency': '1', + 'msvs_cygwin_shell': 0, + 'actions': [ + { + 'action_name': 'Embedding manifest into remoting_console.exe', + 'binary': '<(PRODUCT_DIR)/remoting_console.exe', + 'manifests': [ + 'host/win/dpi_aware.manifest', + ], + 'inputs': [ + '<(_binary)', + '<@(_manifests)', + ], + 'outputs': [ + '<(_binary).embedded.manifest', + ], + 'action': [ + 'mt', + '-nologo', + '-manifest', + '<@(_manifests)', + '-outputresource:<(_binary);#1', + '-out:<(_binary).embedded.manifest', + ], + }, + ], # actions + }, # end of target 'remoting_console_manifest' { 'target_name': 'remoting_core', 'type': 'shared_library', @@ -1223,7 +1289,6 @@ 'host/desktop_process.cc', 'host/desktop_process.h', 'host/desktop_process_main.cc', - 'host/desktop_process_main.h', 'host/desktop_session.cc', 'host/desktop_session.h', 'host/desktop_session_agent.cc', @@ -1234,10 +1299,11 @@ 'host/desktop_session_win.h', 'host/host_exit_codes.h', 'host/host_export.h', + 'host/host_main.cc', + 'host/host_main.h', 'host/ipc_constants.cc', 'host/ipc_constants.h', 'host/remoting_me2me_host.cc', - 'host/remoting_me2me_host.h', 'host/sas_injector.h', 'host/sas_injector_win.cc', 'host/verify_config_window_win.cc', @@ -1245,12 +1311,9 @@ 'host/win/core.cc', 'host/win/core.rc', 'host/win/core_resource.h', - 'host/win/daemon_process_main.cc', - 'host/win/daemon_process_main.h', 'host/win/elevated_controller.cc', 'host/win/elevated_controller.h', 'host/win/elevated_controller_module.cc', - 'host/win/elevated_controller_module.h', 'host/win/host_service.cc', 'host/win/host_service.h', 'host/win/omaha.cc', @@ -1288,10 +1351,12 @@ { 'action_name': 'Embedding manifest into remoting_core.dll', 'binary': '<(PRODUCT_DIR)/remoting_core.dll', - 'manifest': 'host/win/remoting_core.manifest', + 'manifests': [ + 'host/win/comctl32_v6.manifest', + ], 'inputs': [ '<(_binary)', - '<(_manifest)', + '<@(_manifests)', ], 'outputs': [ '<(_binary).embedded.manifest', @@ -1300,7 +1365,7 @@ 'mt', '-nologo', '-manifest', - '<(_manifest)', + '<@(_manifests)', '-outputresource:<(_binary);#2', '-out:<(_binary).embedded.manifest', ], @@ -1308,46 +1373,6 @@ ], # actions }, # end of target 'remoting_core_manifest' { - 'target_name': 'remoting_controller', - 'type': 'executable', - 'variables': { 'enable_wexit_time_destructors': 1, }, - 'dependencies': [ - 'remoting_core', - 'remoting_version_resources', - ], - 'sources': [ - '<(SHARED_INTERMEDIATE_DIR)/remoting/remoting_controller_version.rc', - 'host/win/elevated_controller_entry_point.cc', - ], - 'msvs_settings': { - 'VCLinkerTool': { - 'EntryPointSymbol': 'ElevatedControllerEntryPoint', - 'IgnoreAllDefaultLibraries': 'true', - 'SubSystem': '2', # /SUBSYSTEM:WINDOWS - }, - }, - }, # end of target 'remoting_controller' - { - 'target_name': 'remoting_daemon', - 'type': 'executable', - 'variables': { 'enable_wexit_time_destructors': 1, }, - 'dependencies': [ - 'remoting_core', - 'remoting_version_resources', - ], - 'sources': [ - '<(SHARED_INTERMEDIATE_DIR)/remoting/remoting_daemon_version.rc', - 'host/win/daemon_process_entry_point.cc', - ], - 'msvs_settings': { - 'VCLinkerTool': { - 'EntryPointSymbol': 'DaemonProcessEntryPoint', - 'IgnoreAllDefaultLibraries': 'true', - 'SubSystem': '2', # /SUBSYSTEM:WINDOWS - }, - }, - }, # end of target 'remoting_daemon' - { 'target_name': 'remoting_desktop', 'type': 'executable', 'variables': { 'enable_wexit_time_destructors': 1, }, @@ -1357,11 +1382,11 @@ ], 'sources': [ '<(SHARED_INTERMEDIATE_DIR)/remoting/remoting_desktop_version.rc', - 'host/win/desktop_process_entry_point.cc', + 'host/win/entry_point.cc', ], 'msvs_settings': { 'VCLinkerTool': { - 'EntryPointSymbol': 'DesktopProcessEntryPoint', + 'EntryPointSymbol': 'HostEntryPoint', 'IgnoreAllDefaultLibraries': 'true', 'SubSystem': '2', # /SUBSYSTEM:WINDOWS }, @@ -1379,10 +1404,22 @@ { 'action_name': 'Embedding manifest into remoting_desktop.exe', 'binary': '<(PRODUCT_DIR)/remoting_desktop.exe', - 'manifest': 'host/win/remoting_desktop.manifest', + 'manifests': [ + 'host/win/dpi_aware.manifest', + ], + # Add 'level="requireAdministrator" uiAccess="true"' to + # the manifest only for the official builds because it requires + # the binary to be signed to work. + 'conditions': [ + ['buildtype == "Official"', { + 'manifests': [ + 'host/win/require_administrator.manifest', + ], + }], + ], 'inputs': [ '<(_binary)', - '<(_manifest)', + '<@(_manifests)', ], 'outputs': [ '<(_binary).embedded.manifest', @@ -1391,7 +1428,7 @@ 'mt', '-nologo', '-manifest', - '<(_manifest)', + '<@(_manifests)', '-outputresource:<(_binary);#1', '-out:<(_binary).embedded.manifest', ], @@ -1409,11 +1446,11 @@ ], 'sources': [ '<(SHARED_INTERMEDIATE_DIR)/remoting/remoting_host_version.rc', - 'host/win/host_process_entry_point.cc', + 'host/win/entry_point.cc', ], 'msvs_settings': { 'VCLinkerTool': { - 'EntryPointSymbol': 'HostProcessEntryPoint', + 'EntryPointSymbol': 'HostEntryPoint', 'IgnoreAllDefaultLibraries': 'true', 'ImportLibrary': '$(OutDir)\\lib\\remoting_host_exe.lib', 'OutputFile': '$(OutDir)\\remoting_host.exe', @@ -1433,10 +1470,12 @@ { 'action_name': 'Embedding manifest into remoting_host.exe', 'binary': '<(PRODUCT_DIR)/remoting_host.exe', - 'manifest': 'host/win/remoting_host.manifest', + 'manifests': [ + 'host/win/dpi_aware.manifest', + ], 'inputs': [ '<(_binary)', - '<(_manifest)', + '<@(_manifests)', ], 'outputs': [ '<(_binary).embedded.manifest', @@ -1445,7 +1484,7 @@ 'mt', '-nologo', '-manifest', - '<(_manifest)', + '<@(_manifests)', '-outputresource:<(_binary);#1', '-out:<(_binary).embedded.manifest', ], @@ -1465,10 +1504,12 @@ { 'action_name': 'Embedding manifest into remoting_host_plugin.dll', 'binary': '<(PRODUCT_DIR)/remoting_host_plugin.dll', - 'manifest': 'host/plugin/remoting_host_plugin.manifest', + 'manifests': [ + 'host/win/comctl32_v6.manifest', + ], 'inputs': [ '<(_binary)', - '<(_manifest)', + '<@(_manifests)', ], 'outputs': [ '<(_binary).embedded.manifest', @@ -1477,7 +1518,7 @@ 'mt', '-nologo', '-manifest', - '<(_manifest)', + '<@(_manifests)', '-outputresource:<(_binary);#2', '-out:<(_binary).embedded.manifest', ], @@ -1513,9 +1554,7 @@ }, 'sources': [ 'host/plugin/remoting_host_plugin.ver', - 'host/win/remoting_controller.ver', 'host/win/remoting_core.ver', - 'host/win/remoting_daemon.ver', 'host/win/remoting_desktop.ver', 'host/win/remoting_host.ver', ], @@ -1603,54 +1642,25 @@ 'target_name': 'remoting_me2me_host_archive', 'type': 'none', 'dependencies': [ - 'remoting_controller', 'remoting_core_manifest', - 'remoting_daemon', - 'remoting_host_exe', + 'remoting_desktop_manifest', + 'remoting_host_manifest', ], 'compiled_inputs': [ - '<(PRODUCT_DIR)/remoting_controller.exe', '<(PRODUCT_DIR)/remoting_core.dll', - '<(PRODUCT_DIR)/remoting_daemon.exe', + '<(PRODUCT_DIR)/remoting_desktop.exe', '<(PRODUCT_DIR)/remoting_host.exe', ], 'compiled_inputs_dst': [ - 'files/remoting_controller.exe', 'files/remoting_core.dll', - 'files/remoting_daemon.exe', + 'files/remoting_desktop.exe', 'files/remoting_host.exe', ], 'conditions': [ - ['remoting_multi_process != 0', { - 'dependencies': [ - 'remoting_desktop', - ], - 'compiled_inputs': [ - '<(PRODUCT_DIR)/remoting_desktop.exe', - ], - 'compiled_inputs_dst': [ - 'files/remoting_desktop.exe', - ], - }], ['buildtype == "Official"', { 'defs': [ 'OFFICIAL_BUILD=1', ], - - # Add 'level="requireAdministrator" uiAccess="true"' to - # the manifest only for the official builds because it requires - # the binary to be signed to work. - 'conditions': [ - ['remoting_multi_process != 0', { - 'dependencies': [ - 'remoting_desktop_manifest', - ], - }, { # else remoting_multi_process == 0 - 'dependencies': [ - 'remoting_host_manifest', - ], - }], - ], }, { # else buildtype != "Official" 'defs': [ 'OFFICIAL_BUILD=0', diff --git a/remoting/version.rc.version b/remoting/version.rc.version index 6d9789c..f45f326 100644 --- a/remoting/version.rc.version +++ b/remoting/version.rc.version @@ -12,20 +12,14 @@ // Let .VER file to select the binary that is being compiled. #define BINARY_HOST_PLUGIN 1 #define BINARY_HOST_ME2ME 2 -#define BINARY_DAEMON 3 -#define BINARY_CONTROLLER 4 -#define BINARY_DESKTOP 5 -#define BINARY_CORE 6 +#define BINARY_DESKTOP 3 +#define BINARY_CORE 4 #define BINARY @BINARY@ #if (BINARY == BINARY_HOST_PLUGIN) #define FILE_DESCRIPTION "@HOST_PLUGIN_DESCRIPTION@" #elif (BINARY == BINARY_HOST_ME2ME) #define FILE_DESCRIPTION "@HOST_ME2ME_DESCRIPTION@" -#elif (BINARY == BINARY_DAEMON) -#define FILE_DESCRIPTION "@DAEMON_DESCRIPTION@" -#elif (BINARY == BINARY_CONTROLLER) -#define FILE_DESCRIPTION "@CONTROLLER_DESCRIPTION@" #elif (BINARY == BINARY_DESKTOP) #define FILE_DESCRIPTION "@DESKTOP_DESCRIPTION@" #elif (BINARY == BINARY_CORE) |