From ceb01c6ae03ad8fe53370df2d9001427ef0ded70 Mon Sep 17 00:00:00 2001
From: Andrew Fenn <andrewfenn@gmail.com>
Date: Sat, 25 Oct 2008 19:45:25 +0100
Subject: Started implementation of xinput controller library

---
 dlls/xinput1_1/Makefile.in          |   15 ++++++++++
 dlls/xinput1_1/version.rc           |   26 ++++++++++++++++++
 dlls/xinput1_1/xinput1_1.spec       |    5 +++
 dlls/xinput1_1/xinput1_1_main.c     |   51 +++++++++++++++++++++++++++++++++++
 dlls/xinput1_2/Makefile.in          |   15 ++++++++++
 dlls/xinput1_2/version.rc           |   26 ++++++++++++++++++
 dlls/xinput1_2/xinput1_2.spec       |    5 +++
 dlls/xinput1_2/xinput1_2_main.c     |   51 +++++++++++++++++++++++++++++++++++
 dlls/xinput1_3/Makefile.in          |   16 +++++++++++
 dlls/xinput1_3/version.rc           |   26 ++++++++++++++++++
 dlls/xinput1_3/xinput1_3.spec       |    7 +++++
 dlls/xinput1_3/xinput1_3_main.c     |   47 ++++++++++++++++++++++++++++++++
 dlls/xinput9_1_0/Makefile.in        |   15 ++++++++++
 dlls/xinput9_1_0/version.rc         |   26 ++++++++++++++++++
 dlls/xinput9_1_0/xinput9_1_0.spec   |    4 +++
 dlls/xinput9_1_0/xinput9_1_0_main.c |   51 +++++++++++++++++++++++++++++++++++
 16 files changed, 386 insertions(+), 0 deletions(-)
 create mode 100644 dlls/xinput1_1/Makefile.in
 create mode 100644 dlls/xinput1_1/version.rc
 create mode 100644 dlls/xinput1_1/xinput1_1.spec
 create mode 100644 dlls/xinput1_1/xinput1_1_main.c
 create mode 100644 dlls/xinput1_2/Makefile.in
 create mode 100644 dlls/xinput1_2/version.rc
 create mode 100644 dlls/xinput1_2/xinput1_2.spec
 create mode 100644 dlls/xinput1_2/xinput1_2_main.c
 create mode 100644 dlls/xinput1_3/Makefile.in
 create mode 100644 dlls/xinput1_3/version.rc
 create mode 100644 dlls/xinput1_3/xinput1_3.spec
 create mode 100644 dlls/xinput1_3/xinput1_3_main.c
 create mode 100644 dlls/xinput9_1_0/Makefile.in
 create mode 100644 dlls/xinput9_1_0/version.rc
 create mode 100644 dlls/xinput9_1_0/xinput9_1_0.spec
 create mode 100644 dlls/xinput9_1_0/xinput9_1_0_main.c

diff --git a/dlls/xinput1_1/Makefile.in b/dlls/xinput1_1/Makefile.in
new file mode 100644
index 0000000..04670f5
--- /dev/null
+++ b/dlls/xinput1_1/Makefile.in
@@ -0,0 +1,15 @@
+TOPSRCDIR = @top_srcdir@
+TOPOBJDIR = ../..
+SRCDIR    = @srcdir@
+VPATH     = @srcdir@
+MODULE    = xinput1_1.dll
+IMPORTS   = kernel32
+
+C_SRCS = \
+	xinput1_1_main.c
+
+RC_SRCS = version.rc
+
+@MAKE_DLL_RULES@
+
+@DEPENDENCIES@  # everything below this line is overwritten by make depend
diff --git a/dlls/xinput1_1/version.rc b/dlls/xinput1_1/version.rc
new file mode 100644
index 0000000..e0a7fe8
--- /dev/null
+++ b/dlls/xinput1_1/version.rc
@@ -0,0 +1,26 @@
+/*
+ * Copyright 2008 Andrew Fenn
+ *
+ * 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
+ */
+
+#define WINE_FILEDESCRIPTION_STR "Wine Common Controller API"
+#define WINE_FILENAME_STR "xinput1_1.dll"
+#define WINE_FILEVERSION 9,12,589,0000
+#define WINE_FILEVERSION_STR "9.12.589.0000"
+#define WINE_PRODUCTVERSION 9,12,589,0000
+#define WINE_PRODUCTVERSION_STR "9.12"
+
+#include "wine/wine_common_ver.rc"
diff --git a/dlls/xinput1_1/xinput1_1.spec b/dlls/xinput1_1/xinput1_1.spec
new file mode 100644
index 0000000..95759c3
--- /dev/null
+++ b/dlls/xinput1_1/xinput1_1.spec
@@ -0,0 +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
diff --git a/dlls/xinput1_1/xinput1_1_main.c b/dlls/xinput1_1/xinput1_1_main.c
new file mode 100644
index 0000000..508e7cb
--- /dev/null
+++ b/dlls/xinput1_1/xinput1_1_main.c
@@ -0,0 +1,51 @@
+/*
+ * Xinput - Xbox 360 Controller Library
+ *
+ * Copyright (C) 2008 Andrew Fenn
+ *
+ * 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 "wine/port.h"
+
+#include <stdarg.h>
+
+#include "windef.h"
+#include "winbase.h"
+#include "wingdi.h"
+#include "winuser.h"
+#include "wine/debug.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(xinput);
+
+/***********************************************************************
+ * DllMain.
+ */
+BOOL WINAPI DllMain(HINSTANCE inst, DWORD reason, LPVOID reserved)
+{
+    switch(reason)
+    {
+    case DLL_WINE_PREATTACH:
+        return FALSE; /* prefer native version */
+    case DLL_PROCESS_ATTACH:
+        DisableThreadLibraryCalls(inst);
+        break;
+    case DLL_PROCESS_DETACH:
+        break;
+    }
+    return TRUE;
+}
diff --git a/dlls/xinput1_2/Makefile.in b/dlls/xinput1_2/Makefile.in
new file mode 100644
index 0000000..f8934f4
--- /dev/null
+++ b/dlls/xinput1_2/Makefile.in
@@ -0,0 +1,15 @@
+TOPSRCDIR = @top_srcdir@
+TOPOBJDIR = ../..
+SRCDIR    = @srcdir@
+VPATH     = @srcdir@
+MODULE    = xinput1_2.dll
+IMPORTS   = kernel32
+
+C_SRCS = \
+	xinput1_2_main.c
+
+RC_SRCS = version.rc
+
+@MAKE_DLL_RULES@
+
+@DEPENDENCIES@  # everything below this line is overwritten by make depend
diff --git a/dlls/xinput1_2/version.rc b/dlls/xinput1_2/version.rc
new file mode 100644
index 0000000..79baf35
--- /dev/null
+++ b/dlls/xinput1_2/version.rc
@@ -0,0 +1,26 @@
+/*
+ * Copyright 2008 Andrew Fenn
+ *
+ * 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
+ */
+
+#define WINE_FILEDESCRIPTION_STR "Wine Common Controller API"
+#define WINE_FILENAME_STR "xinput1_2.dll"
+#define WINE_FILEVERSION 9,14,701,0000
+#define WINE_FILEVERSION_STR "9.14.701.0000"
+#define WINE_PRODUCTVERSION 9,14,701,0000
+#define WINE_PRODUCTVERSION_STR "9.14"
+
+#include "wine/wine_common_ver.rc"
diff --git a/dlls/xinput1_2/xinput1_2.spec b/dlls/xinput1_2/xinput1_2.spec
new file mode 100644
index 0000000..95759c3
--- /dev/null
+++ b/dlls/xinput1_2/xinput1_2.spec
@@ -0,0 +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
diff --git a/dlls/xinput1_2/xinput1_2_main.c b/dlls/xinput1_2/xinput1_2_main.c
new file mode 100644
index 0000000..508e7cb
--- /dev/null
+++ b/dlls/xinput1_2/xinput1_2_main.c
@@ -0,0 +1,51 @@
+/*
+ * Xinput - Xbox 360 Controller Library
+ *
+ * Copyright (C) 2008 Andrew Fenn
+ *
+ * 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 "wine/port.h"
+
+#include <stdarg.h>
+
+#include "windef.h"
+#include "winbase.h"
+#include "wingdi.h"
+#include "winuser.h"
+#include "wine/debug.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(xinput);
+
+/***********************************************************************
+ * DllMain.
+ */
+BOOL WINAPI DllMain(HINSTANCE inst, DWORD reason, LPVOID reserved)
+{
+    switch(reason)
+    {
+    case DLL_WINE_PREATTACH:
+        return FALSE; /* prefer native version */
+    case DLL_PROCESS_ATTACH:
+        DisableThreadLibraryCalls(inst);
+        break;
+    case DLL_PROCESS_DETACH:
+        break;
+    }
+    return TRUE;
+}
diff --git a/dlls/xinput1_3/Makefile.in b/dlls/xinput1_3/Makefile.in
new file mode 100644
index 0000000..3587ac4
--- /dev/null
+++ b/dlls/xinput1_3/Makefile.in
@@ -0,0 +1,16 @@
+TOPSRCDIR = @top_srcdir@
+TOPOBJDIR = ../..
+SRCDIR    = @srcdir@
+VPATH     = @srcdir@
+MODULE    = xinput1_3.dll
+IMPORTLIB = xinput1_3
+IMPORTS   = kernel32
+
+C_SRCS =	\
+   xinput1_3_main.c
+
+RC_SRCS = version.rc
+
+@MAKE_DLL_RULES@
+
+@DEPENDENCIES@  # everything below this line is overwritten by make depend
diff --git a/dlls/xinput1_3/version.rc b/dlls/xinput1_3/version.rc
new file mode 100644
index 0000000..34b1ca0
--- /dev/null
+++ b/dlls/xinput1_3/version.rc
@@ -0,0 +1,26 @@
+/*
+ * Copyright 2008 Andrew Fenn
+ *
+ * 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
+ */
+
+#define WINE_FILEDESCRIPTION_STR "Wine Common Controller API"
+#define WINE_FILENAME_STR "xinput1_3.dll"
+#define WINE_FILEVERSION 9,15,779,0000
+#define WINE_FILEVERSION_STR "9.15.779.0000"
+#define WINE_PRODUCTVERSION 9,15,779,0000
+#define WINE_PRODUCTVERSION_STR "9.15"
+
+#include "wine/wine_common_ver.rc"
diff --git a/dlls/xinput1_3/xinput1_3.spec b/dlls/xinput1_3/xinput1_3.spec
new file mode 100644
index 0000000..5caaa37
--- /dev/null
+++ b/dlls/xinput1_3/xinput1_3.spec
@@ -0,0 +1,7 @@
+@ stub XInputEnable #(long)
+@ stub XInputSetState #(long ptr)
+@ stub XInputGetState #(long ptr)
+@ stub XInputGetKeystroke #(long long ptr)
+@ stub XInputGetCapabilities #(long long ptr)
+@ stub XInputGetDSoundAudioDeviceGuids #(long ptr ptr)
+@ stub XInputGetBatteryInformation
diff --git a/dlls/xinput1_3/xinput1_3_main.c b/dlls/xinput1_3/xinput1_3_main.c
new file mode 100644
index 0000000..1a41256
--- /dev/null
+++ b/dlls/xinput1_3/xinput1_3_main.c
@@ -0,0 +1,47 @@
+/* XInput - Controller Support Library
+ *
+ * Copyright 2008 Andrew Fenn
+ *
+ * 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 <assert.h>
+#include <stdarg.h>
+#include <string.h>
+
+#define COBJMACROS
+
+#include "wine/debug.h"
+#include "windef.h"
+#include "winbase.h"
+#include "winerror.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(xinput);
+
+BOOL WINAPI DllMain(HINSTANCE inst, DWORD reason, LPVOID reserved)
+{
+    switch(reason)
+    {
+    case DLL_WINE_PREATTACH:
+        return FALSE; /* prefer native version */
+    case DLL_PROCESS_ATTACH:
+        DisableThreadLibraryCalls(inst);
+        break;
+    case DLL_PROCESS_DETACH:
+        break;
+    }
+    return TRUE;
+}
diff --git a/dlls/xinput9_1_0/Makefile.in b/dlls/xinput9_1_0/Makefile.in
new file mode 100644
index 0000000..f63d2c1
--- /dev/null
+++ b/dlls/xinput9_1_0/Makefile.in
@@ -0,0 +1,15 @@
+TOPSRCDIR = @top_srcdir@
+TOPOBJDIR = ../..
+SRCDIR    = @srcdir@
+VPATH     = @srcdir@
+MODULE    = xinput9_1_0.dll
+IMPORTS   = kernel32
+
+C_SRCS = \
+	xinput9_1_0_main.c
+
+RC_SRCS = version.rc
+
+@MAKE_DLL_RULES@
+
+@DEPENDENCIES@  # everything below this line is overwritten by make depend
diff --git a/dlls/xinput9_1_0/version.rc b/dlls/xinput9_1_0/version.rc
new file mode 100644
index 0000000..3166157
--- /dev/null
+++ b/dlls/xinput9_1_0/version.rc
@@ -0,0 +1,26 @@
+/*
+ * Copyright 2008 Andrew Fenn
+ *
+ * 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
+ */
+
+#define WINE_FILEDESCRIPTION_STR "Wine Common Controller API"
+#define WINE_FILENAME_STR "xinput9_1_0.dll"
+#define WINE_FILEVERSION 9,10,455,0000
+#define WINE_FILEVERSION_STR "9.10.455.0000"
+#define WINE_PRODUCTVERSION 9,10,455,0000
+#define WINE_PRODUCTVERSION_STR "9.10"
+
+#include "wine/wine_common_ver.rc"
diff --git a/dlls/xinput9_1_0/xinput9_1_0.spec b/dlls/xinput9_1_0/xinput9_1_0.spec
new file mode 100644
index 0000000..5d95b3e
--- /dev/null
+++ b/dlls/xinput9_1_0/xinput9_1_0.spec
@@ -0,0 +1,4 @@
+@ 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
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..508e7cb
--- /dev/null
+++ b/dlls/xinput9_1_0/xinput9_1_0_main.c
@@ -0,0 +1,51 @@
+/*
+ * Xinput - Xbox 360 Controller Library
+ *
+ * Copyright (C) 2008 Andrew Fenn
+ *
+ * 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 "wine/port.h"
+
+#include <stdarg.h>
+
+#include "windef.h"
+#include "winbase.h"
+#include "wingdi.h"
+#include "winuser.h"
+#include "wine/debug.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(xinput);
+
+/***********************************************************************
+ * DllMain.
+ */
+BOOL WINAPI DllMain(HINSTANCE inst, DWORD reason, LPVOID reserved)
+{
+    switch(reason)
+    {
+    case DLL_WINE_PREATTACH:
+        return FALSE; /* prefer native version */
+    case DLL_PROCESS_ATTACH:
+        DisableThreadLibraryCalls(inst);
+        break;
+    case DLL_PROCESS_DETACH:
+        break;
+    }
+    return TRUE;
+}
-- 
1.5.4.3

