| 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/wts_session_process_delegate.h" | 8 #include "remoting/host/win/wts_session_process_delegate.h" |
| 9 | 9 |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 407 | 407 |
| 408 security_attributes.reset(new SECURITY_ATTRIBUTES()); | 408 security_attributes.reset(new SECURITY_ATTRIBUTES()); |
| 409 security_attributes->nLength = sizeof(SECURITY_ATTRIBUTES); | 409 security_attributes->nLength = sizeof(SECURITY_ATTRIBUTES); |
| 410 security_attributes->lpSecurityDescriptor = security_descriptor.get(); | 410 security_attributes->lpSecurityDescriptor = security_descriptor.get(); |
| 411 security_attributes->bInheritHandle = FALSE; | 411 security_attributes->bInheritHandle = FALSE; |
| 412 } | 412 } |
| 413 | 413 |
| 414 // Try to launch the process. | 414 // Try to launch the process. |
| 415 ScopedHandle worker_process; | 415 ScopedHandle worker_process; |
| 416 ScopedHandle worker_thread; | 416 ScopedHandle worker_thread; |
| 417 if (!LaunchProcessWithToken( | 417 if (!LaunchProcessWithToken(command_line.GetProgram(), |
| 418 command_line.GetProgram(), command_line.GetCommandLineString(), | 418 command_line.GetCommandLineString(), |
| 419 session_token_.Get(), security_attributes.get(), | 419 session_token_.Get(), |
| 420 /* thread_attributes= */ nullptr, /* handles_to_inherit=*/{}, | 420 security_attributes.get(), |
| 421 /* creation_flags= */ CREATE_SUSPENDED | CREATE_BREAKAWAY_FROM_JOB, | 421 nullptr, |
| 422 base::UTF8ToUTF16(kDefaultDesktopName).c_str(), &worker_process, | 422 false, |
| 423 &worker_thread)) { | 423 CREATE_SUSPENDED | CREATE_BREAKAWAY_FROM_JOB, |
| 424 base::UTF8ToUTF16(kDefaultDesktopName).c_str(), |
| 425 &worker_process, |
| 426 &worker_thread)) { |
| 424 ReportFatalError(); | 427 ReportFatalError(); |
| 425 return; | 428 return; |
| 426 } | 429 } |
| 427 | 430 |
| 428 if (launch_elevated_) { | 431 if (launch_elevated_) { |
| 429 if (!AssignProcessToJobObject(job_.Get(), worker_process.Get())) { | 432 if (!AssignProcessToJobObject(job_.Get(), worker_process.Get())) { |
| 430 PLOG(ERROR) << "Failed to assign the worker to the job object"; | 433 PLOG(ERROR) << "Failed to assign the worker to the job object"; |
| 431 ReportFatalError(); | 434 ReportFatalError(); |
| 432 return; | 435 return; |
| 433 } | 436 } |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 569 | 572 |
| 570 void WtsSessionProcessDelegate::CloseChannel() { | 573 void WtsSessionProcessDelegate::CloseChannel() { |
| 571 core_->CloseChannel(); | 574 core_->CloseChannel(); |
| 572 } | 575 } |
| 573 | 576 |
| 574 void WtsSessionProcessDelegate::KillProcess() { | 577 void WtsSessionProcessDelegate::KillProcess() { |
| 575 core_->KillProcess(); | 578 core_->KillProcess(); |
| 576 } | 579 } |
| 577 | 580 |
| 578 } // namespace remoting | 581 } // namespace remoting |
| OLD | NEW |