| 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 <sddl.h> | 10 #include <sddl.h> |
| (...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 378 return result; | 378 return result; |
| 379 | 379 |
| 380 // Subscribe to Ctrl-C and other console events. | 380 // Subscribe to Ctrl-C and other console events. |
| 381 if (!SetConsoleCtrlHandler(&HostService::ConsoleControlHandler, TRUE)) { | 381 if (!SetConsoleCtrlHandler(&HostService::ConsoleControlHandler, TRUE)) { |
| 382 LOG_GETLASTERROR(ERROR) | 382 LOG_GETLASTERROR(ERROR) |
| 383 << "Failed to set console control handler"; | 383 << "Failed to set console control handler"; |
| 384 return result; | 384 return result; |
| 385 } | 385 } |
| 386 | 386 |
| 387 // Create a window for receiving session change notifications. | 387 // Create a window for receiving session change notifications. |
| 388 base::win::MessageWindow window; | 388 win::MessageWindow window; |
| 389 if (!window.Create(this)) { | 389 if (!window.Create(this)) { |
| 390 LOG_GETLASTERROR(ERROR) | 390 LOG_GETLASTERROR(ERROR) |
| 391 << "Failed to create the session notification window"; | 391 << "Failed to create the session notification window"; |
| 392 goto cleanup; | 392 goto cleanup; |
| 393 } | 393 } |
| 394 | 394 |
| 395 // Subscribe to session change notifications. | 395 // Subscribe to session change notifications. |
| 396 if (WTSRegisterSessionNotification(window.hwnd(), | 396 if (WTSRegisterSessionNotification(window.hwnd(), |
| 397 NOTIFY_FOR_ALL_SESSIONS) != FALSE) { | 397 NOTIFY_FOR_ALL_SESSIONS) != FALSE) { |
| 398 CreateLauncher(scoped_refptr<AutoThreadTaskRunner>( | 398 CreateLauncher(scoped_refptr<AutoThreadTaskRunner>( |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 491 int DaemonProcessMain() { | 491 int DaemonProcessMain() { |
| 492 HostService* service = HostService::GetInstance(); | 492 HostService* service = HostService::GetInstance(); |
| 493 if (!service->InitWithCommandLine(CommandLine::ForCurrentProcess())) { | 493 if (!service->InitWithCommandLine(CommandLine::ForCurrentProcess())) { |
| 494 return kUsageExitCode; | 494 return kUsageExitCode; |
| 495 } | 495 } |
| 496 | 496 |
| 497 return service->Run(); | 497 return service->Run(); |
| 498 } | 498 } |
| 499 | 499 |
| 500 } // namespace remoting | 500 } // namespace remoting |
| OLD | NEW |