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