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 <sddl.h> | 11 #include <sddl.h> |
11 #include <windows.h> | |
12 #include <wtsapi32.h> | 12 #include <wtsapi32.h> |
13 | 13 |
14 #include "base/base_paths.h" | 14 #include "base/base_paths.h" |
15 #include "base/base_switches.h" | 15 #include "base/base_switches.h" |
16 #include "base/bind.h" | 16 #include "base/bind.h" |
17 #include "base/command_line.h" | 17 #include "base/command_line.h" |
18 #include "base/files/file_path.h" | 18 #include "base/files/file_path.h" |
19 #include "base/message_loop/message_loop.h" | 19 #include "base/message_loop/message_loop.h" |
20 #include "base/run_loop.h" | 20 #include "base/run_loop.h" |
21 #include "base/single_thread_task_runner.h" | 21 #include "base/single_thread_task_runner.h" |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 HostService::HostService() : | 138 HostService::HostService() : |
139 run_routine_(&HostService::RunAsService), | 139 run_routine_(&HostService::RunAsService), |
140 service_status_handle_(0), | 140 service_status_handle_(0), |
141 stopped_event_(true, false), | 141 stopped_event_(true, false), |
142 weak_factory_(this) { | 142 weak_factory_(this) { |
143 } | 143 } |
144 | 144 |
145 HostService::~HostService() { | 145 HostService::~HostService() { |
146 } | 146 } |
147 | 147 |
148 void HostService::OnSessionChange(uint32 event, uint32 session_id) { | 148 void HostService::OnSessionChange(uint32_t event, uint32_t session_id) { |
149 DCHECK(main_task_runner_->BelongsToCurrentThread()); | 149 DCHECK(main_task_runner_->BelongsToCurrentThread()); |
150 DCHECK_NE(session_id, kInvalidSessionId); | 150 DCHECK_NE(session_id, kInvalidSessionId); |
151 | 151 |
152 // Process only attach/detach notifications. | 152 // Process only attach/detach notifications. |
153 if (event != WTS_CONSOLE_CONNECT && event != WTS_CONSOLE_DISCONNECT && | 153 if (event != WTS_CONSOLE_CONNECT && event != WTS_CONSOLE_DISCONNECT && |
154 event != WTS_REMOTE_CONNECT && event != WTS_REMOTE_DISCONNECT) { | 154 event != WTS_REMOTE_CONNECT && event != WTS_REMOTE_DISCONNECT) { |
155 return; | 155 return; |
156 } | 156 } |
157 | 157 |
158 // Assuming that notification can arrive later query the current state of | 158 // Assuming that notification can arrive later query the current state of |
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
434 int DaemonProcessMain() { | 434 int DaemonProcessMain() { |
435 HostService* service = HostService::GetInstance(); | 435 HostService* service = HostService::GetInstance(); |
436 if (!service->InitWithCommandLine(base::CommandLine::ForCurrentProcess())) { | 436 if (!service->InitWithCommandLine(base::CommandLine::ForCurrentProcess())) { |
437 return kUsageExitCode; | 437 return kUsageExitCode; |
438 } | 438 } |
439 | 439 |
440 return service->Run(); | 440 return service->Run(); |
441 } | 441 } |
442 | 442 |
443 } // namespace remoting | 443 } // namespace remoting |
OLD | NEW |