[PATCH 1/4] xinput1_1: Avoid DLL forwarding.

Józef Kucia jkucia at codeweavers.com
Wed Sep 20 12:12:04 CDT 2017


Steam gameoverlayrenderer wants to patch each xinput DLL separately.

Signed-off-by: Józef Kucia <jkucia at codeweavers.com>
---

Fixes https://bugs.winehq.org/show_bug.cgi?id=42154

Steam gameoverlayrenderer uses detour patching to hooks functions in xinput
DLLs. It seems to patch each xinput DLL in turn. When functions are forwarded
to a single DLL the patching succeeds only for the first DLL. Then, when an
xinput function is called the hook procedure returns to NULL pointer instead of
the original function address.

---
 dlls/xinput1_1/Makefile.in                         |  4 ++++
 dlls/xinput1_1/xinput1_1.spec                      | 10 +++++-----
 dlls/xinput1_3/Makefile.in                         |  2 +-
 dlls/xinput1_3/{xinput1_3_main.c => xinput_main.c} |  0
 4 files changed, 10 insertions(+), 6 deletions(-)
 rename dlls/xinput1_3/{xinput1_3_main.c => xinput_main.c} (100%)

diff --git a/dlls/xinput1_1/Makefile.in b/dlls/xinput1_1/Makefile.in
index fc341d1774..e08b999508 100644
--- a/dlls/xinput1_1/Makefile.in
+++ b/dlls/xinput1_1/Makefile.in
@@ -1,3 +1,7 @@
 MODULE    = xinput1_1.dll
+PARENTSRC = ../xinput1_3
+
+C_SRCS = \
+	xinput_main.c
 
 RC_SRCS = version.rc
diff --git a/dlls/xinput1_1/xinput1_1.spec b/dlls/xinput1_1/xinput1_1.spec
index 95759c345e..5a55370da6 100644
--- a/dlls/xinput1_1/xinput1_1.spec
+++ b/dlls/xinput1_1/xinput1_1.spec
@@ -1,5 +1,5 @@
-@ stdcall XInputEnable(long) xinput1_3.XInputEnable
-@ stdcall XInputGetCapabilities(long long ptr) xinput1_3.XInputGetCapabilities
-@ stdcall XInputGetDSoundAudioDeviceGuids(long ptr ptr) xinput1_3.XInputGetDSoundAudioDeviceGuids
-@ stdcall XInputSetState(long ptr) xinput1_3.XInputSetState
-@ stdcall XInputGetState(long ptr) xinput1_3.XInputGetState
+@ stdcall XInputEnable(long)
+@ stdcall XInputGetCapabilities(long long ptr)
+@ stdcall XInputGetDSoundAudioDeviceGuids(long ptr ptr)
+@ stdcall XInputSetState(long ptr)
+@ stdcall XInputGetState(long ptr)
diff --git a/dlls/xinput1_3/Makefile.in b/dlls/xinput1_3/Makefile.in
index cf8f730e99..0fe3f6db61 100644
--- a/dlls/xinput1_3/Makefile.in
+++ b/dlls/xinput1_3/Makefile.in
@@ -2,6 +2,6 @@ MODULE    = xinput1_3.dll
 IMPORTLIB = xinput
 
 C_SRCS = \
-	xinput1_3_main.c
+	xinput_main.c
 
 RC_SRCS = version.rc
diff --git a/dlls/xinput1_3/xinput1_3_main.c b/dlls/xinput1_3/xinput_main.c
similarity index 100%
rename from dlls/xinput1_3/xinput1_3_main.c
rename to dlls/xinput1_3/xinput_main.c
-- 
2.13.5




More information about the wine-patches mailing list