| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 #ifndef BASE_PROCESS_PROCESS_HANDLE_H_ | 5 #ifndef BASE_PROCESS_PROCESS_HANDLE_H_ |
| 6 #define BASE_PROCESS_PROCESS_HANDLE_H_ | 6 #define BASE_PROCESS_PROCESS_HANDLE_H_ |
| 7 | 7 |
| 8 #include "base/base_export.h" | 8 #include "base/base_export.h" |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 const ProcessHandle kNullProcessHandle = 0; | 33 const ProcessHandle kNullProcessHandle = 0; |
| 34 const ProcessId kNullProcessId = 0; | 34 const ProcessId kNullProcessId = 0; |
| 35 #endif // defined(OS_WIN) | 35 #endif // defined(OS_WIN) |
| 36 | 36 |
| 37 // Returns the id of the current process. | 37 // Returns the id of the current process. |
| 38 BASE_EXPORT ProcessId GetCurrentProcId(); | 38 BASE_EXPORT ProcessId GetCurrentProcId(); |
| 39 | 39 |
| 40 // Returns the ProcessHandle of the current process. | 40 // Returns the ProcessHandle of the current process. |
| 41 BASE_EXPORT ProcessHandle GetCurrentProcessHandle(); | 41 BASE_EXPORT ProcessHandle GetCurrentProcessHandle(); |
| 42 | 42 |
| 43 | |
| 44 | |
| 45 // Closes the process handle opened by OpenProcessHandle. | |
| 46 BASE_EXPORT void CloseProcessHandle(ProcessHandle process); | |
| 47 | |
| 48 // Returns the unique ID for the specified process. This is functionally the | 43 // Returns the unique ID for the specified process. This is functionally the |
| 49 // same as Windows' GetProcessId(), but works on versions of Windows before | 44 // same as Windows' GetProcessId(), but works on versions of Windows before |
| 50 // Win XP SP1 as well. | 45 // Win XP SP1 as well. |
| 46 // DEPRECATED. New code should be using Process::Pid() instead. |
| 51 BASE_EXPORT ProcessId GetProcId(ProcessHandle process); | 47 BASE_EXPORT ProcessId GetProcId(ProcessHandle process); |
| 52 | 48 |
| 53 #if defined(OS_WIN) | |
| 54 enum IntegrityLevel { | |
| 55 INTEGRITY_UNKNOWN, | |
| 56 LOW_INTEGRITY, | |
| 57 MEDIUM_INTEGRITY, | |
| 58 HIGH_INTEGRITY, | |
| 59 }; | |
| 60 // Determine the integrity level of the specified process. Returns false | |
| 61 // if the system does not support integrity levels (pre-Vista) or in the case | |
| 62 // of an underlying system failure. | |
| 63 BASE_EXPORT bool GetProcessIntegrityLevel(ProcessHandle process, | |
| 64 IntegrityLevel* level); | |
| 65 #endif | |
| 66 | |
| 67 #if defined(OS_POSIX) | 49 #if defined(OS_POSIX) |
| 68 // Returns the path to the executable of the given process. | 50 // Returns the path to the executable of the given process. |
| 69 BASE_EXPORT FilePath GetProcessExecutablePath(ProcessHandle process); | 51 BASE_EXPORT FilePath GetProcessExecutablePath(ProcessHandle process); |
| 70 | 52 |
| 71 // Returns the ID for the parent of the given process. | 53 // Returns the ID for the parent of the given process. |
| 72 BASE_EXPORT ProcessId GetParentProcessId(ProcessHandle process); | 54 BASE_EXPORT ProcessId GetParentProcessId(ProcessHandle process); |
| 73 #endif | 55 #endif |
| 74 | 56 |
| 75 } // namespace base | 57 } // namespace base |
| 76 | 58 |
| 77 #endif // BASE_PROCESS_PROCESS_HANDLE_H_ | 59 #endif // BASE_PROCESS_PROCESS_HANDLE_H_ |
| OLD | NEW |