| 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/wts_session_process_launcher_win.h" | 8 #include "remoting/host/wts_session_process_launcher_win.h" |
| 9 | 9 |
| 10 #include <windows.h> | 10 #include <windows.h> |
| 11 #include <sddl.h> | 11 #include <sddl.h> |
| 12 #include <limits> | 12 #include <limits> |
| 13 | 13 |
| 14 #include "base/base_switches.h" |
| 14 #include "base/bind.h" | 15 #include "base/bind.h" |
| 15 #include "base/bind_helpers.h" | 16 #include "base/bind_helpers.h" |
| 16 #include "base/command_line.h" | 17 #include "base/command_line.h" |
| 17 #include "base/logging.h" | 18 #include "base/logging.h" |
| 18 #include "base/message_loop_proxy.h" | 19 #include "base/message_loop_proxy.h" |
| 19 #include "base/process_util.h" | 20 #include "base/process_util.h" |
| 20 #include "base/rand_util.h" | 21 #include "base/rand_util.h" |
| 21 #include "base/string16.h" | 22 #include "base/string16.h" |
| 22 #include "base/stringize_macros.h" | 23 #include "base/stringize_macros.h" |
| 23 #include "base/stringprintf.h" | 24 #include "base/stringprintf.h" |
| (...skipping 25 matching lines...) Expand all Loading... |
| 49 char16 kDefaultDesktopName[] = TO_L_STRING("winsta0\\default"); | 50 char16 kDefaultDesktopName[] = TO_L_STRING("winsta0\\default"); |
| 50 | 51 |
| 51 // Match the pipe name prefix used by Chrome IPC channels. | 52 // Match the pipe name prefix used by Chrome IPC channels. |
| 52 const char16 kChromePipeNamePrefix[] = TO_L_STRING("\\\\.\\pipe\\chrome."); | 53 const char16 kChromePipeNamePrefix[] = TO_L_STRING("\\\\.\\pipe\\chrome."); |
| 53 | 54 |
| 54 // The IPC channel name is passed to the host in the command line. | 55 // The IPC channel name is passed to the host in the command line. |
| 55 const char kChromotingIpcSwitchName[] = "chromoting-ipc"; | 56 const char kChromotingIpcSwitchName[] = "chromoting-ipc"; |
| 56 | 57 |
| 57 // The command line parameters that should be copied from the service's command | 58 // The command line parameters that should be copied from the service's command |
| 58 // line to the host process. | 59 // line to the host process. |
| 59 const char* kCopiedSwitchNames[] = { "auth-config", "host-config" }; | 60 const char* kCopiedSwitchNames[] = { |
| 61 "auth-config", "host-config", switches::kV, switches::kVModule }; |
| 60 | 62 |
| 61 // The security descriptor of the Chromoting IPC channel. It gives full access | 63 // The security descriptor of the Chromoting IPC channel. It gives full access |
| 62 // to LocalSystem and denies access by anyone else. | 64 // to LocalSystem and denies access by anyone else. |
| 63 const char16 kChromotingChannelSecurityDescriptor[] = | 65 const char16 kChromotingChannelSecurityDescriptor[] = |
| 64 TO_L_STRING("O:SYG:SYD:(A;;GA;;;SY)"); | 66 TO_L_STRING("O:SYG:SYD:(A;;GA;;;SY)"); |
| 65 | 67 |
| 66 // Takes the process token and makes a copy of it. The returned handle will have | 68 // Takes the process token and makes a copy of it. The returned handle will have |
| 67 // |desired_access| rights. | 69 // |desired_access| rights. |
| 68 bool CopyProcessToken(DWORD desired_access, | 70 bool CopyProcessToken(DWORD desired_access, |
| 69 ScopedHandle* token_out) { | 71 ScopedHandle* token_out) { |
| (...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 488 process_watcher_.StopWatching(); | 490 process_watcher_.StopWatching(); |
| 489 process_.Terminate(0); | 491 process_.Terminate(0); |
| 490 process_.Close(); | 492 process_.Close(); |
| 491 chromoting_channel_.reset(); | 493 chromoting_channel_.reset(); |
| 492 state_ = StateDetached; | 494 state_ = StateDetached; |
| 493 break; | 495 break; |
| 494 } | 496 } |
| 495 } | 497 } |
| 496 | 498 |
| 497 } // namespace remoting | 499 } // namespace remoting |
| OLD | NEW |