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

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

Issue 13642007: Rewrite scoped_array<T> to scoped_ptr<T[]> in remoting/, Linux edition. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Manually rewrite Win files. Created 7 years, 8 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
« no previous file with comments | « remoting/host/win/elevated_controller.cc ('k') | remoting/protocol/message_decoder_unittest.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 #include "remoting/host/win/launch_process_with_token.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 <limits> 10 #include <limits>
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after
320 }; 320 };
321 321
322 string16 desktop; 322 string16 desktop;
323 if (desktop_name) 323 if (desktop_name)
324 desktop = desktop_name; 324 desktop = desktop_name;
325 325
326 // Allocate a large enough buffer to hold the CreateProcessRequest structure 326 // Allocate a large enough buffer to hold the CreateProcessRequest structure
327 // and three NULL-terminated string parameters. 327 // and three NULL-terminated string parameters.
328 size_t size = sizeof(CreateProcessRequest) + sizeof(wchar_t) * 328 size_t size = sizeof(CreateProcessRequest) + sizeof(wchar_t) *
329 (application_name.size() + command_line.size() + desktop.size() + 3); 329 (application_name.size() + command_line.size() + desktop.size() + 3);
330 scoped_array<char> buffer(new char[size]); 330 scoped_ptr<char[]> buffer(new char[size]);
331 memset(buffer.get(), 0, size); 331 memset(buffer.get(), 0, size);
332 332
333 // Marshal the input parameters. 333 // Marshal the input parameters.
334 CreateProcessRequest* request = 334 CreateProcessRequest* request =
335 reinterpret_cast<CreateProcessRequest*>(buffer.get()); 335 reinterpret_cast<CreateProcessRequest*>(buffer.get());
336 request->size = size; 336 request->size = size;
337 request->process_id = GetCurrentProcessId(); 337 request->process_id = GetCurrentProcessId();
338 request->use_default_token = TRUE; 338 request->use_default_token = TRUE;
339 // Always pass CREATE_SUSPENDED to avoid a race between the created process 339 // Always pass CREATE_SUSPENDED to avoid a race between the created process
340 // exiting too soon and OpenProcess() call below. 340 // exiting too soon and OpenProcess() call below.
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after
619 return false; 619 return false;
620 } 620 }
621 621
622 CHECK(process_info.IsValid()); 622 CHECK(process_info.IsValid());
623 process_out->Set(process_info.TakeProcessHandle()); 623 process_out->Set(process_info.TakeProcessHandle());
624 thread_out->Set(process_info.TakeThreadHandle()); 624 thread_out->Set(process_info.TakeThreadHandle());
625 return true; 625 return true;
626 } 626 }
627 627
628 } // namespace remoting 628 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/host/win/elevated_controller.cc ('k') | remoting/protocol/message_decoder_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698