Skip to content
This repository has been archived by the owner on Apr 25, 2020. It is now read-only.

Commit

Permalink
add builtin-hack
Browse files Browse the repository at this point in the history
  • Loading branch information
KoKuToru committed Mar 6, 2016
1 parent db3dfc6 commit 4717eab
Show file tree
Hide file tree
Showing 25 changed files with 669 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ Hacks
Some applications need additional help to detect your game controller

* [`CoSetProxyBlanket`-Hack](hack/CoSetProxyBlanket/README.md)
* [`builtinDll`-Hack](hack/builtinDll/README.md)

Config
---------------------
Expand Down
22 changes: 22 additions & 0 deletions hack/builtinDll/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
`builtin`-Hack
=========

*adds Ordinal 100 function to wine builtindll*

Applications that use SDL2 need this, or it wont use XInput...

Build
---------
```
bash build.sh
```

Needs `libwine`..

Usage
---------
Copy the files from `bin` into your wine-prefix, replacing the original files

Alternative-Usage
---------
Remove the `.so`-part and copy the files into the folder next to the game executeable
14 changes: 14 additions & 0 deletions hack/builtinDll/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash
set -e

for dll in 'xinput1_1' 'xinput1_2' 'xinput9_1_0' 'xinput1_3' 'xinput1_4'
do
pushd $dll
winemaker --nosource-fix --dll --wine32 --nomfc -ldl . -I../include
make
popd
cp $dll/$dll.dll.so bin/$dll.dll.so
done
echo ""
echo ""
echo "all done, files are in bin-folder"
1 change: 1 addition & 0 deletions hack/builtinDll/include/config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#define __WINESRC__
124 changes: 124 additions & 0 deletions hack/builtinDll/include/wine/wine_common_ver.rc
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
/*
* Copyright 2001 Dmitry Timoshkov
* Copyright 2004 Ivan Leo Puoti
*
* 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 "winresrc.h"

/*
Assign WINE_FILEVERSION and WINE_FILEVERSION_STR high enough number
to make sure that programs, relying on the version numbers, will
never complain.
*/

#ifndef WINE_FILEVERSION_MAJOR
#define WINE_FILEVERSION_MAJOR 10
#endif

#ifndef WINE_FILEVERSION_MINOR
#define WINE_FILEVERSION_MINOR 0
#endif

#ifndef WINE_FILEVERSION_BUILD
#define WINE_FILEVERSION_BUILD 0
#endif

#ifndef WINE_FILEVERSION_PLATFORMID
#define WINE_FILEVERSION_PLATFORMID 0
#endif

#ifndef WINE_FILEVERSION
#define WINE_FILEVERSION WINE_FILEVERSION_MAJOR,WINE_FILEVERSION_MINOR,\
WINE_FILEVERSION_BUILD,WINE_FILEVERSION_PLATFORMID
#endif

#define WINE_VER_STRINGIZE2(x) #x
#define WINE_VER_STRINGIZE(x) WINE_VER_STRINGIZE2(x)

#ifndef WINE_FILEVERSION_STR
#define WINE_FILEVERSION_STR WINE_VER_STRINGIZE(WINE_FILEVERSION_MAJOR.WINE_FILEVERSION_MINOR.WINE_FILEVERSION_BUILD.WINE_FILEVERSION_PLATFORMID)
#endif

#ifndef WINE_FILEDESCRIPTION_STR
#define WINE_FILEDESCRIPTION_STR "Wine core dll"
#endif

#ifndef WINE_FILENAME
#define WINE_FILENAME ""
#endif

#ifndef WINE_FILENAME_STR
#define WINE_FILENAME_STR ""
#endif

#ifndef WINE_FILETYPE
#define WINE_FILETYPE VFT_DLL
#endif

#ifndef WINE_FILESUBTYPE
#define WINE_FILESUBTYPE VFT2_UNKNOWN
#endif

#ifndef WINE_LEGALCOPYRIGHT
#define WINE_LEGALCOPYRIGHT "Copyright (c) 1993-2015 the Wine project authors (see the file AUTHORS for a complete list)"
#endif

#ifndef WINE_PRODUCTVERSION
#define WINE_PRODUCTVERSION 1,0,0,0
#endif

#ifndef WINE_PRODUCTVERSION_STR
#define WINE_PRODUCTVERSION_STR "1.0"
#endif

#ifndef WINE_PRODUCTNAME_STR
#define WINE_PRODUCTNAME_STR "Wine"
#endif

#ifndef WINE_EXTRAVALUES
#define WINE_EXTRAVALUES
#endif

VS_VERSION_INFO VERSIONINFO
FILEVERSION WINE_FILEVERSION
PRODUCTVERSION WINE_PRODUCTVERSION
FILEFLAGSMASK 63
FILEFLAGS 0
FILEOS VOS_UNKNOWN
FILETYPE WINE_FILETYPE
FILESUBTYPE WINE_FILESUBTYPE
{
BLOCK "StringFileInfo"
{
BLOCK "040904E4" /* LANG_ENGLISH/SUBLANG_DEFAULT, CP 1252 */
{
VALUE "CompanyName", "Microsoft Corporation" /* GameGuard depends on this */
VALUE "FileDescription", WINE_FILEDESCRIPTION_STR
VALUE "FileVersion", WINE_FILEVERSION_STR
VALUE "InternalName", WINE_FILENAME
VALUE "LegalCopyright", WINE_LEGALCOPYRIGHT
VALUE "OriginalFilename", WINE_FILENAME_STR
VALUE "ProductName", WINE_PRODUCTNAME_STR
VALUE "ProductVersion", WINE_PRODUCTVERSION_STR
WINE_EXTRAVALUES
}
}
BLOCK "VarFileInfo"
{
VALUE "Translation", 0x0409, 0x04E4 /* LANG_ENGLISH/SUBLANG_DEFAULT, CP 1252 */
}
}
6 changes: 6 additions & 0 deletions hack/builtinDll/xinput1_1/Makefile.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
MODULE = xinput1_1.dll

C_SRCS = \
xinput1_1_main.c

RC_SRCS = version.rc
27 changes: 27 additions & 0 deletions hack/builtinDll/xinput1_1/version.rc
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/*
* The Wine project - Xinput Joystick 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
*/

#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"
10 changes: 10 additions & 0 deletions hack/builtinDll/xinput1_1/xinput1_1.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
1 stdcall -private DllMain(long long ptr)
2 stdcall XInputGetState(long ptr) xinput1_3.XInputGetState
3 stdcall XInputSetState(long ptr) xinput1_3.XInputSetState
4 stdcall XInputGetCapabilities(long long ptr) xinput1_3.XInputGetCapabilities
5 stdcall XInputEnable(long) xinput1_3.XInputEnable
6 stdcall XInputGetDSoundAudioDeviceGuids(long ptr ptr) xinput1_3.XInputGetDSoundAudioDeviceGuids
7 stdcall XInputGetBatteryInformation(long ptr ptr) xinput1_3.XInputGetBatteryInformation
8 stdcall XInputGetKeystroke(long long ptr) xinput1_3.XInputGetKeystroke
10 stdcall XInputGetAudioDeviceIds(long ptr ptr ptr ptr) xinput1_3.XInputGetAudioDeviceIds
100 stdcall _XInputGetStateEx(long ptr) xinput1_3.XInputGetState
37 changes: 37 additions & 0 deletions hack/builtinDll/xinput1_1/xinput1_1_main.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/*
* The Wine project - Xinput Joystick 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 <stdarg.h>

#include "windef.h"
#include "winbase.h"

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;
}
return TRUE;
}
6 changes: 6 additions & 0 deletions hack/builtinDll/xinput1_2/Makefile.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
MODULE = xinput1_2.dll

C_SRCS = \
xinput1_2_main.c

RC_SRCS = version.rc
27 changes: 27 additions & 0 deletions hack/builtinDll/xinput1_2/version.rc
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/*
* The Wine project - Xinput Joystick 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
*/

#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"
10 changes: 10 additions & 0 deletions hack/builtinDll/xinput1_2/xinput1_2.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
1 stdcall -private DllMain(long long ptr)
2 stdcall XInputGetState(long ptr) xinput1_3.XInputGetState
3 stdcall XInputSetState(long ptr) xinput1_3.XInputSetState
4 stdcall XInputGetCapabilities(long long ptr) xinput1_3.XInputGetCapabilities
5 stdcall XInputEnable(long) xinput1_3.XInputEnable
6 stdcall XInputGetDSoundAudioDeviceGuids(long ptr ptr) xinput1_3.XInputGetDSoundAudioDeviceGuids
7 stdcall XInputGetBatteryInformation(long ptr ptr) xinput1_3.XInputGetBatteryInformation
8 stdcall XInputGetKeystroke(long long ptr) xinput1_3.XInputGetKeystroke
10 stdcall XInputGetAudioDeviceIds(long ptr ptr ptr ptr) xinput1_3.XInputGetAudioDeviceIds
100 stdcall _XInputGetStateEx(long ptr) xinput1_3.XInputGetState
37 changes: 37 additions & 0 deletions hack/builtinDll/xinput1_2/xinput1_2_main.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/*
* The Wine project - Xinput Joystick 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 <stdarg.h>

#include "windef.h"
#include "winbase.h"

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;
}
return TRUE;
}
7 changes: 7 additions & 0 deletions hack/builtinDll/xinput1_3/Makefile.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
MODULE = xinput1_3.dll
IMPORTLIB = xinput

C_SRCS = \
xinput1_3_main.c

RC_SRCS = version.rc
27 changes: 27 additions & 0 deletions hack/builtinDll/xinput1_3/version.rc
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/*
* The Wine project - Xinput Joystick 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
*/

#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"
10 changes: 10 additions & 0 deletions hack/builtinDll/xinput1_3/xinput1_3.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
1 stdcall -private DllMain(long long ptr)
2 stdcall XInputGetState(long ptr)
3 stdcall XInputSetState(long ptr)
4 stdcall XInputGetCapabilities(long long ptr)
5 stdcall XInputEnable(long)
6 stdcall XInputGetDSoundAudioDeviceGuids(long ptr ptr)
7 stdcall XInputGetBatteryInformation(long ptr ptr)
8 stdcall XInputGetKeystroke(long long ptr)
10 stdcall XInputGetAudioDeviceIds(long ptr ptr ptr ptr)
100 stdcall _XInputGetStateEx(long ptr) xinput1_3.XInputGetState
Loading

0 comments on commit 4717eab

Please sign in to comment.