| 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 #include "base/process_util.h" | 5 #include "base/process_util.h" |
| 6 | 6 |
| 7 #include <fcntl.h> | 7 #include <fcntl.h> |
| 8 #include <io.h> | 8 #include <io.h> |
| 9 #include <windows.h> | 9 #include <windows.h> |
| 10 #include <userenv.h> | 10 #include <userenv.h> |
| (...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 310 | 310 |
| 311 if (options.job_handle) { | 311 if (options.job_handle) { |
| 312 flags |= CREATE_SUSPENDED; | 312 flags |= CREATE_SUSPENDED; |
| 313 | 313 |
| 314 // If this code is run under a debugger, the launched process is | 314 // If this code is run under a debugger, the launched process is |
| 315 // automatically associated with a job object created by the debugger. | 315 // automatically associated with a job object created by the debugger. |
| 316 // The CREATE_BREAKAWAY_FROM_JOB flag is used to prevent this. | 316 // The CREATE_BREAKAWAY_FROM_JOB flag is used to prevent this. |
| 317 flags |= CREATE_BREAKAWAY_FROM_JOB; | 317 flags |= CREATE_BREAKAWAY_FROM_JOB; |
| 318 } | 318 } |
| 319 | 319 |
| 320 if (options.force_breakaway_from_job_) |
| 321 flags |= CREATE_BREAKAWAY_FROM_JOB; |
| 322 |
| 320 base::win::ScopedProcessInformation process_info; | 323 base::win::ScopedProcessInformation process_info; |
| 321 | 324 |
| 322 if (options.as_user) { | 325 if (options.as_user) { |
| 323 flags |= CREATE_UNICODE_ENVIRONMENT; | 326 flags |= CREATE_UNICODE_ENVIRONMENT; |
| 324 void* enviroment_block = NULL; | 327 void* enviroment_block = NULL; |
| 325 | 328 |
| 326 if (!CreateEnvironmentBlock(&enviroment_block, options.as_user, FALSE)) | 329 if (!CreateEnvironmentBlock(&enviroment_block, options.as_user, FALSE)) |
| 327 return false; | 330 return false; |
| 328 | 331 |
| 329 BOOL launched = | 332 BOOL launched = |
| (...skipping 662 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 992 | 995 |
| 993 PERFORMANCE_INFORMATION info; | 996 PERFORMANCE_INFORMATION info; |
| 994 if (!InternalGetPerformanceInfo(&info, sizeof(info))) { | 997 if (!InternalGetPerformanceInfo(&info, sizeof(info))) { |
| 995 DLOG(ERROR) << "Failed to fetch internal performance info."; | 998 DLOG(ERROR) << "Failed to fetch internal performance info."; |
| 996 return 0; | 999 return 0; |
| 997 } | 1000 } |
| 998 return (info.CommitTotal * system_info.dwPageSize) / 1024; | 1001 return (info.CommitTotal * system_info.dwPageSize) / 1024; |
| 999 } | 1002 } |
| 1000 | 1003 |
| 1001 } // namespace base | 1004 } // namespace base |
| OLD | NEW |