Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(935)

Unified Diff: base/process_util_win.cc

Issue 9121046: Cleanup in ProcessSingleton. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698