Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(108)

Side by Side Diff: remoting/host/win/wts_session_process_delegate.cc

Issue 92173002: Merge 237541 "Revert of https://codereview.chromium.org/71013004/" (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1721/src/
Patch Set: Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « remoting/host/win/worker_process_launcher_unittest.cc ('k') | sandbox/win/src/Wow64.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "base/bind.h" 10 #include "base/bind.h"
(...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after
506 base::win::ScopedHandle worker_process) { 506 base::win::ScopedHandle worker_process) {
507 DCHECK(caller_task_runner_->BelongsToCurrentThread()); 507 DCHECK(caller_task_runner_->BelongsToCurrentThread());
508 DCHECK(!worker_process_.IsValid()); 508 DCHECK(!worker_process_.IsValid());
509 509
510 worker_process_ = worker_process.Pass(); 510 worker_process_ = worker_process.Pass();
511 511
512 // Report a handle that can be used to wait for the worker process completion, 512 // Report a handle that can be used to wait for the worker process completion,
513 // query information about the process and duplicate handles. 513 // query information about the process and duplicate handles.
514 DWORD desired_access = 514 DWORD desired_access =
515 SYNCHRONIZE | PROCESS_DUP_HANDLE | PROCESS_QUERY_INFORMATION; 515 SYNCHRONIZE | PROCESS_DUP_HANDLE | PROCESS_QUERY_INFORMATION;
516 HANDLE temp_handle; 516 ScopedHandle limited_handle;
517 if (!DuplicateHandle(GetCurrentProcess(), 517 if (!DuplicateHandle(GetCurrentProcess(),
518 worker_process_, 518 worker_process_,
519 GetCurrentProcess(), 519 GetCurrentProcess(),
520 &temp_handle, 520 limited_handle.Receive(),
521 desired_access, 521 desired_access,
522 FALSE, 522 FALSE,
523 0)) { 523 0)) {
524 LOG_GETLASTERROR(ERROR) << "Failed to duplicate a handle"; 524 LOG_GETLASTERROR(ERROR) << "Failed to duplicate a handle";
525 ReportFatalError(); 525 ReportFatalError();
526 return; 526 return;
527 } 527 }
528 ScopedHandle limited_handle(temp_handle);
529 528
530 event_handler_->OnProcessLaunched(limited_handle.Pass()); 529 event_handler_->OnProcessLaunched(limited_handle.Pass());
531 } 530 }
532 531
533 WtsSessionProcessDelegate::WtsSessionProcessDelegate( 532 WtsSessionProcessDelegate::WtsSessionProcessDelegate(
534 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner, 533 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner,
535 scoped_ptr<CommandLine> target_command, 534 scoped_ptr<CommandLine> target_command,
536 bool launch_elevated, 535 bool launch_elevated,
537 const std::string& channel_security) { 536 const std::string& channel_security) {
538 core_ = new Core(io_task_runner, 537 core_ = new Core(io_task_runner,
(...skipping 21 matching lines...) Expand all
560 559
561 void WtsSessionProcessDelegate::CloseChannel() { 560 void WtsSessionProcessDelegate::CloseChannel() {
562 core_->CloseChannel(); 561 core_->CloseChannel();
563 } 562 }
564 563
565 void WtsSessionProcessDelegate::KillProcess() { 564 void WtsSessionProcessDelegate::KillProcess() {
566 core_->KillProcess(); 565 core_->KillProcess();
567 } 566 }
568 567
569 } // namespace remoting 568 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/host/win/worker_process_launcher_unittest.cc ('k') | sandbox/win/src/Wow64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698