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

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

Issue 10832068: Moving Windows-only files: remoting/host -> remoting/host/win. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 4 months 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
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 #include "remoting/host/launch_process_in_session_win.h" 5 #include "remoting/host/win/launch_process_with_token.h"
6 6
7 #include <windows.h> 7 #include <windows.h>
8 #include <winternl.h> 8 #include <winternl.h>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
11 #include "base/memory/scoped_ptr.h" 11 #include "base/memory/scoped_ptr.h"
12 #include "base/scoped_native_library.h" 12 #include "base/scoped_native_library.h"
13 #include "base/stringprintf.h" 13 #include "base/stringprintf.h"
14 #include "base/utf_string_conversions.h" 14 #include "base/utf_string_conversions.h"
15 #include "base/win/scoped_handle.h" 15 #include "base/win/scoped_handle.h"
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 } 236 }
237 237
238 *process_information_out = response.process_information; 238 *process_information_out = response.process_information;
239 return true; 239 return true;
240 } 240 }
241 241
242 } // namespace 242 } // namespace
243 243
244 namespace remoting { 244 namespace remoting {
245 245
246 // Launches |binary| in a different session. The target session is specified by 246 bool LaunchProcessWithToken(const FilePath& binary,
247 // |user_token|.
248 bool LaunchProcessInSession(const FilePath& binary,
249 const std::wstring& command_line, 247 const std::wstring& command_line,
250 HANDLE user_token, 248 HANDLE user_token,
251 base::Process* process_out) { 249 base::Process* process_out) {
252 std::wstring application_name = binary.value(); 250 std::wstring application_name = binary.value();
253 251
254 base::win::ScopedProcessInformation process_info; 252 base::win::ScopedProcessInformation process_info;
255 STARTUPINFOW startup_info; 253 STARTUPINFOW startup_info;
256 254
257 memset(&startup_info, 0, sizeof(startup_info)); 255 memset(&startup_info, 0, sizeof(startup_info));
258 startup_info.cb = sizeof(startup_info); 256 startup_info.cb = sizeof(startup_info);
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
303 "Failed to launch a process with a user token"; 301 "Failed to launch a process with a user token";
304 return false; 302 return false;
305 } 303 }
306 304
307 CHECK(process_info.IsValid()); 305 CHECK(process_info.IsValid());
308 process_out->set_handle(process_info.TakeProcessHandle()); 306 process_out->set_handle(process_info.TakeProcessHandle());
309 return true; 307 return true;
310 } 308 }
311 309
312 } // namespace remoting 310 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/host/win/launch_process_with_token.h ('k') | remoting/host/win/scoped_thread_desktop.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698