summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--remoting/branding_Chrome1
-rw-r--r--remoting/branding_Chromium1
-rw-r--r--remoting/host/continue_window_win.cc13
-rw-r--r--remoting/host/desktop_process_main.cc96
-rw-r--r--remoting/host/desktop_process_main.h17
-rw-r--r--remoting/host/disconnect_window_win.cc2
-rw-r--r--remoting/host/host_export.h24
-rw-r--r--remoting/host/installer/win/chromoting.wxs39
-rw-r--r--remoting/host/installer/win/parameters.json1
-rw-r--r--remoting/host/plugin/host_plugin.cc3
-rw-r--r--remoting/host/remoting_me2me_host.cc104
-rw-r--r--remoting/host/remoting_me2me_host.h17
-rw-r--r--remoting/host/verify_config_window_win.cc2
-rw-r--r--remoting/host/verify_config_window_win.h2
-rw-r--r--remoting/host/video_scheduler.cc2
-rw-r--r--remoting/host/win/core.cc14
-rw-r--r--remoting/host/win/core.rc (renamed from remoting/host/host_ui.rc)74
-rw-r--r--remoting/host/win/core_resource.h (renamed from remoting/host/host_ui_resource.h)23
-rw-r--r--remoting/host/win/daemon_process_entry_point.cc14
-rw-r--r--remoting/host/win/daemon_process_main.cc89
-rw-r--r--remoting/host/win/daemon_process_main.h17
-rw-r--r--remoting/host/win/desktop_process_entry_point.cc14
-rw-r--r--remoting/host/win/elevated_controller.cc2
-rw-r--r--remoting/host/win/elevated_controller.rc69
-rw-r--r--remoting/host/win/elevated_controller_entry_point.cc14
-rw-r--r--remoting/host/win/elevated_controller_module.cc22
-rw-r--r--remoting/host/win/elevated_controller_module.h17
-rw-r--r--remoting/host/win/elevated_controller_resource.h19
-rw-r--r--remoting/host/win/host_process_entry_point.cc14
-rw-r--r--remoting/host/win/host_service.cc63
-rw-r--r--remoting/host/win/host_service.rc80
-rw-r--r--remoting/host/win/host_service_resource.h21
-rw-r--r--remoting/host/win/remoting_core.ver4
-rw-r--r--remoting/host/win/remoting_desktop.ver (renamed from remoting/host/remoting_desktop.ver)0
-rw-r--r--remoting/host/win/remoting_host.ver (renamed from remoting/host/remoting_host_me2me.ver)0
-rw-r--r--remoting/remoting.gyp416
-rw-r--r--remoting/version.rc.version3
37 files changed, 674 insertions, 639 deletions
diff --git a/remoting/branding_Chrome b/remoting/branding_Chrome
index 028c3d2..e199668 100644
--- a/remoting/branding_Chrome
+++ b/remoting/branding_Chrome
@@ -9,6 +9,7 @@ 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
MAC_CREATOR=rimZ
MAC_HOST_BUNDLE_ID=com.google.chrome_remote_desktop.remoting_me2me_host
diff --git a/remoting/branding_Chromium b/remoting/branding_Chromium
index 524989a..83f9085 100644
--- a/remoting/branding_Chromium
+++ b/remoting/branding_Chromium
@@ -9,6 +9,7 @@ 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
MAC_CREATOR=Cr24
MAC_HOST_BUNDLE_ID=org.chromium.chromoting.remoting_me2me_host
diff --git a/remoting/host/continue_window_win.cc b/remoting/host/continue_window_win.cc
index 76cc42b..fc03615 100644
--- a/remoting/host/continue_window_win.cc
+++ b/remoting/host/continue_window_win.cc
@@ -8,21 +8,16 @@
#include "base/compiler_specific.h"
#include "base/logging.h"
+#include "base/process_util.h"
#include "base/utf_string_conversions.h"
-#include "remoting/host/host_ui_resource.h"
#include "remoting/host/ui_strings.h"
+#include "remoting/host/win/core_resource.h"
// TODO(garykac): Lots of duplicated code in this file and
// disconnect_window_win.cc. These global floating windows are temporary so
// they should be deleted soon. If we need to expand this then we should
// create a class with the shared code.
-// HMODULE from DllMain/WinMain. This is needed to find our dialog resource.
-// This is defined in:
-// Plugin: host_plugin.cc
-// SimpleHost: simple_host_process.cc
-extern HMODULE g_hModule;
-
namespace remoting {
class ContinueWindowWin : public ContinueWindow {
@@ -106,8 +101,10 @@ BOOL ContinueWindowWin::OnDialogMessage(HWND hwnd, UINT msg,
void ContinueWindowWin::Show(const ContinueSessionCallback& callback) {
callback_ = callback;
+ HMODULE instance = base::GetModuleFromAddress(&DialogProc);
+
CHECK(!hwnd_);
- hwnd_ = CreateDialogParam(g_hModule, MAKEINTRESOURCE(IDD_CONTINUE), NULL,
+ hwnd_ = CreateDialogParam(instance, MAKEINTRESOURCE(IDD_CONTINUE), NULL,
(DLGPROC)DialogProc, (LPARAM)this);
if (!hwnd_) {
LOG(ERROR) << "Unable to create Disconnect dialog for remoting.";
diff --git a/remoting/host/desktop_process_main.cc b/remoting/host/desktop_process_main.cc
index fa678de..be7f918 100644
--- a/remoting/host/desktop_process_main.cc
+++ b/remoting/host/desktop_process_main.cc
@@ -5,6 +5,8 @@
// 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"
@@ -54,7 +56,9 @@ void Usage(const FilePath& program_name) {
} // namespace
-int main(int argc, char** argv) {
+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;
@@ -62,17 +66,48 @@ int main(int argc, char** argv) {
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;
- remoting::InitHostLogging();
+ 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) {
+ 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)
const CommandLine* command_line = CommandLine::ForCurrentProcess();
if (command_line->HasSwitch(kHelpSwitchName) ||
command_line->HasSwitch(kQuestionSwitchName)) {
Usage(command_line->GetProgram());
- return remoting::kSuccessExitCode;
+ return kSuccessExitCode;
}
std::string channel_name =
@@ -80,7 +115,7 @@ int main(int argc, char** argv) {
if (channel_name.empty()) {
Usage(command_line->GetProgram());
- return remoting::kUsageExitCode;
+ return kUsageExitCode;
}
MessageLoop message_loop(MessageLoop::TYPE_UI);
@@ -89,56 +124,25 @@ int main(int argc, char** argv) {
base::IgnoreResult(&base::SingleThreadTaskRunner::PostTask),
message_loop.message_loop_proxy(),
FROM_HERE, run_loop.QuitClosure());
- scoped_refptr<remoting::AutoThreadTaskRunner> ui_task_runner =
- new remoting::AutoThreadTaskRunner(message_loop.message_loop_proxy(),
- quit_ui_task_runner);
+ scoped_refptr<AutoThreadTaskRunner> ui_task_runner =
+ new AutoThreadTaskRunner(message_loop.message_loop_proxy(),
+ quit_ui_task_runner);
- remoting::DesktopProcess desktop_process(ui_task_runner, channel_name);
+ DesktopProcess desktop_process(ui_task_runner, channel_name);
if (!desktop_process.Start())
- return remoting::kInitializationFailed;
+ return kInitializationFailed;
// Run the UI message loop.
ui_task_runner = NULL;
run_loop.Run();
- return remoting::kSuccessExitCode;
+ return kSuccessExitCode;
}
-#if defined(OS_WIN)
-
-int CALLBACK WinMain(HINSTANCE instance,
- HINSTANCE previous_instance,
- LPSTR raw_command_line,
- int show_command) {
-#ifdef OFFICIAL_BUILD
- if (remoting::IsUsageStatsAllowed()) {
- remoting::InitializeCrashReporting();
- }
-#endif // OFFICIAL_BUILD
-
- // 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) {
- FilePath path(base::GetNativeLibraryName(UTF8ToUTF16("user32")));
- base::ScopedNativeLibrary user32(path);
- CHECK(user32.is_valid());
+} // namespace remoting
- typedef BOOL (WINAPI * SetProcessDPIAwareFn)();
- SetProcessDPIAwareFn set_process_dpi_aware =
- static_cast<SetProcessDPIAwareFn>(
- user32.GetFunctionPointer("SetProcessDPIAware"));
- set_process_dpi_aware();
- }
-
- // CommandLine::Init() ignores the passed |argc| and |argv| on Windows getting
- // the command line from GetCommandLineW(), so we can safely pass NULL here.
- return main(0, NULL);
+#if !defined(OS_WIN)
+int main(int argc, char** argv) {
+ return remoting::DesktopProcessMain(argc, argv);
}
-
-#endif // defined(OS_WIN)
+#endif // !defined(OS_WIN)
diff --git a/remoting/host/desktop_process_main.h b/remoting/host/desktop_process_main.h
new file mode 100644
index 0000000..f9724f9
--- /dev/null
+++ b/remoting/host/desktop_process_main.h
@@ -0,0 +1,17 @@
+// 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/disconnect_window_win.cc b/remoting/host/disconnect_window_win.cc
index ff41c67..8fc7ac4 100644
--- a/remoting/host/disconnect_window_win.cc
+++ b/remoting/host/disconnect_window_win.cc
@@ -14,8 +14,8 @@
#include "base/win/scoped_gdi_object.h"
#include "base/win/scoped_hdc.h"
#include "base/win/scoped_select_object.h"
-#include "remoting/host/host_ui_resource.h"
#include "remoting/host/ui_strings.h"
+#include "remoting/host/win/core_resource.h"
// TODO(garykac): Lots of duplicated code in this file and
// continue_window_win.cc. If we need to expand this then we should
diff --git a/remoting/host/host_export.h b/remoting/host/host_export.h
new file mode 100644
index 0000000..7aa58d8
--- /dev/null
+++ b/remoting/host/host_export.h
@@ -0,0 +1,24 @@
+// 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_HOST_EXPORT_H_
+#define REMOTING_HOST_HOST_EXPORT_H_
+
+#if defined(WIN32)
+
+#if defined(HOST_IMPLEMENTATION)
+#define HOST_EXPORT __declspec(dllexport)
+#else
+#define HOST_EXPORT __declspec(dllimport)
+#endif // defined(HOST_IMPLEMENTATION)
+
+#else // !defined(WIN32)
+#if defined(HOST_IMPLEMENTATION)
+#define HOST_EXPORT __attribute__((visibility("default")))
+#else
+#define HOST_EXPORT
+#endif // defined(HOST_IMPLEMENTATION)
+#endif // !defined(WIN32)
+
+#endif // REMOTING_HOST_HOST_EXPORT_H_
diff --git a/remoting/host/installer/win/chromoting.wxs b/remoting/host/installer/win/chromoting.wxs
index 7a88536..e3ae2bb 100644
--- a/remoting/host/installer/win/chromoting.wxs
+++ b/remoting/host/installer/win/chromoting.wxs
@@ -23,6 +23,8 @@
<?define OmahaAppid = "{b210701e-ffc4-49e3-932b-370728c72662}" ?>
<?define UpgradeCode = "2b21f767-e157-4fa6-963c-55834c1433a6" ?>
+ <?define CoreBinary = "remoting_core.dll" ?>
+
<?define ControllerAppid = "{4ff35d5e-d226-4550-9248-03e7779e67de}" ?>
<?define ControllerBinary = "remoting_controller.exe" ?>
<?define ControllerClass = "ElevatedController Class" ?>
@@ -136,6 +138,23 @@
Vital="yes"/>
</Component>
+ <Component Id="remoting_core" Guid="*">
+ <File Id="$(var.CoreBinary)"
+ DiskId="1"
+ KeyPath="yes"
+ Name="$(var.CoreBinary)"
+ Vital="yes"/>
+
+ <util:EventSource xmlns:util="http://schemas.microsoft.com/wix/UtilExtension"
+ Name="$(var.EventSourceName)"
+ Log="Application"
+ CategoryCount="1"
+ CategoryMessageFile="[#$(var.CoreBinary)]"
+ EventMessageFile="[#$(var.CoreBinary)]"
+ SupportsErrors="yes"
+ SupportsInformationals="yes"/>
+ </Component>
+
<?if $(var.RemotingMultiProcess) != 0 ?>
<Component Id="remoting_desktop" Guid="*">
<File Id="remoting_desktop.exe"
@@ -177,15 +196,6 @@
DiskId="1"
Name="remoting_host.exe"
Vital="yes"/>
- <util:EventSource xmlns:util="http://schemas.microsoft.com/wix/UtilExtension"
- Name="$(var.EventSourceName)"
- Log="Application"
- CategoryCount="1"
- CategoryMessageFile="[#remoting_host.exe]"
- EventMessageFile="[#remoting_host.exe]"
- SupportsErrors="yes"
- SupportsInformationals="yes"/>
-
<fire:FirewallException xmlns:fire="http://schemas.microsoft.com/wix/FirewallExtension"
Id="me2me_firewall_exception"
IgnoreFailure="yes"
@@ -273,7 +283,7 @@
<RegistryValue Type="string"
Name="LocalizedString"
- Value="@[#$(var.ControllerBinary)],-100"/>
+ Value="@[binaries]$(var.CoreBinary),-103"/>
<RegistryKey Key="LocalServer32" Action="create">
<RegistryValue Type="string"
@@ -301,7 +311,7 @@
Value="1"/>
<RegistryValue Type="string"
Name="IconReference"
- Value="@[#$(var.ControllerBinary)],-101"/>
+ Value="@[binaries]$(var.CoreBinary),-104"/>
</RegistryKey>
</RegistryKey>
</RegistryKey>
@@ -340,7 +350,7 @@
<RegistryKey Key="0" Action="create">
<RegistryKey Key="win32" Action="create">
<RegistryValue Type="string"
- Value="[#$(var.ControllerBinary)]"/>
+ Value="@[binaries]$(var.CoreBinary)"/>
</RegistryKey>
</RegistryKey>
@@ -437,10 +447,10 @@
<CustomAction Id="set_service_display_name"
Property="chromoting_service_display_name"
- Value="@[binaries]remoting_daemon.exe,-101" />
+ Value="@[binaries]$(var.CoreBinary),-101" />
<CustomAction Id="set_service_description"
Property="chromoting_service_description"
- Value="@[binaries]remoting_daemon.exe,-102" />
+ Value="@[binaries]$(var.CoreBinary),-102" />
<!-- XP does not support MUI strings in the service name and description, so
we fall back to plain strings on XP. -->
@@ -460,6 +470,7 @@
<ComponentRef Id="omaha_registration"/>
<?endif?>
<ComponentRef Id="remoting_controller"/>
+ <ComponentRef Id="remoting_core"/>
<ComponentRef Id="remoting_daemon"/>
<?if $(var.RemotingMultiProcess) != 0 ?>
<ComponentRef Id="remoting_desktop"/>
diff --git a/remoting/host/installer/win/parameters.json b/remoting/host/installer/win/parameters.json
index 4539e7a..257fbca 100644
--- a/remoting/host/installer/win/parameters.json
+++ b/remoting/host/installer/win/parameters.json
@@ -13,6 +13,7 @@
],
"sign": [
"remoting_controller.exe",
+ "remoting_core.dll",
"remoting_daemon.exe",
"remoting_desktop.exe",
"remoting_host.exe"
diff --git a/remoting/host/plugin/host_plugin.cc b/remoting/host/plugin/host_plugin.cc
index a55c309..8b465ea 100644
--- a/remoting/host/plugin/host_plugin.cc
+++ b/remoting/host/plugin/host_plugin.cc
@@ -450,12 +450,9 @@ NPError SetWindow(NPP instance, NPWindow* pNPWindow) {
} // namespace
#if defined(OS_WIN)
-HMODULE g_hModule = NULL;
-
BOOL APIENTRY DllMain(HMODULE hModule, DWORD dwReason, LPVOID lpReserved) {
switch (dwReason) {
case DLL_PROCESS_ATTACH:
- g_hModule = hModule;
DisableThreadLibraryCalls(hModule);
break;
case DLL_PROCESS_DETACH:
diff --git a/remoting/host/remoting_me2me_host.cc b/remoting/host/remoting_me2me_host.cc
index 3d692d7..f0118d6 100644
--- a/remoting/host/remoting_me2me_host.cc
+++ b/remoting/host/remoting_me2me_host.cc
@@ -4,6 +4,8 @@
//
// This file implements a standalone host process for Me2Me.
+#include "remoting/host/remoting_me2me_host.h"
+
#include <string>
#include "base/at_exit.h"
@@ -12,6 +14,7 @@
#include "base/command_line.h"
#include "base/file_path.h"
#include "base/file_util.h"
+#include "base/logging.h"
#include "base/memory/scoped_ptr.h"
#include "base/message_loop.h"
#include "base/scoped_native_library.h"
@@ -1036,9 +1039,7 @@ void HostProcess::OnCrash(const std::string& function_name,
CHECK(false);
}
-} // namespace remoting
-
-int main(int argc, char** argv) {
+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;
@@ -1046,15 +1047,14 @@ int main(int argc, char** argv) {
CommandLine::Init(argc, argv);
- // Initialize Breakpad as early as possible. On Windows, this happens in
- // WinMain(), so it shouldn't also be done here. 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(MAC_BREAKPAD)
- if (remoting::IsUsageStatsAllowed()) {
- remoting::InitializeCrashReporting();
+ // 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 // MAC_BREAKPAD
+#endif // defined(OFFICIAL_BUILD) && (defined(MAC_BREAKPAD) || defined(OS_WIN))
// This object instance is required by Chrome code (for example,
// LazyInstance, MessageLoop).
@@ -1065,7 +1065,29 @@ int main(int argc, char** argv) {
return 0;
}
- remoting::InitHostLogging();
+ 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) {
+ 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)
#if defined(TOOLKIT_GTK)
// Required for any calls into GTK functions, such as the Disconnect and
@@ -1081,18 +1103,18 @@ int main(int argc, char** argv) {
// Create the main message loop and start helper threads.
MessageLoop message_loop(MessageLoop::TYPE_UI);
- scoped_ptr<remoting::ChromotingHostContext> context =
- remoting::ChromotingHostContext::Create(
- new remoting::AutoThreadTaskRunner(message_loop.message_loop_proxy(),
- MessageLoop::QuitClosure()));
+ scoped_ptr<ChromotingHostContext> context =
+ ChromotingHostContext::Create(
+ new AutoThreadTaskRunner(message_loop.message_loop_proxy(),
+ MessageLoop::QuitClosure()));
if (!context)
- return remoting::kInitializationFailed;
+ return kInitializationFailed;
// Create & start the HostProcess using these threads.
// TODO(wez): The HostProcess holds a reference to itself until Shutdown().
// Remove this hack as part of the multi-process refactoring.
- int exit_code = remoting::kSuccessExitCode;
- new remoting::HostProcess(context.Pass(), &exit_code);
+ int exit_code = kSuccessExitCode;
+ new HostProcess(context.Pass(), &exit_code);
// Run the main (also UI) message loop until the host no longer needs it.
message_loop.Run();
@@ -1100,44 +1122,10 @@ int main(int argc, char** argv) {
return exit_code;
}
-#if defined(OS_WIN)
-HMODULE g_hModule = NULL;
-
-int CALLBACK WinMain(HINSTANCE instance,
- HINSTANCE previous_instance,
- LPSTR command_line,
- int show_command) {
-#if defined(OFFICIAL_BUILD)
- if (remoting::IsUsageStatsAllowed()) {
- remoting::InitializeCrashReporting();
- }
-#endif // OFFICIAL_BUILD
-
- g_hModule = instance;
-
- // 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) {
- 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();
- }
+} // namespace remoting
- // CommandLine::Init() ignores the passed |argc| and |argv| on Windows getting
- // the command line from GetCommandLineW(), so we can safely pass NULL here.
- return main(0, NULL);
+#if !defined(OS_WIN)
+int main(int argc, char** argv) {
+ return remoting::HostProcessMain(argc, argv);
}
-
-#endif // defined(OS_WIN)
+#endif // !defined(OS_WIN)
diff --git a/remoting/host/remoting_me2me_host.h b/remoting/host/remoting_me2me_host.h
new file mode 100644
index 0000000..59443a4
--- /dev/null
+++ b/remoting/host/remoting_me2me_host.h
@@ -0,0 +1,17 @@
+// 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/verify_config_window_win.cc b/remoting/host/verify_config_window_win.cc
index c560d6c..cdb99ac 100644
--- a/remoting/host/verify_config_window_win.cc
+++ b/remoting/host/verify_config_window_win.cc
@@ -13,7 +13,7 @@
#include "base/logging.h"
#include "base/utf_string_conversions.h"
#include "remoting/host/pin_hash.h"
-#include "remoting/host/win/elevated_controller_resource.h"
+#include "remoting/host/win/core_resource.h"
#include "remoting/protocol/authentication_method.h"
namespace remoting {
diff --git a/remoting/host/verify_config_window_win.h b/remoting/host/verify_config_window_win.h
index 50400e5..bf3302b 100644
--- a/remoting/host/verify_config_window_win.h
+++ b/remoting/host/verify_config_window_win.h
@@ -14,7 +14,7 @@
#include <string>
#include "base/callback.h"
-#include "remoting/host/win/elevated_controller_resource.h"
+#include "remoting/host/win/core_resource.h"
namespace remoting {
diff --git a/remoting/host/video_scheduler.cc b/remoting/host/video_scheduler.cc
index 90e635f..c927b3c 100644
--- a/remoting/host/video_scheduler.cc
+++ b/remoting/host/video_scheduler.cc
@@ -165,7 +165,7 @@ VideoScheduler::~VideoScheduler() {
void VideoScheduler::StartOnCaptureThread() {
DCHECK(capture_task_runner_->BelongsToCurrentThread());
- // Start the capturer and let it notify us of cursor shape changes.
+ // Start the capturer and let it notify us if cursor shape changes.
capturer_->Start(this);
capture_timer_.reset(new base::OneShotTimer<VideoScheduler>());
diff --git a/remoting/host/win/core.cc b/remoting/host/win/core.cc
new file mode 100644
index 0000000..2acbb05
--- /dev/null
+++ b/remoting/host/win/core.cc
@@ -0,0 +1,14 @@
+// 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"
+
+BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, void* reserved) {
+ if (reason == DLL_PROCESS_ATTACH)
+ DisableThreadLibraryCalls(instance);
+
+ return TRUE;
+}
diff --git a/remoting/host/host_ui.rc b/remoting/host/win/core.rc
index d1e2d5a..ac7ca69 100644
--- a/remoting/host/host_ui.rc
+++ b/remoting/host/win/core.rc
@@ -1,13 +1,13 @@
// Microsoft Visual C++ generated resource script.
//
-#include "host_ui_resource.h"
+#include "core_resource.h"
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
-#include "winres.h"
+#include "afxres.h"
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
@@ -21,31 +21,49 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#pragma code_page(1252)
#endif //_WIN32
-#ifdef APSTUDIO_INVOKED
+// Embedded type library.
+1 typelib "remoting/host/elevated_controller.tlb"
+
/////////////////////////////////////////////////////////////////////////////
//
-// TEXTINCLUDE
+// String Table
//
-1 TEXTINCLUDE
+STRINGTABLE
BEGIN
- "host_ui_resource.h\0"
+#ifdef OFFICIAL_BUILD
+ IDS_DISPLAY_SERVICE_NAME "Chrome Remote Desktop Service"
+ IDS_SERVICE_DESCRIPTION "This service enables incoming connections from Chrome Remote Desktop clients."
+ IDS_CONTROLLER "Chrome Remote Desktop Host Controller"
+#else
+ IDS_DISPLAY_SERVICE_NAME "Chromoting Service"
+ IDS_SERVICE_DESCRIPTION "This service enables incoming connections from Chromoting clients."
+ IDS_CONTROLLER "Chromoting Host Controller"
+#endif
END
-2 TEXTINCLUDE
-BEGIN
- "#include ""winres.h""\r\n"
- "\0"
-END
-
-#endif // APSTUDIO_INVOKED
-
+IDD_VERIFY_CONFIG_DIALOG ICON "remoting/resources/chromoting.ico"
/////////////////////////////////////////////////////////////////////////////
//
// Dialog
//
+IDD_VERIFY_CONFIG_DIALOG DIALOGEX 0, 0, 221, 106
+STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUPWINDOW | WS_CAPTION
+EXSTYLE 0
+CAPTION "kTitle"
+FONT 8, "MS Shell Dlg", 400, 0, 0x1
+BEGIN
+ LTEXT "kConfirmConfigChange",IDC_MESSAGE,7,7,207,30
+ LTEXT "kAccount",IDC_EMAIL_LABEL,7,38,50,30
+ LTEXT "kEmail",IDC_EMAIL,60,38,110,30
+ LTEXT "kPin",IDC_PIN_LABEL,7,55,50,30
+ EDITTEXT IDC_PIN,60,55,100,15,WS_TABSTOP | ES_PASSWORD | ES_NUMBER
+ DEFPUSHBUTTON "kOK",IDOK,68,86,68,14,WS_TABSTOP
+ PUSHBUTTON "kCancel",IDCANCEL,146,86,68,14,WS_TABSTOP
+END
+
IDD_DISCONNECT DIALOGEX 0, 0, 145, 24
STYLE DS_SETFONT | WS_POPUP
EXSTYLE WS_EX_TOPMOST | WS_EX_TOOLWINDOW
@@ -68,33 +86,5 @@ BEGIN
PUSHBUTTON "kCancel",IDC_CONTINUE_CANCEL,7,38,98,14
END
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// DESIGNINFO
-//
-
-#ifdef APSTUDIO_INVOKED
-GUIDELINES DESIGNINFO
-BEGIN
- IDD_DISCONNECT, DIALOG
- BEGIN
- VERTGUIDE, 20
- BOTTOMMARGIN, 23
- END
-
- IDD_CONTINUE, DIALOG
- BEGIN
- LEFTMARGIN, 7
- RIGHTMARGIN, 214
- VERTGUIDE, 105
- VERTGUIDE, 116
- VERTGUIDE, 203
- TOPMARGIN, 7
- BOTTOMMARGIN, 52
- END
-END
-#endif // APSTUDIO_INVOKED
-
#endif // English (U.S.) resources
/////////////////////////////////////////////////////////////////////////////
diff --git a/remoting/host/host_ui_resource.h b/remoting/host/win/core_resource.h
index 6704a27..4d93334 100644
--- a/remoting/host/host_ui_resource.h
+++ b/remoting/host/win/core_resource.h
@@ -4,10 +4,25 @@
//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ generated include file.
-// Used by host_ui.rc
+// Used by host_service.rc
//
-#define IDD_DISCONNECT 101
-#define IDD_CONTINUE 102
+
+// N.B. Values of |IDS_DISPLAY_SERVICE_NAME|, |IDS_SERVICE_DESCRIPTION|,
+// |IDS_CONTROLLER| and |IDD_VERIFY_CONFIG_DIALOG| are hardcoded in
+// remoting/host/install/chromoting.wxs. Make sure the values below and in
+// the installation script match.
+#define IDS_DISPLAY_SERVICE_NAME 101
+#define IDS_SERVICE_DESCRIPTION 102
+#define IDS_CONTROLLER 103
+#define IDD_VERIFY_CONFIG_DIALOG 104
+#define IDC_MESSAGE 105
+#define IDC_EMAIL 106
+#define IDC_PIN 107
+#define IDC_EMAIL_LABEL 108
+#define IDC_PIN_LABEL 109
+
+#define IDD_DISCONNECT 110
+#define IDD_CONTINUE 111
#define IDC_DISCONNECT 1001
#define IDC_DISCONNECT_SHARINGWITH 1002
#define IDC_DISCONNECT_USERNAME 1003
@@ -19,7 +34,7 @@
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
-#define _APS_NEXT_RESOURCE_VALUE 103
+#define _APS_NEXT_RESOURCE_VALUE 112
#define _APS_NEXT_COMMAND_VALUE 40001
#define _APS_NEXT_CONTROL_VALUE 1006
#define _APS_NEXT_SYMED_VALUE 101
diff --git a/remoting/host/win/daemon_process_entry_point.cc b/remoting/host/win/daemon_process_entry_point.cc
new file mode 100644
index 0000000..9367a8b
--- /dev/null
+++ b/remoting/host/win/daemon_process_entry_point.cc
@@ -0,0 +1,14 @@
+// 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
new file mode 100644
index 0000000..e7c2795
--- /dev/null
+++ b/remoting/host/win/daemon_process_main.cc
@@ -0,0 +1,89 @@
+// 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 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
new file mode 100644
index 0000000..ef79c80
--- /dev/null
+++ b/remoting/host/win/daemon_process_main.h
@@ -0,0 +1,17 @@
+// 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
new file mode 100644
index 0000000..e54710e
--- /dev/null
+++ b/remoting/host/win/desktop_process_entry_point.cc
@@ -0,0 +1,14 @@
+// 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/elevated_controller.cc b/remoting/host/win/elevated_controller.cc
index a43203d..89c6fc9 100644
--- a/remoting/host/win/elevated_controller.cc
+++ b/remoting/host/win/elevated_controller.cc
@@ -18,7 +18,7 @@
#include "remoting/host/branding.h"
#include "remoting/host/usage_stats_consent.h"
#include "remoting/host/verify_config_window_win.h"
-#include "remoting/host/win/elevated_controller_resource.h"
+#include "remoting/host/win/core_resource.h"
#include "remoting/host/win/security_descriptor.h"
namespace remoting {
diff --git a/remoting/host/win/elevated_controller.rc b/remoting/host/win/elevated_controller.rc
deleted file mode 100644
index 70b218c..0000000
--- a/remoting/host/win/elevated_controller.rc
+++ /dev/null
@@ -1,69 +0,0 @@
-#include "afxres.h"
-
-// Embedded type library.
-1 typelib "remoting/host/elevated_controller.tlb"
-
-#include "elevated_controller_resource.h"
-
-// English (U.S.) resources
-#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
-#ifdef _WIN32
-LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
-#pragma code_page(1252)
-#endif //_WIN32
-
-STRINGTABLE
-BEGIN
-#ifdef OFFICIAL_BUILD
- IDS_CONTROLLER "Chrome Remote Desktop Host Controller"
-#else
- IDS_CONTROLLER "Chromoting Host Controller"
-#endif
-END
-
-IDD_VERIFY_CONFIG_DIALOG ICON "remoting/resources/chromoting.ico"
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Dialog
-//
-
-IDD_VERIFY_CONFIG_DIALOG DIALOGEX 0, 0, 221, 106
-STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUPWINDOW | WS_CAPTION
-EXSTYLE 0
-CAPTION "kTitle"
-FONT 8, "MS Shell Dlg", 400, 0, 0x1
-BEGIN
- LTEXT "kConfirmConfigChange",IDC_MESSAGE,7,7,207,30
- LTEXT "kAccount",IDC_EMAIL_LABEL,7,38,50,30
- LTEXT "kEmail",IDC_EMAIL,60,38,110,30
- LTEXT "kPin",IDC_PIN_LABEL,7,55,50,30
- EDITTEXT IDC_PIN,60,55,100,15,WS_TABSTOP | ES_PASSWORD | ES_NUMBER
- DEFPUSHBUTTON "kOK",IDOK,68,86,68,14,WS_TABSTOP
- PUSHBUTTON "kCancel",IDCANCEL,146,86,68,14,WS_TABSTOP
-END
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// DESIGNINFO
-//
-
-#ifdef APSTUDIO_INVOKED
-GUIDELINES DESIGNINFO
-BEGIN
- IDD_VERIFY_CONFIG_DIALOG, DIALOG
- BEGIN
- LEFTMARGIN, 7
- RIGHTMARGIN, 214
- VERTGUIDE, 105
- VERTGUIDE, 116
- VERTGUIDE, 203
- TOPMARGIN, 7
- BOTTOMMARGIN, 52
- END
-END
-#endif // APSTUDIO_INVOKED
-
-#endif // English (U.S.) resources
-/////////////////////////////////////////////////////////////////////////////
diff --git a/remoting/host/win/elevated_controller_entry_point.cc b/remoting/host/win/elevated_controller_entry_point.cc
new file mode 100644
index 0000000..747ff4d
--- /dev/null
+++ b/remoting/host/win/elevated_controller_entry_point.cc
@@ -0,0 +1,14 @@
+// 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 620901c..315da8f 100644
--- a/remoting/host/win/elevated_controller_module.cc
+++ b/remoting/host/win/elevated_controller_module.cc
@@ -2,6 +2,8 @@
// 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>
@@ -11,8 +13,6 @@
#include "remoting/base/breakpad.h"
#include "remoting/host/logging.h"
#include "remoting/host/usage_stats_consent.h"
-
-// MIDL-generated declarations.
#include "remoting/host/win/elevated_controller.h"
namespace remoting {
@@ -23,15 +23,10 @@ class ElevatedControllerModule
DECLARE_LIBID(LIBID_ChromotingElevatedControllerLib)
};
-} // namespace remoting
-
-
-remoting::ElevatedControllerModule _AtlModule;
-
-int WINAPI WinMain(HINSTANCE instance, HINSTANCE, LPSTR, int command) {
+int ElevatedControllerMain() {
#ifdef OFFICIAL_BUILD
- if (remoting::IsUsageStatsAllowed()) {
- remoting::InitializeCrashReporting();
+ if (IsUsageStatsAllowed()) {
+ InitializeCrashReporting();
}
#endif // OFFICIAL_BUILD
@@ -47,7 +42,10 @@ int WINAPI WinMain(HINSTANCE instance, HINSTANCE, LPSTR, int command) {
// FilePath, LazyInstance, MessageLoop).
base::AtExitManager exit_manager;
- remoting::InitHostLogging();
+ InitHostLogging();
- return _AtlModule.WinMain(command);
+ ElevatedControllerModule module;
+ return module.WinMain(SW_HIDE);
}
+
+} // namespace remoting
diff --git a/remoting/host/win/elevated_controller_module.h b/remoting/host/win/elevated_controller_module.h
new file mode 100644
index 0000000..6b67cdc
--- /dev/null
+++ b/remoting/host/win/elevated_controller_module.h
@@ -0,0 +1,17 @@
+// 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/elevated_controller_resource.h b/remoting/host/win/elevated_controller_resource.h
deleted file mode 100644
index ec64d5b..0000000
--- a/remoting/host/win/elevated_controller_resource.h
+++ /dev/null
@@ -1,19 +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_ELEVATED_CONTROLLER_RESOURCE_H_
-#define REMOTING_HOST_ELEVATED_CONTROLLER_RESOURCE_H_
-
-// N.B. Values of both |IDS_CONTROLLER| and |IDD_VERIFY_CONFIG_DIALOG| are
-// hardcoded in remoting/host/install/chromoting.wxs. Make sure the values
-// below and in the installation script match.
-#define IDS_CONTROLLER 100
-#define IDD_VERIFY_CONFIG_DIALOG 101
-#define IDC_MESSAGE 102
-#define IDC_EMAIL 103
-#define IDC_PIN 104
-#define IDC_EMAIL_LABEL 105
-#define IDC_PIN_LABEL 106
-
-#endif // REMOTING_HOST_ELEVATED_CONTROLLER_RESOURCE_H_
diff --git a/remoting/host/win/host_process_entry_point.cc b/remoting/host/win/host_process_entry_point.cc
new file mode 100644
index 0000000..e89c9ca
--- /dev/null
+++ b/remoting/host/win/host_process_entry_point.cc
@@ -0,0 +1,14 @@
+// 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 84c7f7c..90e69c4 100644
--- a/remoting/host/win/host_service.cc
+++ b/remoting/host/win/host_service.cc
@@ -11,7 +11,6 @@
#include <shellapi.h>
#include <wtsapi32.h>
-#include "base/at_exit.h"
#include "base/base_paths.h"
#include "base/base_switches.h"
#include "base/bind.h"
@@ -20,12 +19,9 @@
#include "base/message_loop.h"
#include "base/run_loop.h"
#include "base/single_thread_task_runner.h"
-#include "base/stringprintf.h"
#include "base/threading/thread.h"
-#include "base/utf_string_conversions.h"
#include "base/win/wrapped_window_proc.h"
#include "remoting/base/auto_thread.h"
-#include "remoting/base/breakpad.h"
#include "remoting/base/scoped_sc_handle_win.h"
#include "remoting/base/stoppable.h"
#include "remoting/host/branding.h"
@@ -36,16 +32,13 @@
#include "remoting/host/daemon_process.h"
#endif // defined(REMOTING_MULTI_PROCESS)
-#include "remoting/host/usage_stats_consent.h"
-#include "remoting/host/win/host_service_resource.h"
+#include "remoting/host/win/core_resource.h"
#include "remoting/host/win/wts_console_observer.h"
#if !defined(REMOTING_MULTI_PROCESS)
#include "remoting/host/win/wts_console_session_process_driver.h"
#endif // !defined(REMOTING_MULTI_PROCESS)
-using base::StringPrintf;
-
namespace {
// Session id that does not represent any session.
@@ -66,29 +59,11 @@ const char kConsoleSwitchName[] = "console";
// a UAC prompt if necessary.
const char kElevateSwitchName[] = "elevate";
-// "--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 FilePath& program_name) {
- LOG(INFO) << StringPrintf(kUsageMessage,
- UTF16ToWide(program_name.value()).c_str());
-}
-
} // namespace
namespace remoting {
@@ -457,39 +432,3 @@ LRESULT CALLBACK HostService::SessionChangeNotificationProc(HWND hwnd,
}
} // namespace remoting
-
-int CALLBACK WinMain(HINSTANCE instance,
- HINSTANCE previous_instance,
- LPSTR raw_command_line,
- int show_command) {
-#ifdef OFFICIAL_BUILD
- if (remoting::IsUsageStatsAllowed()) {
- remoting::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);
-
- remoting::InitHostLogging();
-
- const CommandLine* command_line = CommandLine::ForCurrentProcess();
- if (command_line->HasSwitch(kHelpSwitchName) ||
- command_line->HasSwitch(kQuestionSwitchName)) {
- usage(command_line->GetProgram());
- return remoting::kSuccessExitCode;
- }
-
- remoting::HostService* service = remoting::HostService::GetInstance();
- if (!service->InitWithCommandLine(command_line)) {
- usage(command_line->GetProgram());
- return remoting::kUsageExitCode;
- }
-
- return service->Run();
-}
diff --git a/remoting/host/win/host_service.rc b/remoting/host/win/host_service.rc
deleted file mode 100644
index 98e7a56..0000000
--- a/remoting/host/win/host_service.rc
+++ /dev/null
@@ -1,80 +0,0 @@
-// Microsoft Visual C++ generated resource script.
-//
-#include "host_service_resource.h"
-
-#define APSTUDIO_READONLY_SYMBOLS
-/////////////////////////////////////////////////////////////////////////////
-//
-// Generated from the TEXTINCLUDE 2 resource.
-//
-#include "afxres.h"
-
-/////////////////////////////////////////////////////////////////////////////
-#undef APSTUDIO_READONLY_SYMBOLS
-
-/////////////////////////////////////////////////////////////////////////////
-// English (U.S.) resources
-
-#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
-#ifdef _WIN32
-LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
-#pragma code_page(1252)
-#endif //_WIN32
-
-#ifdef APSTUDIO_INVOKED
-/////////////////////////////////////////////////////////////////////////////
-//
-// TEXTINCLUDE
-//
-
-1 TEXTINCLUDE
-BEGIN
- "host_service_resource.\0"
-END
-
-2 TEXTINCLUDE
-BEGIN
- "#include ""afxres.h""\r\n"
- "\0"
-END
-
-3 TEXTINCLUDE
-BEGIN
- "\r\n"
- "\0"
-END
-
-#endif // APSTUDIO_INVOKED
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// String Table
-//
-
-STRINGTABLE
-BEGIN
-#ifdef OFFICIAL_BUILD
- IDS_DISPLAY_SERVICE_NAME "Chrome Remote Desktop Service"
- IDS_SERVICE_DESCRIPTION "This service enables incoming connections from Chrome Remote Desktop clients."
-#else
- IDS_DISPLAY_SERVICE_NAME "Chromoting Service"
- IDS_SERVICE_DESCRIPTION "This service enables incoming connections from Chromoting clients."
-#endif
-END
-
-#endif // English (U.S.) resources
-/////////////////////////////////////////////////////////////////////////////
-
-
-
-#ifndef APSTUDIO_INVOKED
-/////////////////////////////////////////////////////////////////////////////
-//
-// Generated from the TEXTINCLUDE 3 resource.
-//
-
-
-/////////////////////////////////////////////////////////////////////////////
-#endif // not APSTUDIO_INVOKED
-
diff --git a/remoting/host/win/host_service_resource.h b/remoting/host/win/host_service_resource.h
deleted file mode 100644
index 82de04d..0000000
--- a/remoting/host/win/host_service_resource.h
+++ /dev/null
@@ -1,21 +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.
-
-//{{NO_DEPENDENCIES}}
-// Microsoft Visual C++ generated include file.
-// Used by host_service.rc
-//
-#define IDS_DISPLAY_SERVICE_NAME 101
-#define IDS_SERVICE_DESCRIPTION 102
-
-// Next default values for new objects
-//
-#ifdef APSTUDIO_INVOKED
-#ifndef APSTUDIO_READONLY_SYMBOLS
-#define _APS_NEXT_RESOURCE_VALUE 103
-#define _APS_NEXT_COMMAND_VALUE 40001
-#define _APS_NEXT_CONTROL_VALUE 1001
-#define _APS_NEXT_SYMED_VALUE 101
-#endif
-#endif
diff --git a/remoting/host/win/remoting_core.ver b/remoting/host/win/remoting_core.ver
new file mode 100644
index 0000000..33a6150
--- /dev/null
+++ b/remoting/host/win/remoting_core.ver
@@ -0,0 +1,4 @@
+BINARY=BINARY_CORE
+FILE_TYPE=VFT_DLL
+INTERNAL_NAME=remoting_core.dll
+ORIGINAL_FILENAME=remoting_core.dll
diff --git a/remoting/host/remoting_desktop.ver b/remoting/host/win/remoting_desktop.ver
index 458c235..458c235 100644
--- a/remoting/host/remoting_desktop.ver
+++ b/remoting/host/win/remoting_desktop.ver
diff --git a/remoting/host/remoting_host_me2me.ver b/remoting/host/win/remoting_host.ver
index 16cde44..16cde44 100644
--- a/remoting/host/remoting_host_me2me.ver
+++ b/remoting/host/win/remoting_host.ver
diff --git a/remoting/remoting.gyp b/remoting/remoting.gyp
index a36f680..fb483e8 100644
--- a/remoting/remoting.gyp
+++ b/remoting/remoting.gyp
@@ -236,6 +236,9 @@
'include_dirs': [
'..', # Root of Chrome checkout
],
+ 'variables': {
+ 'win_debug_RuntimeChecks': '0',
+ },
'conditions': [
['remoting_multi_process != 0', {
'defines': [
@@ -463,20 +466,20 @@
}, # end of target 'remoting_host'
{
- 'target_name': 'remoting_me2me_host',
- 'type': 'executable',
+ 'target_name': 'remoting_me2me_host_static',
+ 'type': 'static_library',
'variables': { 'enable_wexit_time_destructors': 1, },
'dependencies': [
+ '../base/base.gyp:base',
+ '../base/base.gyp:base_i18n',
+ '../media/media.gyp:media',
+ '../net/net.gyp:net',
'remoting_base',
'remoting_breakpad',
'remoting_host',
'remoting_host_event_logger',
'remoting_host_logging',
'remoting_jingle_glue',
- '../base/base.gyp:base',
- '../base/base.gyp:base_i18n',
- '../media/media.gyp:media',
- '../net/net.gyp:net',
],
'defines': [
'VERSION=<(version_full)',
@@ -492,7 +495,6 @@
'host/curtain_mode_win.cc',
'host/posix/signal_handler.cc',
'host/posix/signal_handler.h',
- 'host/remoting_me2me_host.cc',
],
'conditions': [
['os_posix != 1', {
@@ -500,84 +502,8 @@
['exclude', '^host/posix/'],
],
}],
- ['OS=="mac"', {
- 'mac_bundle': 1,
- 'variables': {
- 'host_bundle_id': '<!(python <(version_py_path) -f <(branding_path) -t "@MAC_HOST_BUNDLE_ID@")',
- },
- 'xcode_settings': {
- 'INFOPLIST_FILE': 'host/remoting_me2me_host-Info.plist',
- 'INFOPLIST_PREPROCESS': 'YES',
- 'INFOPLIST_PREPROCESSOR_DEFINITIONS': 'VERSION_FULL="<(version_full)" VERSION_SHORT="<(version_short)" BUNDLE_ID="<(host_bundle_id)" COPYRIGHT_INFO="<(copyright_info)"',
- },
- 'mac_bundle_resources': [
- 'host/disconnect_window.xib',
- 'host/remoting_me2me_host.icns',
- 'host/remoting_me2me_host-Info.plist',
- ],
- 'mac_bundle_resources!': [
- 'host/remoting_me2me_host-Info.plist',
- ],
- 'conditions': [
- ['mac_breakpad==1', {
- 'variables': {
- # 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',
- 'files': [
- '<(PRODUCT_DIR)/crash_inspector',
- '<(PRODUCT_DIR)/crash_report_sender.app'
- ],
- },
- ],
- }], # mac_breakpad==1
- ], # conditions
- }], # OS=mac
- ['OS=="win"', {
- 'product_name': 'remoting_host',
- 'dependencies': [
- 'remoting_version_resources',
- ],
- 'sources': [
- '<(SHARED_INTERMEDIATE_DIR)/remoting/host/remoting_host_messages.rc',
- '<(SHARED_INTERMEDIATE_DIR)/remoting/remoting_host_me2me_version.rc',
- 'host/host_ui.rc',
- ],
- 'link_settings': {
- 'libraries': [
- '-lcomctl32.lib',
- ],
- },
- 'msvs_settings': {
- 'VCLinkerTool': {
- 'AdditionalOptions': [
- "\"/manifestdependency:type='win32' "
- "name='Microsoft.Windows.Common-Controls' "
- "version='6.0.0.0' "
- "processorArchitecture='*' "
- "publicKeyToken='6595b64144ccf1df' language='*'\"",
- ],
- 'conditions': [
- ['buildtype == "Official" and remoting_multi_process == 0', {
- 'AdditionalOptions': [
- "\"/MANIFESTUAC:level='requireAdministrator' "
- "uiAccess='true'\"",
- ],
- }],
- ],
- 'ImportLibrary': '$(OutDir)\\lib\\remoting_host_exe.lib',
- 'OutputFile': '$(OutDir)\\remoting_host.exe',
- # 2 == /SUBSYSTEM:WINDOWS
- 'SubSystem': '2',
- },
- },
- }],
], # end of 'conditions'
- }, # end of target 'remoting_me2me_host'
+ }, # end of target 'remoting_me2me_host_static'
{
'target_name': 'remoting_host_keygen',
@@ -622,7 +548,7 @@
['OS=="win"', {
'dependencies': [
'../google_update/google_update.gyp:google_update',
- 'remoting_elevated_controller',
+ 'remoting_controller_idl',
],
}],
],
@@ -646,7 +572,7 @@
],
'sources': [
'base/dispatch_win.h',
- 'host/host_ui_resource.h',
+ 'host/win/core_resource.h',
'host/plugin/host_log_handler.cc',
'host/plugin/host_log_handler.h',
'host/plugin/host_plugin.cc',
@@ -691,7 +617,7 @@
}], # OS=="mac"
[ 'OS=="win"', {
'dependencies': [
- 'remoting_elevated_controller',
+ 'remoting_controller_idl',
'remoting_version_resources',
],
'include_dirs': [
@@ -699,78 +625,86 @@
],
'sources': [
'<(SHARED_INTERMEDIATE_DIR)/remoting/remoting_host_plugin_version.rc',
- 'host/host_ui.rc',
+ 'host/win/core.rc',
'host/plugin/host_plugin.def',
],
}],
],
}, # end of target 'remoting_host_plugin'
+ ], # end of 'targets'
+ }], # 'enable_remoting_host==1'
+
+ ['OS!="win" and enable_remoting_host==1', {
+ 'targets': [
{
- 'target_name': 'remoting_desktop',
+ 'target_name': 'remoting_me2me_host',
'type': 'executable',
'variables': { 'enable_wexit_time_destructors': 1, },
- 'defines': [
- 'REMOTING_MULTI_PROCESS',
- ],
'dependencies': [
+ '../base/base.gyp:base',
+ '../base/base.gyp:base_i18n',
+ '../media/media.gyp:media',
+ '../net/net.gyp:net',
'remoting_base',
'remoting_breakpad',
'remoting_host',
+ 'remoting_host_event_logger',
'remoting_host_logging',
- '../base/base.gyp:base',
- '../ipc/ipc.gyp:ipc',
+ 'remoting_jingle_glue',
+ 'remoting_me2me_host_static',
+ ],
+ 'defines': [
+ 'VERSION=<(version_full)',
],
'sources': [
- 'host/desktop_process.cc',
- 'host/desktop_process.h',
- 'host/desktop_process_main.cc',
- 'host/desktop_session_agent.cc',
- 'host/desktop_session_agent.h',
- 'host/desktop_session_agent_posix.cc',
- 'host/desktop_session_agent_win.cc',
+ 'host/remoting_me2me_host.cc',
+ 'host/remoting_me2me_host.h',
],
'conditions': [
- ['OS=="win"', {
- 'dependencies': [
- 'remoting_version_resources',
+ ['OS=="mac"', {
+ 'mac_bundle': 1,
+ 'variables': {
+ 'host_bundle_id': '<!(python <(version_py_path) -f <(branding_path) -t "@MAC_HOST_BUNDLE_ID@")',
+ },
+ 'xcode_settings': {
+ 'INFOPLIST_FILE': 'host/remoting_me2me_host-Info.plist',
+ 'INFOPLIST_PREPROCESS': 'YES',
+ 'INFOPLIST_PREPROCESSOR_DEFINITIONS': 'VERSION_FULL="<(version_full)" VERSION_SHORT="<(version_short)" BUNDLE_ID="<(host_bundle_id)" COPYRIGHT_INFO="<(copyright_info)"',
+ },
+ 'mac_bundle_resources': [
+ 'host/disconnect_window.xib',
+ 'host/remoting_me2me_host.icns',
+ 'host/remoting_me2me_host-Info.plist',
],
- 'sources': [
- 'host/host_ui.rc',
- '<(SHARED_INTERMEDIATE_DIR)/remoting/remoting_desktop_version.rc',
+ 'mac_bundle_resources!': [
+ 'host/remoting_me2me_host-Info.plist',
],
- 'link_settings': {
- 'libraries': [
- '-lcomctl32.lib',
- ],
- },
- 'msvs_settings': {
- 'VCLinkerTool': {
- 'AdditionalOptions': [
- "\"/manifestdependency:type='win32' "
- "name='Microsoft.Windows.Common-Controls' "
- "version='6.0.0.0' "
- "processorArchitecture='*' "
- "publicKeyToken='6595b64144ccf1df' language='*'\"",
- ],
- 'conditions': [
- ['buildtype == "Official"', {
- 'AdditionalOptions': [
- "\"/MANIFESTUAC:level='requireAdministrator' "
- "uiAccess='true'\"",
+ 'conditions': [
+ ['mac_breakpad==1', {
+ 'variables': {
+ # 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',
+ 'files': [
+ '<(PRODUCT_DIR)/crash_inspector',
+ '<(PRODUCT_DIR)/crash_report_sender.app'
],
- }],
+ },
],
- # 2 == /SUBSYSTEM:WINDOWS
- 'SubSystem': '2',
- },
- },
- }],
- ],
- }, # end of target 'remoting_desktop'
+ }], # mac_breakpad==1
+ ], # conditions
+ }], # OS=mac
+ ], # end of 'conditions'
+ }, # end of target 'remoting_me2me_host'
], # end of 'targets'
- }], # 'enable_remoting_host==1'
+ }], # 'OS!="win" and enable_remoting_host==1'
+
['OS=="linux" and chromeos==0', {
'targets': [
@@ -1032,7 +966,7 @@
'type': 'none',
'dependencies': [
'../breakpad/breakpad.gyp:dump_syms',
- 'remoting_me2me_host',
+ 'remoting_me2me_host',
],
'actions': [
{
@@ -1073,7 +1007,7 @@
],
}, # end of target 'remoting_breakpad_tester'
{
- 'target_name': 'remoting_elevated_controller',
+ 'target_name': 'remoting_controller_idl',
'type': 'static_library',
'sources': [
'host/win/elevated_controller_idl.templ',
@@ -1113,7 +1047,7 @@
'msvs_cygwin_shell': 1,
},
],
- }, # end of target 'remoting_elevated_controller'
+ }, # end of target 'remoting_controller_idl'
{
'target_name': 'remoting_configurer',
'type': 'executable',
@@ -1150,64 +1084,18 @@
},
}, # end of target 'remoting_configurer'
{
- 'target_name': 'remoting_controller',
- 'type': 'executable',
+ 'target_name': 'remoting_core',
+ 'type': 'shared_library',
'variables': { 'enable_wexit_time_destructors': 1, },
'defines' : [
'_ATL_APARTMENT_THREADED',
'_ATL_NO_AUTOMATIC_NAMESPACE',
'_ATL_CSTRING_EXPLICIT_CONSTRUCTORS',
+ 'HOST_IMPLEMENTATION',
'STRICT',
'DAEMON_CONTROLLER_CLSID="{<(daemon_controller_clsid)}"',
+ 'VERSION=<(version_full)',
],
- 'include_dirs': [
- '<(INTERMEDIATE_DIR)',
- ],
- 'dependencies': [
- '../base/base.gyp:base',
- 'remoting_breakpad',
- 'remoting_elevated_controller',
- 'remoting_host',
- 'remoting_host_logging',
- 'remoting_protocol',
- 'remoting_version_resources',
- ],
- 'sources': [
- '<(SHARED_INTERMEDIATE_DIR)/remoting/remoting_controller_version.rc',
- 'host/pin_hash.cc',
- 'host/pin_hash.h',
- 'host/verify_config_window_win.cc',
- 'host/verify_config_window_win.h',
- 'host/win/elevated_controller.cc',
- 'host/win/elevated_controller.h',
- 'host/win/elevated_controller.rc',
- 'host/win/elevated_controller_module.cc',
- 'host/win/omaha.cc',
- 'host/win/omaha.h',
- ],
- 'link_settings': {
- 'libraries': [
- '-lcomctl32.lib',
- ],
- },
- 'msvs_settings': {
- 'VCLinkerTool': {
- 'AdditionalOptions': [
- "\"/manifestdependency:type='win32' "
- "name='Microsoft.Windows.Common-Controls' "
- "version='6.0.0.0' "
- "processorArchitecture='*' "
- "publicKeyToken='6595b64144ccf1df' language='*'\"",
- ],
- # 2 == /SUBSYSTEM:WINDOWS
- 'SubSystem': '2',
- },
- },
- }, # end of target 'remoting_controller'
- {
- 'target_name': 'remoting_daemon',
- 'type': 'executable',
- 'variables': { 'enable_wexit_time_destructors': 1, },
'dependencies': [
'../base/base.gyp:base',
'../base/base.gyp:base_static',
@@ -1216,12 +1104,17 @@
'../net/net.gyp:net',
'remoting_base',
'remoting_breakpad',
+ 'remoting_controller_idl',
'remoting_host',
+ 'remoting_host_event_logger',
'remoting_host_logging',
+ 'remoting_me2me_host_static',
+ 'remoting_protocol',
'remoting_version_resources',
],
'sources': [
- '<(SHARED_INTERMEDIATE_DIR)/remoting/remoting_daemon_version.rc',
+ '<(SHARED_INTERMEDIATE_DIR)/remoting/host/remoting_host_messages.rc',
+ '<(SHARED_INTERMEDIATE_DIR)/remoting/remoting_core_version.rc',
'base/scoped_sc_handle_win.h',
'../media/video/capture/screen/win/desktop.cc',
'../media/video/capture/screen/win/desktop.h',
@@ -1234,19 +1127,39 @@
'host/daemon_process.cc',
'host/daemon_process.h',
'host/daemon_process_win.cc',
+ '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',
+ 'host/desktop_session_agent.h',
+ 'host/desktop_session_agent_posix.cc',
+ 'host/desktop_session_agent_win.cc',
'host/desktop_session_win.cc',
'host/desktop_session_win.h',
'host/host_exit_codes.h',
+ 'host/host_export.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',
+ 'host/verify_config_window_win.h',
+ '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/host_service.rc',
- 'host/win/host_service_resource.h',
'host/win/omaha.cc',
'host/win/omaha.h',
'host/win/unprivileged_process_delegate.cc',
@@ -1264,14 +1177,121 @@
'msvs_settings': {
'VCLinkerTool': {
'AdditionalDependencies': [
+ 'comctl32.lib',
'wtsapi32.lib',
],
- # 2 == /SUBSYSTEM:WINDOWS
- 'SubSystem': '2',
+ 'AdditionalOptions': [
+ "\"/manifestdependency:type='win32' "
+ "name='Microsoft.Windows.Common-Controls' "
+ "version='6.0.0.0' "
+ "processorArchitecture='*' "
+ "publicKeyToken='6595b64144ccf1df' language='*'\"",
+ ],
+ },
+ },
+ }, # end of target 'remoting_controller_static'
+ {
+ '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, },
+ 'dependencies': [
+ 'remoting_core',
+ 'remoting_version_resources',
+ ],
+ 'sources': [
+ '<(SHARED_INTERMEDIATE_DIR)/remoting/remoting_desktop_version.rc',
+ 'host/win/desktop_process_entry_point.cc',
+ ],
+ 'msvs_settings': {
+ 'VCLinkerTool': {
+ 'conditions': [
+ ['buildtype == "Official"', {
+ 'AdditionalOptions': [
+ "\"/MANIFESTUAC:level='requireAdministrator' "
+ "uiAccess='true'\"",
+ ],
+ }],
+ ],
+ 'EntryPointSymbol': 'DesktopProcessEntryPoint',
+ 'IgnoreAllDefaultLibraries': 'true',
+ 'SubSystem': '2', # /SUBSYSTEM:WINDOWS
+ },
+ },
+ }, # end of target 'remoting_desktop'
+
+ {
+ 'target_name': 'remoting_host_exe',
+ 'product_name': 'remoting_host',
+ '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/host_process_entry_point.cc',
+ ],
+ 'msvs_settings': {
+ 'VCLinkerTool': {
+ 'conditions': [
+ ['buildtype == "Official" and remoting_multi_process == 0', {
+ 'AdditionalOptions': [
+ "\"/MANIFESTUAC:level='requireAdministrator' "
+ "uiAccess='true'\"",
+ ],
+ }],
+ ],
+ 'EntryPointSymbol': 'HostProcessEntryPoint',
+ 'IgnoreAllDefaultLibraries': 'true',
+ 'ImportLibrary': '$(OutDir)\\lib\\remoting_host_exe.lib',
+ 'OutputFile': '$(OutDir)\\remoting_host.exe',
+ 'SubSystem': '2', # /SUBSYSTEM:WINDOWS
+ },
+ },
+ }, # end of target 'remoting_host_exe'
+
# Generates the version information resources for the Windows binaries.
# The .RC files are generated from the "version.rc.version" template and
# placed in the "<(SHARED_INTERMEDIATE_DIR)/remoting" folder.
@@ -1300,10 +1320,11 @@
},
'sources': [
'host/plugin/remoting_host_plugin.ver',
- 'host/remoting_desktop.ver',
- 'host/remoting_host_me2me.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',
],
'rules': [
{
@@ -1390,16 +1411,19 @@
'type': 'none',
'dependencies': [
'remoting_controller',
+ 'remoting_core',
'remoting_daemon',
- 'remoting_me2me_host',
+ 'remoting_host_exe',
],
'compiled_inputs': [
'<(PRODUCT_DIR)/remoting_controller.exe',
+ '<(PRODUCT_DIR)/remoting_core.dll',
'<(PRODUCT_DIR)/remoting_daemon.exe',
'<(PRODUCT_DIR)/remoting_host.exe',
],
'compiled_inputs_dst': [
'files/remoting_controller.exe',
+ 'files/remoting_core.dll',
'files/remoting_daemon.exe',
'files/remoting_host.exe',
],
diff --git a/remoting/version.rc.version b/remoting/version.rc.version
index caf4842..6d9789c 100644
--- a/remoting/version.rc.version
+++ b/remoting/version.rc.version
@@ -15,6 +15,7 @@
#define BINARY_DAEMON 3
#define BINARY_CONTROLLER 4
#define BINARY_DESKTOP 5
+#define BINARY_CORE 6
#define BINARY @BINARY@
#if (BINARY == BINARY_HOST_PLUGIN)
@@ -27,6 +28,8 @@
#define FILE_DESCRIPTION "@CONTROLLER_DESCRIPTION@"
#elif (BINARY == BINARY_DESKTOP)
#define FILE_DESCRIPTION "@DESKTOP_DESCRIPTION@"
+#elif (BINARY == BINARY_CORE)
+#define FILE_DESCRIPTION "@CORE_DESCRIPTION@"
#endif
VS_VERSION_INFO VERSIONINFO