From 52eff43d3a855090a15a7104a878aebe7b2eb3b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Sat, 12 Sep 2009 14:08:53 +0200 Subject: [PATCH 01/25] Check for ms_hook_prologue attribute support, make a first function hookable --- configure.ac | 19 +++++++++++++++++++ dlls/dinput8/dinput8_main.c | 2 +- 2 files changed, 20 insertions(+), 1 deletions(-) diff --git a/configure.ac b/configure.ac index 813b198..83eef9d 100644 --- a/configure.ac +++ b/configure.ac @@ -2052,6 +2052,25 @@ case $host_vendor in *sun*) WINE_CHECK_DEFINE([__sun__]) ;; esac +dnl Check for ms_hook_prologue support +old_CFLAGS="$CFLAGS" +CFLAGS="$CFLAGS -Werror" +AC_CACHE_CHECK([for ms_hook_prologue], ac_cv_have_ms_hook_prologue, + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ + int __attribute__((__ms_hook_prologue__)) test() + { + return 0; + } + ]], [[/*empty*/]])],[ac_cv_have_ms_hook_prologue="yes"],[ac_cv_have_ms_hook_prologue="no"])) +CFLAGS="$old_CFLAGS" + +if test "$ac_cv_have_ms_hook_prologue" = "yes" +then + AC_DEFINE(DECLSPEC_HOTPATCH, __attribute__((__ms_hook_prologue__)), ["Define to __attribute__((__ms_hook_prologue__)) if supported"]) +else + AC_DEFINE(DECLSPEC_HOTPATCH,, ["Define to __attribute__((__ms_hook_prologue__)) if supported"]) +fi + dnl **** Generate output files **** AC_SUBST(DEPENDENCIES,["### Dependencies: diff --git a/dlls/dinput8/dinput8_main.c b/dlls/dinput8/dinput8_main.c index c855caf..77f7f64 100644 --- a/dlls/dinput8/dinput8_main.c +++ b/dlls/dinput8/dinput8_main.c @@ -50,7 +50,7 @@ static void UnlockModule(void) /****************************************************************************** * DirectInput8Create (DINPUT8.@) */ -HRESULT WINAPI DirectInput8Create(HINSTANCE hinst, DWORD dwVersion, REFIID riid, LPVOID *ppDI, LPUNKNOWN punkOuter) { +HRESULT WINAPI DECLSPEC_HOTPATCH DirectInput8Create(HINSTANCE hinst, DWORD dwVersion, REFIID riid, LPVOID *ppDI, LPUNKNOWN punkOuter) { HRESULT hr; TRACE("hInst (%p), dwVersion: %d, riid (%s), punkOuter (%p))\n", hinst, dwVersion, debugstr_guid(riid), punkOuter); -- 1.6.4.4