| 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(command_line.GetProgram(), | 417 if (!LaunchProcessWithToken( |
| 418 command_line.GetCommandLineString(), | 418 command_line.GetProgram(), command_line.GetCommandLineString(), |
| 419 session_token_.Get(), | 419 session_token_.Get(), security_attributes.get(), |
| 420 security_attributes.get(), | 420 /* thread_attributes= */ nullptr, /* handles_to_inherit=*/{}, |
| 421 nullptr, | 421 /* creation_flags= */ CREATE_SUSPENDED | CREATE_BREAKAWAY_FROM_JOB, |
| 422 false, | 422 base::UTF8ToUTF16(kDefaultDesktopName).c_str(), &worker_process, |
| 423 CREATE_SUSPENDED | CREATE_BREAKAWAY_FROM_JOB, | 423 &worker_thread)) { |
| 424 base::UTF8ToUTF16(kDefaultDesktopName).c_str(), | |
| 425 &worker_process, | |
| 426 &worker_thread)) { | |
| 427 ReportFatalError(); | 424 ReportFatalError(); |
| 428 return; | 425 return; |
| 429 } | 426 } |
| 430 | 427 |
| 431 if (launch_elevated_) { | 428 if (launch_elevated_) { |
| 432 if (!AssignProcessToJobObject(job_.Get(), worker_process.Get())) { | 429 if (!AssignProcessToJobObject(job_.Get(), worker_process.Get())) { |
| 433 PLOG(ERROR) << "Failed to assign the worker to the job object"; | 430 PLOG(ERROR) << "Failed to assign the worker to the job object"; |
| 434 ReportFatalError(); | 431 ReportFatalError(); |
| 435 return; | 432 return; |
| 436 } | 433 } |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 572 | 569 |
| 573 void WtsSessionProcessDelegate::CloseChannel() { | 570 void WtsSessionProcessDelegate::CloseChannel() { |
| 574 core_->CloseChannel(); | 571 core_->CloseChannel(); |
| 575 } | 572 } |
| 576 | 573 |
| 577 void WtsSessionProcessDelegate::KillProcess() { | 574 void WtsSessionProcessDelegate::KillProcess() { |
| 578 core_->KillProcess(); | 575 core_->KillProcess(); |
| 579 } | 576 } |
| 580 | 577 |
| 581 } // namespace remoting | 578 } // namespace remoting |
| OLD | NEW |