Chromium Code Reviews| Index: base/process_util_win.cc |
| diff --git a/base/process_util_win.cc b/base/process_util_win.cc |
| index ae5ee6a8d0be11304d411305c040fe6bd0925dbb..b2fcf8b0d89332008b4792c6b9e6bff4287505d3 100644 |
| --- a/base/process_util_win.cc |
| +++ b/base/process_util_win.cc |
| @@ -174,6 +174,12 @@ ProcessHandle GetCurrentProcessHandle() { |
| return ::GetCurrentProcess(); |
| } |
| +HMODULE GetModuleFromAddress(void* address) { |
| + MEMORY_BASIC_INFORMATION info = {0}; |
|
Evan Martin
2012/01/27 16:17:41
FWIW, you can do
MEMORY_BASIC_INFORMATION info =
Jói
2012/02/10 09:11:57
Cool, nice tip :)
|
| + ::VirtualQuery(address, &info, sizeof(info)); |
|
Evan Martin
2012/01/27 16:17:41
Shouldn't we be checking the return value? What i
Jói
2012/02/10 09:11:57
It is now checked, for the new API that Robert sug
|
| + return reinterpret_cast<HMODULE>(info.AllocationBase); |
|
robertshield
2012/01/27 16:26:45
I know you took this from CF, so I almost feel bad
cpu_(ooo_6.6-7.5)
2012/01/27 19:31:50
Yes please use Robert's method.
On 2012/01/27 16:
|
| +} |
| + |
| bool OpenProcessHandle(ProcessId pid, ProcessHandle* handle) { |
| // We try to limit privileges granted to the handle. If you need this |
| // for test code, consider using OpenPrivilegedProcessHandle instead of |