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/launch.h" | 5 #include "base/process/launch.h" |
6 | 6 |
7 #include <fcntl.h> | 7 #include <fcntl.h> |
8 #include <io.h> | 8 #include <io.h> |
9 #include <shellapi.h> | 9 #include <shellapi.h> |
10 #include <windows.h> | 10 #include <windows.h> |
(...skipping 13 matching lines...) Expand all Loading... |
24 #include "base/metrics/histogram.h" | 24 #include "base/metrics/histogram.h" |
25 #include "base/process/kill.h" | 25 #include "base/process/kill.h" |
26 #include "base/strings/utf_string_conversions.h" | 26 #include "base/strings/utf_string_conversions.h" |
27 #include "base/sys_info.h" | 27 #include "base/sys_info.h" |
28 #include "base/win/object_watcher.h" | 28 #include "base/win/object_watcher.h" |
29 #include "base/win/scoped_handle.h" | 29 #include "base/win/scoped_handle.h" |
30 #include "base/win/scoped_process_information.h" | 30 #include "base/win/scoped_process_information.h" |
31 #include "base/win/startup_information.h" | 31 #include "base/win/startup_information.h" |
32 #include "base/win/windows_version.h" | 32 #include "base/win/windows_version.h" |
33 | 33 |
34 // userenv.dll is required for CreateEnvironmentBlock(). | |
35 #pragma comment(lib, "userenv.lib") | |
36 | |
37 namespace base { | 34 namespace base { |
38 | 35 |
39 namespace { | 36 namespace { |
40 | 37 |
41 // This exit code is used by the Windows task manager when it kills a | 38 // This exit code is used by the Windows task manager when it kills a |
42 // process. It's value is obviously not that unique, and it's | 39 // process. It's value is obviously not that unique, and it's |
43 // surprising to me that the task manager uses this value, but it | 40 // surprising to me that the task manager uses this value, but it |
44 // seems to be common practice on Windows to test for it as an | 41 // seems to be common practice on Windows to test for it as an |
45 // indication that the task manager has killed something if the | 42 // indication that the task manager has killed something if the |
46 // process goes away. | 43 // process goes away. |
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
389 | 386 |
390 bool GetAppOutput(const StringPiece16& cl, std::string* output) { | 387 bool GetAppOutput(const StringPiece16& cl, std::string* output) { |
391 return GetAppOutputInternal(cl, false, output); | 388 return GetAppOutputInternal(cl, false, output); |
392 } | 389 } |
393 | 390 |
394 void RaiseProcessToHighPriority() { | 391 void RaiseProcessToHighPriority() { |
395 SetPriorityClass(GetCurrentProcess(), HIGH_PRIORITY_CLASS); | 392 SetPriorityClass(GetCurrentProcess(), HIGH_PRIORITY_CLASS); |
396 } | 393 } |
397 | 394 |
398 } // namespace base | 395 } // namespace base |
OLD | NEW |