1*6777b538SAndroid Build Coastguard Worker // Copyright 2016 The Chromium Authors 2*6777b538SAndroid Build Coastguard Worker // Use of this source code is governed by a BSD-style license that can be 3*6777b538SAndroid Build Coastguard Worker // found in the LICENSE file. 4*6777b538SAndroid Build Coastguard Worker 5*6777b538SAndroid Build Coastguard Worker #ifndef BASE_WIN_CURRENT_MODULE_H_ 6*6777b538SAndroid Build Coastguard Worker #define BASE_WIN_CURRENT_MODULE_H_ 7*6777b538SAndroid Build Coastguard Worker 8*6777b538SAndroid Build Coastguard Worker #include <windows.h> 9*6777b538SAndroid Build Coastguard Worker 10*6777b538SAndroid Build Coastguard Worker // http://blogs.msdn.com/oldnewthing/archive/2004/10/25/247180.aspx 11*6777b538SAndroid Build Coastguard Worker extern "C" IMAGE_DOS_HEADER __ImageBase; 12*6777b538SAndroid Build Coastguard Worker 13*6777b538SAndroid Build Coastguard Worker // Returns the HMODULE of the dll the macro was expanded in. 14*6777b538SAndroid Build Coastguard Worker // Only use in cc files, not in h files. 15*6777b538SAndroid Build Coastguard Worker #define CURRENT_MODULE() reinterpret_cast<HMODULE>(&__ImageBase) 16*6777b538SAndroid Build Coastguard Worker 17*6777b538SAndroid Build Coastguard Worker #endif // BASE_WIN_CURRENT_MODULE_H_ 18