[PATCH] xinput9_1_0: Add DllMain.

Andrey Gusev andrey.goosev at gmail.com
Mon Jun 26 11:42:01 CDT 2017


Signed-off-by: Andrey Gusev <andrey.goosev at gmail.com>
---
 dlls/xinput9_1_0/Makefile.in        |  3 +++
 dlls/xinput9_1_0/xinput9_1_0.spec   |  1 +
 dlls/xinput9_1_0/xinput9_1_0_main.c | 42 +++++++++++++++++++++++++++++++++++++
 3 files changed, 46 insertions(+)
 create mode 100644 dlls/xinput9_1_0/xinput9_1_0_main.c

diff --git a/dlls/xinput9_1_0/Makefile.in b/dlls/xinput9_1_0/Makefile.in
index 0c4b7e7..df8a574 100644
--- a/dlls/xinput9_1_0/Makefile.in
+++ b/dlls/xinput9_1_0/Makefile.in
@@ -1,3 +1,6 @@
 MODULE    = xinput9_1_0.dll
 
+C_SRCS = \
+	xinput9_1_0_main.c
+
 RC_SRCS = version.rc
diff --git a/dlls/xinput9_1_0/xinput9_1_0.spec b/dlls/xinput9_1_0/xinput9_1_0.spec
index 5d95b3e..f9d67e5 100644
--- a/dlls/xinput9_1_0/xinput9_1_0.spec
+++ b/dlls/xinput9_1_0/xinput9_1_0.spec
@@ -1,3 +1,4 @@
+@ stdcall -private DllMain(long long ptr)
 @ stdcall XInputGetCapabilities(long long ptr) xinput1_3.XInputGetCapabilities
 @ stdcall XInputGetDSoundAudioDeviceGuids(long ptr ptr) xinput1_3.XInputGetDSoundAudioDeviceGuids
 @ stdcall XInputSetState(long ptr) xinput1_3.XInputSetState
diff --git a/dlls/xinput9_1_0/xinput9_1_0_main.c b/dlls/xinput9_1_0/xinput9_1_0_main.c
new file mode 100644
index 0000000..ec595bf
--- /dev/null
+++ b/dlls/xinput9_1_0/xinput9_1_0_main.c
@@ -0,0 +1,42 @@
+/*
+ * Copyright 2017 Andrey Gusev
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#include "config.h"
+
+#include <stdarg.h>
+
+#include "windef.h"
+#include "winbase.h"
+#include "wine/debug.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(xinput);
+
+BOOL WINAPI DllMain(HINSTANCE inst, DWORD reason, LPVOID reserved)
+{
+    TRACE("(%p, %d, %p)\n", inst, reason, reserved);
+
+    switch (reason)
+    {
+    case DLL_WINE_PREATTACH:
+        return FALSE;  /* prefer native version */
+    case DLL_PROCESS_ATTACH:
+        DisableThreadLibraryCalls(inst);
+        break;
+    }
+    return TRUE;
+}
-- 
2.7.5




More information about the wine-patches mailing list