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

Unified Diff: base/win/scoped_handle_test_dll.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_test_dll.cc
diff --git a/base/win/scoped_handle_test_dll.cc b/base/win/scoped_handle_test_dll.cc
index e6e1215d5990aab5c8b1988699f78c69300b1f19..440a4ca7658c83619baf404b5bf0d0f2d4a078c3 100644
--- a/base/win/scoped_handle_test_dll.cc
+++ b/base/win/scoped_handle_test_dll.cc
@@ -6,11 +6,9 @@
#include <vector>
+#include "base/win/current_module.h"
#include "base/win/scoped_handle.h"
-// http://blogs.msdn.com/oldnewthing/archive/2004/10/25/247180.aspx
-extern "C" IMAGE_DOS_HEADER __ImageBase;
-
namespace base {
namespace win {
namespace testing {
@@ -95,7 +93,7 @@ bool InternalRunLocationTest() {
return false;
// Get my module
- HMODULE my_module = reinterpret_cast<HMODULE>(&__ImageBase);
+ HMODULE my_module = CURRENT_MODULE();
if (!my_module)
return false;

Powered by Google App Engine
This is Rietveld 408576698