| OLD | NEW |
| 1 | 1 |
| 2 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 3 // Use of this source code is governed by a BSD-style license that can be | 3 // Use of this source code is governed by a BSD-style license that can be |
| 4 // found in the LICENSE file. | 4 // found in the LICENSE file. |
| 5 // | 5 // |
| 6 // This file implements the Windows service controlling Me2Me host processes | 6 // This file implements the Windows service controlling Me2Me host processes |
| 7 // running within user sessions. | 7 // running within user sessions. |
| 8 | 8 |
| 9 #include "remoting/host/win/unprivileged_process_delegate.h" | 9 #include "remoting/host/win/unprivileged_process_delegate.h" |
| 10 | 10 |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 DWORD desired_access = | 159 DWORD desired_access = |
| 160 WINSTA_ALL_ACCESS | DELETE | READ_CONTROL | WRITE_DAC | WRITE_OWNER; | 160 WINSTA_ALL_ACCESS | DELETE | READ_CONTROL | WRITE_DAC | WRITE_OWNER; |
| 161 | 161 |
| 162 SECURITY_ATTRIBUTES security_attributes = {0}; | 162 SECURITY_ATTRIBUTES security_attributes = {0}; |
| 163 security_attributes.nLength = sizeof(security_attributes); | 163 security_attributes.nLength = sizeof(security_attributes); |
| 164 security_attributes.lpSecurityDescriptor = window_station_sd.get(); | 164 security_attributes.lpSecurityDescriptor = window_station_sd.get(); |
| 165 security_attributes.bInheritHandle = TRUE; | 165 security_attributes.bInheritHandle = TRUE; |
| 166 | 166 |
| 167 WindowStationAndDesktop handles; | 167 WindowStationAndDesktop handles; |
| 168 handles.SetWindowStation(CreateWindowStation( | 168 handles.SetWindowStation(CreateWindowStation( |
| 169 UTF8ToUTF16(window_station_name).c_str(), window_station_flags, | 169 base::UTF8ToUTF16(window_station_name).c_str(), window_station_flags, |
| 170 desired_access, &security_attributes)); | 170 desired_access, &security_attributes)); |
| 171 if (!handles.window_station()) { | 171 if (!handles.window_station()) { |
| 172 LOG_GETLASTERROR(ERROR) << "CreateWindowStation() failed"; | 172 LOG_GETLASTERROR(ERROR) << "CreateWindowStation() failed"; |
| 173 return false; | 173 return false; |
| 174 } | 174 } |
| 175 | 175 |
| 176 // Switch to the new window station and create a desktop on it. | 176 // Switch to the new window station and create a desktop on it. |
| 177 if (!SetProcessWindowStation(handles.window_station())) { | 177 if (!SetProcessWindowStation(handles.window_station())) { |
| 178 LOG_GETLASTERROR(ERROR) << "SetProcessWindowStation() failed"; | 178 LOG_GETLASTERROR(ERROR) << "SetProcessWindowStation() failed"; |
| 179 return false; | 179 return false; |
| (...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 414 LOG_GETLASTERROR(ERROR) << "Failed to duplicate a handle"; | 414 LOG_GETLASTERROR(ERROR) << "Failed to duplicate a handle"; |
| 415 ReportFatalError(); | 415 ReportFatalError(); |
| 416 return; | 416 return; |
| 417 } | 417 } |
| 418 ScopedHandle limited_handle(temp_handle); | 418 ScopedHandle limited_handle(temp_handle); |
| 419 | 419 |
| 420 event_handler_->OnProcessLaunched(limited_handle.Pass()); | 420 event_handler_->OnProcessLaunched(limited_handle.Pass()); |
| 421 } | 421 } |
| 422 | 422 |
| 423 } // namespace remoting | 423 } // namespace remoting |
| OLD | NEW |