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 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
399 return result; | 399 return result; |
400 | 400 |
401 // Subscribe to Ctrl-C and other console events. | 401 // Subscribe to Ctrl-C and other console events. |
402 if (!SetConsoleCtrlHandler(&HostService::ConsoleControlHandler, TRUE)) { | 402 if (!SetConsoleCtrlHandler(&HostService::ConsoleControlHandler, TRUE)) { |
403 LOG_GETLASTERROR(ERROR) | 403 LOG_GETLASTERROR(ERROR) |
404 << "Failed to set console control handler"; | 404 << "Failed to set console control handler"; |
405 return result; | 405 return result; |
406 } | 406 } |
407 | 407 |
408 // Create a window for receiving session change notifications. | 408 // Create a window for receiving session change notifications. |
409 win::MessageWindow window; | 409 base::win::MessageWindow window; |
410 if (!window.Create(this)) { | 410 if (!window.Create(this)) { |
411 LOG_GETLASTERROR(ERROR) | 411 LOG_GETLASTERROR(ERROR) |
412 << "Failed to create the session notification window"; | 412 << "Failed to create the session notification window"; |
413 goto cleanup; | 413 goto cleanup; |
414 } | 414 } |
415 | 415 |
416 // Subscribe to session change notifications. | 416 // Subscribe to session change notifications. |
417 if (WTSRegisterSessionNotification(window.hwnd(), | 417 if (WTSRegisterSessionNotification(window.hwnd(), |
418 NOTIFY_FOR_ALL_SESSIONS) != FALSE) { | 418 NOTIFY_FOR_ALL_SESSIONS) != FALSE) { |
419 CreateLauncher(scoped_refptr<AutoThreadTaskRunner>( | 419 CreateLauncher(scoped_refptr<AutoThreadTaskRunner>( |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
512 int DaemonProcessMain() { | 512 int DaemonProcessMain() { |
513 HostService* service = HostService::GetInstance(); | 513 HostService* service = HostService::GetInstance(); |
514 if (!service->InitWithCommandLine(CommandLine::ForCurrentProcess())) { | 514 if (!service->InitWithCommandLine(CommandLine::ForCurrentProcess())) { |
515 return kUsageExitCode; | 515 return kUsageExitCode; |
516 } | 516 } |
517 | 517 |
518 return service->Run(); | 518 return service->Run(); |
519 } | 519 } |
520 | 520 |
521 } // namespace remoting | 521 } // namespace remoting |
OLD | NEW |