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

Unified Diff: base/win/scoped_handle.cc

Issue 1852143002: win: Remove GetModuleFromAddress, deduplicate __ImageBase code. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 9 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/win/scoped_handle.cc
diff --git a/base/win/scoped_handle.cc b/base/win/scoped_handle.cc
index 7fa8b4380913d4aed8e0b927fb8c0a3d2d82c22d..cce16281ae41200776cafa73efbf8a59c2cb8f84 100644
--- a/base/win/scoped_handle.cc
+++ b/base/win/scoped_handle.cc
@@ -16,15 +16,13 @@
#include "base/macros.h"
#include "base/synchronization/lock_impl.h"
#include "base/threading/thread_local.h"
+#include "base/win/current_module.h"
extern "C" {
__declspec(dllexport) void* GetHandleVerifier();
typedef void* (*GetHandleVerifierFn)();
}
-// http://blogs.msdn.com/oldnewthing/archive/2004/10/25/247180.aspx
-extern "C" IMAGE_DOS_HEADER __ImageBase;
-
namespace {
struct HandleHash {
@@ -247,7 +245,7 @@ void ActiveVerifier::OnHandleBeingClosed(HANDLE handle) {
}
HMODULE ActiveVerifier::GetModule() const {
- return reinterpret_cast<HMODULE>(&__ImageBase);
+ return CURRENT_MODULE();
}
} // namespace

Powered by Google App Engine
This is Rietveld 408576698