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 #include "remoting/host/win/wts_console_session_process_driver.h" | 5 #include "remoting/host/win/wts_console_session_process_driver.h" |
6 | 6 |
7 #include "base/base_switches.h" | 7 #include "base/base_switches.h" |
8 #include "base/file_path.h" | 8 #include "base/file_path.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/single_thread_task_runner.h" | 10 #include "base/single_thread_task_runner.h" |
11 #include "ipc/ipc_message.h" | 11 #include "ipc/ipc_message.h" |
| 12 #include "ipc/ipc_message_macros.h" |
| 13 #include "remoting/host/chromoting_messages.h" |
12 #include "remoting/host/ipc_consts.h" | 14 #include "remoting/host/ipc_consts.h" |
| 15 #include "remoting/host/sas_injector.h" |
13 #include "remoting/host/win/worker_process_launcher.h" | 16 #include "remoting/host/win/worker_process_launcher.h" |
14 #include "remoting/host/win/wts_console_monitor.h" | 17 #include "remoting/host/win/wts_console_monitor.h" |
15 #include "remoting/host/win/wts_session_process_delegate.h" | 18 #include "remoting/host/win/wts_session_process_delegate.h" |
16 | 19 |
17 // The security descriptor of the named pipe the process running in the console | 20 // The security descriptor of the named pipe the process running in the console |
18 // session connects to. It gives full access to LocalSystem and denies access by | 21 // session connects to. It gives full access to LocalSystem and denies access by |
19 // anyone else. | 22 // anyone else. |
20 const char kDaemonIpcSecurityDescriptor[] = "O:SYG:SYD:(A;;GA;;;SY)"; | 23 const char kDaemonIpcSecurityDescriptor[] = "O:SYG:SYD:(A;;GA;;;SY)"; |
21 | 24 |
22 namespace remoting { | 25 namespace remoting { |
(...skipping 24 matching lines...) Expand all Loading... |
47 } | 50 } |
48 | 51 |
49 void WtsConsoleSessionProcessDriver::OnChannelConnected(int32 peer_pid) { | 52 void WtsConsoleSessionProcessDriver::OnChannelConnected(int32 peer_pid) { |
50 DCHECK(caller_task_runner_->BelongsToCurrentThread()); | 53 DCHECK(caller_task_runner_->BelongsToCurrentThread()); |
51 } | 54 } |
52 | 55 |
53 bool WtsConsoleSessionProcessDriver::OnMessageReceived( | 56 bool WtsConsoleSessionProcessDriver::OnMessageReceived( |
54 const IPC::Message& message) { | 57 const IPC::Message& message) { |
55 DCHECK(caller_task_runner_->BelongsToCurrentThread()); | 58 DCHECK(caller_task_runner_->BelongsToCurrentThread()); |
56 | 59 |
57 return false; | 60 bool handled = true; |
| 61 IPC_BEGIN_MESSAGE_MAP(WtsConsoleSessionProcessDriver, message) |
| 62 IPC_MESSAGE_HANDLER(ChromotingNetworkDaemonMsg_SendSasToConsole, |
| 63 OnSendSasToConsole) |
| 64 IPC_MESSAGE_UNHANDLED(handled = false) |
| 65 IPC_END_MESSAGE_MAP() |
| 66 return handled; |
58 } | 67 } |
59 | 68 |
60 void WtsConsoleSessionProcessDriver::OnPermanentError() { | 69 void WtsConsoleSessionProcessDriver::OnPermanentError() { |
61 DCHECK(caller_task_runner_->BelongsToCurrentThread()); | 70 DCHECK(caller_task_runner_->BelongsToCurrentThread()); |
62 | 71 |
63 Stop(); | 72 Stop(); |
64 } | 73 } |
65 | 74 |
66 void WtsConsoleSessionProcessDriver::OnSessionAttached(uint32 session_id) { | 75 void WtsConsoleSessionProcessDriver::OnSessionAttached(uint32 session_id) { |
67 DCHECK(caller_task_runner_->BelongsToCurrentThread()); | 76 DCHECK(caller_task_runner_->BelongsToCurrentThread()); |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 launcher_.reset(); | 109 launcher_.reset(); |
101 } | 110 } |
102 | 111 |
103 void WtsConsoleSessionProcessDriver::DoStop() { | 112 void WtsConsoleSessionProcessDriver::DoStop() { |
104 DCHECK(caller_task_runner_->BelongsToCurrentThread()); | 113 DCHECK(caller_task_runner_->BelongsToCurrentThread()); |
105 | 114 |
106 launcher_.reset(); | 115 launcher_.reset(); |
107 CompleteStopping(); | 116 CompleteStopping(); |
108 } | 117 } |
109 | 118 |
| 119 void WtsConsoleSessionProcessDriver::OnSendSasToConsole() { |
| 120 DCHECK(caller_task_runner_->BelongsToCurrentThread()); |
| 121 |
| 122 if (!launcher_) |
| 123 return; |
| 124 |
| 125 if (!sas_injector_) |
| 126 sas_injector_ = SasInjector::Create(); |
| 127 if (!sas_injector_->InjectSas()) |
| 128 LOG(ERROR) << "Failed to inject Secure Attention Sequence."; |
| 129 } |
| 130 |
110 } // namespace remoting | 131 } // namespace remoting |
OLD | NEW |