1 //===-- interception_linux.h ------------------------------------*- C++ -*-===// 2 // 3 // The LLVM Compiler Infrastructure 4 // 5 // This file is distributed under the University of Illinois Open Source 6 // License. See LICENSE.TXT for details. 7 // 8 //===----------------------------------------------------------------------===// 9 // 10 // This file is a part of AddressSanitizer, an address sanity checker. 11 // 12 // Windows-specific interception methods. 13 //===----------------------------------------------------------------------===// 14 15 #ifdef _WIN32 16 17 #if !defined(INCLUDED_FROM_INTERCEPTION_LIB) 18 # error "interception_win.h should be included from interception library only" 19 #endif 20 21 #ifndef INTERCEPTION_WIN_H 22 #define INTERCEPTION_WIN_H 23 24 namespace __interception { 25 26 // returns true if the old function existed, false on failure. 27 bool OverrideFunction(uptr old_func, uptr new_func, uptr *orig_old_func); 28 } // namespace __interception 29 30 #if defined(_DLL) 31 # error Not implemented yet 32 #else 33 # define INTERCEPT_FUNCTION_WIN(func) \ 34 ::__interception::OverrideFunction( \ 35 (::__interception::uptr)func, \ 36 (::__interception::uptr)WRAP(func), \ 37 (::__interception::uptr*)&REAL(func)) 38 #endif 39 40 #define INTERCEPT_FUNCTION_VER_WIN(func, symver) \ 41 INTERCEPT_FUNCTION_WIN(func) 42 43 #endif // INTERCEPTION_WIN_H 44 #endif // _WIN32 45