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 // This file/namespace contains utility functions for enumerating, ending and | 5 // This file/namespace contains utility functions for enumerating, ending and |
6 // computing statistics of processes. | 6 // computing statistics of processes. |
7 | 7 |
8 #ifndef BASE_PROCESS_UTIL_H_ | 8 #ifndef BASE_PROCESS_UTIL_H_ |
9 #define BASE_PROCESS_UTIL_H_ | 9 #define BASE_PROCESS_UTIL_H_ |
10 #pragma once | 10 #pragma once |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 TERMINATION_STATUS_STILL_RUNNING, // child hasn't exited yet | 133 TERMINATION_STATUS_STILL_RUNNING, // child hasn't exited yet |
134 TERMINATION_STATUS_MAX_ENUM | 134 TERMINATION_STATUS_MAX_ENUM |
135 }; | 135 }; |
136 | 136 |
137 // Returns the id of the current process. | 137 // Returns the id of the current process. |
138 BASE_EXPORT ProcessId GetCurrentProcId(); | 138 BASE_EXPORT ProcessId GetCurrentProcId(); |
139 | 139 |
140 // Returns the ProcessHandle of the current process. | 140 // Returns the ProcessHandle of the current process. |
141 BASE_EXPORT ProcessHandle GetCurrentProcessHandle(); | 141 BASE_EXPORT ProcessHandle GetCurrentProcessHandle(); |
142 | 142 |
| 143 #if defined(OS_WIN) |
| 144 // Returns the module handle to which an address belongs. |
| 145 BASE_EXPORT HMODULE GetModuleFromAddress(void* address); |
| 146 #endif |
| 147 |
143 // Converts a PID to a process handle. This handle must be closed by | 148 // Converts a PID to a process handle. This handle must be closed by |
144 // CloseProcessHandle when you are done with it. Returns true on success. | 149 // CloseProcessHandle when you are done with it. Returns true on success. |
145 BASE_EXPORT bool OpenProcessHandle(ProcessId pid, ProcessHandle* handle); | 150 BASE_EXPORT bool OpenProcessHandle(ProcessId pid, ProcessHandle* handle); |
146 | 151 |
147 // Converts a PID to a process handle. On Windows the handle is opened | 152 // Converts a PID to a process handle. On Windows the handle is opened |
148 // with more access rights and must only be used by trusted code. | 153 // with more access rights and must only be used by trusted code. |
149 // You have to close returned handle using CloseProcessHandle. Returns true | 154 // You have to close returned handle using CloseProcessHandle. Returns true |
150 // on success. | 155 // on success. |
151 // TODO(sanjeevr): Replace all calls to OpenPrivilegedProcessHandle with the | 156 // TODO(sanjeevr): Replace all calls to OpenPrivilegedProcessHandle with the |
152 // more specific OpenProcessHandleWithAccess method and delete this. | 157 // more specific OpenProcessHandleWithAccess method and delete this. |
(...skipping 670 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
823 // instance running inside the parent. The parent's Breakpad instance should | 828 // instance running inside the parent. The parent's Breakpad instance should |
824 // not handle the child's exceptions. Calling RestoreDefaultExceptionHandler | 829 // not handle the child's exceptions. Calling RestoreDefaultExceptionHandler |
825 // in the child after forking will restore the standard exception handler. | 830 // in the child after forking will restore the standard exception handler. |
826 // See http://crbug.com/20371/ for more details. | 831 // See http://crbug.com/20371/ for more details. |
827 void RestoreDefaultExceptionHandler(); | 832 void RestoreDefaultExceptionHandler(); |
828 #endif // defined(OS_MACOSX) | 833 #endif // defined(OS_MACOSX) |
829 | 834 |
830 } // namespace base | 835 } // namespace base |
831 | 836 |
832 #endif // BASE_PROCESS_UTIL_H_ | 837 #endif // BASE_PROCESS_UTIL_H_ |
OLD | NEW |