| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 // | 4 // |
| 5 // This file implements the Windows service controlling Me2Me host processes | 5 // This file implements the Windows service controlling Me2Me host processes |
| 6 // running within user sessions. | 6 // running within user sessions. |
| 7 | 7 |
| 8 #include "remoting/host/win/host_service.h" | 8 #include "remoting/host/win/host_service.h" |
| 9 | 9 |
| 10 #include <windows.h> | 10 #include <windows.h> |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 #include "remoting/base/stoppable.h" | 30 #include "remoting/base/stoppable.h" |
| 31 #include "remoting/host/branding.h" | 31 #include "remoting/host/branding.h" |
| 32 #include "remoting/host/host_exit_codes.h" | 32 #include "remoting/host/host_exit_codes.h" |
| 33 #include "remoting/host/logging.h" | 33 #include "remoting/host/logging.h" |
| 34 | 34 |
| 35 #if defined(REMOTING_MULTI_PROCESS) | 35 #if defined(REMOTING_MULTI_PROCESS) |
| 36 #include "remoting/host/daemon_process.h" | 36 #include "remoting/host/daemon_process.h" |
| 37 #endif // defined(REMOTING_MULTI_PROCESS) | 37 #endif // defined(REMOTING_MULTI_PROCESS) |
| 38 | 38 |
| 39 #include "remoting/host/usage_stats_consent.h" | 39 #include "remoting/host/usage_stats_consent.h" |
| 40 #include "remoting/host/win/host_service_resource.h" | 40 #include "remoting/host/win/core_resource.h" |
| 41 #include "remoting/host/win/wts_console_observer.h" | 41 #include "remoting/host/win/wts_console_observer.h" |
| 42 | 42 |
| 43 #if !defined(REMOTING_MULTI_PROCESS) | 43 #if !defined(REMOTING_MULTI_PROCESS) |
| 44 #include "remoting/host/win/wts_console_session_process_driver.h" | 44 #include "remoting/host/win/wts_console_session_process_driver.h" |
| 45 #endif // !defined(REMOTING_MULTI_PROCESS) | 45 #endif // !defined(REMOTING_MULTI_PROCESS) |
| 46 | 46 |
| 47 using base::StringPrintf; | 47 using base::StringPrintf; |
| 48 | 48 |
| 49 namespace { | 49 namespace { |
| 50 | 50 |
| (...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 449 HostService* self = HostService::GetInstance(); | 449 HostService* self = HostService::GetInstance(); |
| 450 self->OnSessionChange(); | 450 self->OnSessionChange(); |
| 451 return 0; | 451 return 0; |
| 452 } | 452 } |
| 453 | 453 |
| 454 default: | 454 default: |
| 455 return DefWindowProc(hwnd, message, wparam, lparam); | 455 return DefWindowProc(hwnd, message, wparam, lparam); |
| 456 } | 456 } |
| 457 } | 457 } |
| 458 | 458 |
| 459 } // namespace remoting | 459 int RunDaemonProcess() { |
| 460 | |
| 461 int CALLBACK WinMain(HINSTANCE instance, | |
| 462 HINSTANCE previous_instance, | |
| 463 LPSTR raw_command_line, | |
| 464 int show_command) { | |
| 465 #ifdef OFFICIAL_BUILD | 460 #ifdef OFFICIAL_BUILD |
| 466 if (remoting::IsUsageStatsAllowed()) { | 461 if (IsUsageStatsAllowed()) { |
| 467 remoting::InitializeCrashReporting(); | 462 InitializeCrashReporting(); |
| 468 } | 463 } |
| 469 #endif // OFFICIAL_BUILD | 464 #endif // OFFICIAL_BUILD |
| 470 | 465 |
| 471 // This object instance is required by Chrome code (for example, | 466 // This object instance is required by Chrome code (for example, |
| 472 // FilePath, LazyInstance, MessageLoop, Singleton, etc). | 467 // FilePath, LazyInstance, MessageLoop, Singleton, etc). |
| 473 base::AtExitManager exit_manager; | 468 base::AtExitManager exit_manager; |
| 474 | 469 |
| 475 // CommandLine::Init() ignores the passed |argc| and |argv| on Windows getting | 470 // CommandLine::Init() ignores the passed |argc| and |argv| on Windows getting |
| 476 // the command line from GetCommandLineW(), so we can safely pass NULL here. | 471 // the command line from GetCommandLineW(), so we can safely pass NULL here. |
| 477 CommandLine::Init(0, NULL); | 472 CommandLine::Init(0, NULL); |
| 478 | 473 |
| 479 remoting::InitHostLogging(); | 474 InitHostLogging(); |
| 480 | 475 |
| 481 const CommandLine* command_line = CommandLine::ForCurrentProcess(); | 476 const CommandLine* command_line = CommandLine::ForCurrentProcess(); |
| 482 if (command_line->HasSwitch(kHelpSwitchName) || | 477 if (command_line->HasSwitch(kHelpSwitchName) || |
| 483 command_line->HasSwitch(kQuestionSwitchName)) { | 478 command_line->HasSwitch(kQuestionSwitchName)) { |
| 484 usage(command_line->GetProgram()); | 479 usage(command_line->GetProgram()); |
| 485 return remoting::kSuccessExitCode; | 480 return kSuccessExitCode; |
| 486 } | 481 } |
| 487 | 482 |
| 488 remoting::HostService* service = remoting::HostService::GetInstance(); | 483 HostService* service = HostService::GetInstance(); |
| 489 if (!service->InitWithCommandLine(command_line)) { | 484 if (!service->InitWithCommandLine(command_line)) { |
| 490 usage(command_line->GetProgram()); | 485 usage(command_line->GetProgram()); |
| 491 return remoting::kUsageExitCode; | 486 return kUsageExitCode; |
| 492 } | 487 } |
| 493 | 488 |
| 494 return service->Run(); | 489 return service->Run(); |
| 495 } | 490 } |
| 491 |
| 492 } // namespace remoting |
| OLD | NEW |