diff --git a/reactos/boot/bootdata/packages/reactos.dff b/reactos/boot/bootdata/packages/reactos.dff index 6c27eb78563..18cf71efcce 100644 --- a/reactos/boot/bootdata/packages/reactos.dff +++ b/reactos/boot/bootdata/packages/reactos.dff @@ -448,6 +448,10 @@ dll\win32\wshtcpip\wshtcpip.dll 1 dll\win32\wsock32\wsock32.dll 1 dll\win32\wtsapi32\wtsapi32.dll 1 dll\win32\wuapi\wuapi.dll 1 +dll\win32\xinput1_1\xinput1_1.dll 1 +dll\win32\xinput1_2\xinput1_2.dll 1 +dll\win32\xinput1_3\xinput1_3.dll 1 +dll\win32\xinput9_1_0\xinput9_1_0.dll 1 dll\win32\winmm\midimap\midimap.dll 1 dll\win32\winmm\wavemap\msacm32.drv 1 optional dll\win32\wdmaud.drv\wdmaud.drv 1 diff --git a/reactos/dll/win32/win32.rbuild b/reactos/dll/win32/win32.rbuild index 32fe0e06625..886724910e0 100644 --- a/reactos/dll/win32/win32.rbuild +++ b/reactos/dll/win32/win32.rbuild @@ -622,4 +622,16 @@ + + + + + + + + + + + + diff --git a/reactos/dll/win32/xinput1_1/version.rc b/reactos/dll/win32/xinput1_1/version.rc new file mode 100644 index 00000000000..e93aa902ecc --- /dev/null +++ b/reactos/dll/win32/xinput1_1/version.rc @@ -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" diff --git a/reactos/dll/win32/xinput1_1/xinput1_1.rbuild b/reactos/dll/win32/xinput1_1/xinput1_1.rbuild new file mode 100644 index 00000000000..8da638ca1c9 --- /dev/null +++ b/reactos/dll/win32/xinput1_1/xinput1_1.rbuild @@ -0,0 +1,9 @@ + + + . + include/reactos/wine + + kernel32 + xinput1_1_main.c + version.rc + diff --git a/reactos/dll/win32/xinput1_1/xinput1_1.spec b/reactos/dll/win32/xinput1_1/xinput1_1.spec new file mode 100644 index 00000000000..95759c345ea --- /dev/null +++ b/reactos/dll/win32/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/reactos/dll/win32/xinput1_1/xinput1_1_main.c b/reactos/dll/win32/xinput1_1/xinput1_1_main.c new file mode 100644 index 00000000000..18cde9e6652 --- /dev/null +++ b/reactos/dll/win32/xinput1_1/xinput1_1_main.c @@ -0,0 +1,39 @@ +/* + * 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 + +#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; + case DLL_PROCESS_DETACH: + break; + } + return TRUE; +} diff --git a/reactos/dll/win32/xinput1_2/version.rc b/reactos/dll/win32/xinput1_2/version.rc new file mode 100644 index 00000000000..5dec834732f --- /dev/null +++ b/reactos/dll/win32/xinput1_2/version.rc @@ -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" diff --git a/reactos/dll/win32/xinput1_2/xinput1_2.rbuild b/reactos/dll/win32/xinput1_2/xinput1_2.rbuild new file mode 100644 index 00000000000..e35428ba31e --- /dev/null +++ b/reactos/dll/win32/xinput1_2/xinput1_2.rbuild @@ -0,0 +1,9 @@ + + + . + include/reactos/wine + + kernel32 + xinput1_2_main.c + version.rc + diff --git a/reactos/dll/win32/xinput1_2/xinput1_2.spec b/reactos/dll/win32/xinput1_2/xinput1_2.spec new file mode 100644 index 00000000000..95759c345ea --- /dev/null +++ b/reactos/dll/win32/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/reactos/dll/win32/xinput1_2/xinput1_2_main.c b/reactos/dll/win32/xinput1_2/xinput1_2_main.c new file mode 100644 index 00000000000..18cde9e6652 --- /dev/null +++ b/reactos/dll/win32/xinput1_2/xinput1_2_main.c @@ -0,0 +1,39 @@ +/* + * 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 + +#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; + case DLL_PROCESS_DETACH: + break; + } + return TRUE; +} diff --git a/reactos/dll/win32/xinput1_3/version.rc b/reactos/dll/win32/xinput1_3/version.rc new file mode 100644 index 00000000000..191b1425313 --- /dev/null +++ b/reactos/dll/win32/xinput1_3/version.rc @@ -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" diff --git a/reactos/dll/win32/xinput1_3/xinput.h b/reactos/dll/win32/xinput1_3/xinput.h new file mode 100644 index 00000000000..24fbdb379d3 --- /dev/null +++ b/reactos/dll/win32/xinput1_3/xinput.h @@ -0,0 +1,239 @@ +/* + * 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 + */ + +#ifndef __WINE_XINPUT_H +#define __WINE_XINPUT_H + +#include + +/* + * Bitmasks for the joysticks buttons, determines what has + * been pressed on the joystick, these need to be mapped + * to whatever device you're using instead of an xbox 360 + * joystick + */ + +#define XINPUT_GAMEPAD_DPAD_UP 0x0001 +#define XINPUT_GAMEPAD_DPAD_DOWN 0x0002 +#define XINPUT_GAMEPAD_DPAD_LEFT 0x0004 +#define XINPUT_GAMEPAD_DPAD_RIGHT 0x0008 +#define XINPUT_GAMEPAD_START 0x0010 +#define XINPUT_GAMEPAD_BACK 0x0020 +#define XINPUT_GAMEPAD_LEFT_THUMB 0x0040 +#define XINPUT_GAMEPAD_RIGHT_THUMB 0x0080 +#define XINPUT_GAMEPAD_LEFT_SHOULDER 0x0100 +#define XINPUT_GAMEPAD_RIGHT_SHOULDER 0x0200 +#define XINPUT_GAMEPAD_A 0x1000 +#define XINPUT_GAMEPAD_B 0x2000 +#define XINPUT_GAMEPAD_X 0x4000 +#define XINPUT_GAMEPAD_Y 0x8000 + +/* + * Defines the flags used to determine if the user is pushing + * down on a button, not holding a button, etc + */ + +#define XINPUT_KEYSTROKE_KEYDOWN 0x0001 +#define XINPUT_KEYSTROKE_KEYUP 0x0002 +#define XINPUT_KEYSTROKE_REPEAT 0x0004 + +/* + * Defines the codes which are returned by XInputGetKeystroke + */ + +#define VK_PAD_A 0x5800 +#define VK_PAD_B 0x5801 +#define VK_PAD_X 0x5802 +#define VK_PAD_Y 0x5803 +#define VK_PAD_RSHOULDER 0x5804 +#define VK_PAD_LSHOULDER 0x5805 +#define VK_PAD_LTRIGGER 0x5806 +#define VK_PAD_RTRIGGER 0x5807 +#define VK_PAD_DPAD_UP 0x5810 +#define VK_PAD_DPAD_DOWN 0x5811 +#define VK_PAD_DPAD_LEFT 0x5812 +#define VK_PAD_DPAD_RIGHT 0x5813 +#define VK_PAD_START 0x5814 +#define VK_PAD_BACK 0x5815 +#define VK_PAD_LTHUMB_PRESS 0x5816 +#define VK_PAD_RTHUMB_PRESS 0x5817 +#define VK_PAD_LTHUMB_UP 0x5820 +#define VK_PAD_LTHUMB_DOWN 0x5821 +#define VK_PAD_LTHUMB_RIGHT 0x5822 +#define VK_PAD_LTHUMB_LEFT 0x5823 +#define VK_PAD_LTHUMB_UPLEFT 0x5824 +#define VK_PAD_LTHUMB_UPRIGHT 0x5825 +#define VK_PAD_LTHUMB_DOWNRIGHT 0x5826 +#define VK_PAD_LTHUMB_DOWNLEFT 0x5827 +#define VK_PAD_RTHUMB_UP 0x5830 +#define VK_PAD_RTHUMB_DOWN 0x5831 +#define VK_PAD_RTHUMB_RIGHT 0x5832 +#define VK_PAD_RTHUMB_LEFT 0x5833 +#define VK_PAD_RTHUMB_UPLEFT 0x5834 +#define VK_PAD_RTHUMB_UPRIGHT 0x5835 +#define VK_PAD_RTHUMB_DOWNRIGHT 0x5836 +#define VK_PAD_RTHUMB_DOWNLEFT 0x5837 + +/* + * Deadzones are for analogue joystick controls on the joypad + * which determine when input should be assumed to be in the + * middle of the pad. This is a threshold to stop a joypad + * controlling the game when the player isn't touching the + * controls. + */ + +#define XINPUT_GAMEPAD_LEFT_THUMB_DEADZONE 7849 +#define XINPUT_GAMEPAD_RIGHT_THUMB_DEADZONE 8689 +#define XINPUT_GAMEPAD_TRIGGER_THRESHOLD 30 + + +/* + * Defines what type of abilities the type of joystick has + * DEVTYPE_GAMEPAD is avaliable for all joysticks, however + * there may be more specfic identifiers for other joysticks + * which are being used. + */ + +#define XINPUT_DEVTYPE_GAMEPAD 0x01 +#define XINPUT_DEVSUBTYPE_GAMEPAD 0x01 +#define XINPUT_DEVSUBTYPE_WHEEL 0x02 +#define XINPUT_DEVSUBTYPE_ARCADE_STICK 0x03 +#define XINPUT_DEVSUBTYPE_FLIGHT_SICK 0x04 +#define XINPUT_DEVSUBTYPE_DANCE_PAD 0x05 +#define XINPUT_DEVSUBTYPE_GUITAR 0x06 +#define XINPUT_DEVSUBTYPE_DRUM_KIT 0x08 + +/* + * These are used with the XInputGetCapabilities function to + * determine the abilities to the joystick which has been + * plugged in. + */ + +#define XINPUT_CAPS_VOICE_SUPPORTED 0x0004 +#define XINPUT_FLAG_GAMEPAD 0x00000001 + +/* + * Defines the status of the battery if one is used in the + * attached joystick. The first two define if the joystick + * supports a battery. Disconnected means that the joystick + * isn't connected. Wired shows that the joystick is a wired + * joystick. + */ + +#define BATTERY_DEVTYPE_GAMEPAD 0x00 +#define BATTERY_DEVTYPE_HEADSET 0x01 +#define BATTERY_TYPE_DISCONNECTED 0x00 +#define BATTERY_TYPE_WIRED 0x01 +#define BATTERY_TYPE_ALKALINE 0x02 +#define BATTERY_TYPE_NIMH 0x03 +#define BATTERY_TYPE_UNKNOWN 0xFF +#define BATTERY_LEVEL_EMPTY 0x00 +#define BATTERY_LEVEL_LOW 0x01 +#define BATTERY_LEVEL_MEDIUM 0x02 +#define BATTERY_LEVEL_FULL 0x03 + +/* + * How many joysticks can be used with this library. Games that + * use the xinput library will not go over this number. + */ + +#define XUSER_MAX_COUNT 4 +#define XUSER_INDEX_ANY 0x000000FF + +/* + * Defines the structure of an xbox 360 joystick. + */ + +typedef struct _XINPUT_GAMEPAD { + WORD wButtons; + BYTE bLeftTrigger; + BYTE bRightTrigger; + SHORT sThumbLX; + SHORT sThumbLY; + SHORT sThumbRX; + SHORT sThumbRY; +} XINPUT_GAMEPAD, *PXINPUT_GAMEPAD; + +typedef struct _XINPUT_STATE { + DWORD dwPacketNumber; + XINPUT_GAMEPAD Gamepad; +} XINPUT_STATE, *PXINPUT_STATE; + +/* + * Defines the structure of how much vibration is set on both the + * right and left motors in a joystick. If you're not using a 360 + * joystick you will have to map these to your device. + */ + +typedef struct _XINPUT_VIBRATION { + WORD wLeftMotorSpeed; + WORD wRightMotorSpeed; +} XINPUT_VIBRATION, *PXINPUT_VIBRATION; + +/* + * Defines the structure for what kind of abilities the joystick has + * such abilites are things such as if the joystick has the ability + * to send and receive audio, if the joystick is infact a driving + * wheel or perhaps if the joystick is some kind of dance pad or + * guitar. + */ + +typedef struct _XINPUT_CAPABILITIES { + BYTE Type; + BYTE SubType; + WORD Flags; + XINPUT_GAMEPAD Gamepad; + XINPUT_VIBRATION Vibration; +} XINPUT_CAPABILITIES, *PXINPUT_CAPABILITIES; + +/* + * Defines the structure for a joystick input event which is + * retrieved using the function XInputGetKeystroke + */ +typedef struct _XINPUT_KEYSTROKE { + WORD VirtualKey; + WCHAR Unicode; + WORD Flags; + BYTE UserIndex; + BYTE HidCode; +} XINPUT_KEYSTROKE, *PXINPUT_KEYSTROKE; + +typedef struct _XINPUT_BATTERY_INFORMATION +{ + BYTE BatteryType; + BYTE BatteryLevel; +} XINPUT_BATTERY_INFORMATION, *PXINPUT_BATTERY_INFORMATION; + +#ifdef __cplusplus +extern "C" { +#endif + +void WINAPI XInputEnable(BOOL); +DWORD WINAPI XInputSetState(DWORD, XINPUT_VIBRATION*); +DWORD WINAPI XInputGetState(DWORD, XINPUT_STATE*); +DWORD WINAPI XInputGetKeystroke(DWORD, DWORD, PXINPUT_KEYSTROKE); +DWORD WINAPI XInputGetCapabilities(DWORD, DWORD, XINPUT_CAPABILITIES*); +DWORD WINAPI XInputGetDSoundAudioDeviceGuids(DWORD, GUID*, GUID*); +DWORD WINAPI XInputGetBatteryInformation(DWORD, BYTE, XINPUT_BATTERY_INFORMATION*); + +#ifdef __cplusplus +} +#endif + +#endif /* __WINE_XINPUT_H */ diff --git a/reactos/dll/win32/xinput1_3/xinput1_3.rbuild b/reactos/dll/win32/xinput1_3/xinput1_3.rbuild new file mode 100644 index 00000000000..1353501bcf5 --- /dev/null +++ b/reactos/dll/win32/xinput1_3/xinput1_3.rbuild @@ -0,0 +1,10 @@ + + + . + include/reactos/wine + + kernel32 + wine + xinput1_3_main.c + version.rc + diff --git a/reactos/dll/win32/xinput1_3/xinput1_3.spec b/reactos/dll/win32/xinput1_3/xinput1_3.spec new file mode 100644 index 00000000000..be1f4110dbf --- /dev/null +++ b/reactos/dll/win32/xinput1_3/xinput1_3.spec @@ -0,0 +1,7 @@ +@ stdcall XInputEnable(long) +@ stdcall XInputSetState(long ptr) +@ stdcall XInputGetState(long ptr) +@ stdcall XInputGetKeystroke(long long ptr) +@ stdcall XInputGetCapabilities(long long ptr) +@ stdcall XInputGetDSoundAudioDeviceGuids(long ptr ptr) +@ stdcall XInputGetBatteryInformation(long ptr ptr) diff --git a/reactos/dll/win32/xinput1_3/xinput1_3_main.c b/reactos/dll/win32/xinput1_3/xinput1_3_main.c new file mode 100644 index 00000000000..f4386b891f8 --- /dev/null +++ b/reactos/dll/win32/xinput1_3/xinput1_3_main.c @@ -0,0 +1,128 @@ +/* + * 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 +#include +#include + +#include "wine/debug.h" +#include "windef.h" +#include "winbase.h" +#include "winerror.h" + +#include "xinput.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; +} + +void WINAPI XInputEnable(BOOL enable) +{ + /* Setting to false will stop messages from XInputSetState being sent + to the controllers. Setting to true will send the last vibration + value (sent to XInputSetState) to the controller and allow messages to + be sent */ + FIXME("(%d) Stub!\n", enable); +} + +DWORD WINAPI XInputSetState(DWORD dwUserIndex, XINPUT_VIBRATION* pVibration) +{ + FIXME("(%d %p) Stub!\n", dwUserIndex, pVibration); + + if (dwUserIndex < XUSER_MAX_COUNT) + { + return ERROR_DEVICE_NOT_CONNECTED; + /* If controller exists then return ERROR_SUCCESS */ + } + return ERROR_BAD_ARGUMENTS; +} + +DWORD WINAPI XInputGetState(DWORD dwUserIndex, XINPUT_STATE* pState) +{ + FIXME("(%u %p)\n", dwUserIndex, pState); + + if (dwUserIndex < XUSER_MAX_COUNT) + { + return ERROR_DEVICE_NOT_CONNECTED; + /* If controller exists then return ERROR_SUCCESS */ + } + return ERROR_BAD_ARGUMENTS; +} + +DWORD WINAPI XInputGetKeystroke(DWORD dwUserIndex, DWORD dwReserve, PXINPUT_KEYSTROKE pKeystroke) +{ + FIXME("(%d %d %p) Stub!\n", dwUserIndex, dwReserve, pKeystroke); + + if (dwUserIndex < XUSER_MAX_COUNT) + { + return ERROR_DEVICE_NOT_CONNECTED; + /* If controller exists then return ERROR_SUCCESS */ + } + return ERROR_BAD_ARGUMENTS; +} + +DWORD WINAPI XInputGetCapabilities(DWORD dwUserIndex, DWORD dwFlags, XINPUT_CAPABILITIES* pCapabilities) +{ + FIXME("(%d %d %p)\n", dwUserIndex, dwFlags, pCapabilities); + + if (dwUserIndex < XUSER_MAX_COUNT) + { + return ERROR_DEVICE_NOT_CONNECTED; + /* If controller exists then return ERROR_SUCCESS */ + } + return ERROR_BAD_ARGUMENTS; +} + +DWORD WINAPI XInputGetDSoundAudioDeviceGuids(DWORD dwUserIndex, GUID* pDSoundRenderGuid, GUID* pDSoundCaptureGuid) +{ + FIXME("(%d %s %s) Stub!\n", dwUserIndex, debugstr_guid(pDSoundRenderGuid), debugstr_guid(pDSoundCaptureGuid)); + + if (dwUserIndex < XUSER_MAX_COUNT) + { + return ERROR_DEVICE_NOT_CONNECTED; + /* If controller exists then return ERROR_SUCCESS */ + } + return ERROR_BAD_ARGUMENTS; +} + +DWORD WINAPI XInputGetBatteryInformation(DWORD dwUserIndex, BYTE deviceType, XINPUT_BATTERY_INFORMATION* pBatteryInfo) +{ + FIXME("(%d %u %p) Stub!\n", dwUserIndex, deviceType, pBatteryInfo); + + if (dwUserIndex < XUSER_MAX_COUNT) + { + return ERROR_DEVICE_NOT_CONNECTED; + /* If controller exists then return ERROR_SUCCESS */ + } + return ERROR_BAD_ARGUMENTS; +} diff --git a/reactos/dll/win32/xinput9_1_0/version.rc b/reactos/dll/win32/xinput9_1_0/version.rc new file mode 100644 index 00000000000..9e4d13e4d11 --- /dev/null +++ b/reactos/dll/win32/xinput9_1_0/version.rc @@ -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 "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/reactos/dll/win32/xinput9_1_0/xinput9_1_0.rbuild b/reactos/dll/win32/xinput9_1_0/xinput9_1_0.rbuild new file mode 100644 index 00000000000..0b7097648f2 --- /dev/null +++ b/reactos/dll/win32/xinput9_1_0/xinput9_1_0.rbuild @@ -0,0 +1,9 @@ + + + . + include/reactos/wine + + kernel32 + xinput9_1_0_main.c + version.rc + diff --git a/reactos/dll/win32/xinput9_1_0/xinput9_1_0.spec b/reactos/dll/win32/xinput9_1_0/xinput9_1_0.spec new file mode 100644 index 00000000000..5d95b3e84db --- /dev/null +++ b/reactos/dll/win32/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/reactos/dll/win32/xinput9_1_0/xinput9_1_0_main.c b/reactos/dll/win32/xinput9_1_0/xinput9_1_0_main.c new file mode 100644 index 00000000000..18cde9e6652 --- /dev/null +++ b/reactos/dll/win32/xinput9_1_0/xinput9_1_0_main.c @@ -0,0 +1,39 @@ +/* + * 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 + +#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; + case DLL_PROCESS_DETACH: + break; + } + return TRUE; +} diff --git a/reactos/media/doc/README.WINE b/reactos/media/doc/README.WINE index 86c2c54529e..337e927626a 100644 --- a/reactos/media/doc/README.WINE +++ b/reactos/media/doc/README.WINE @@ -170,6 +170,10 @@ reactos/dll/win32/wldap32 # Autosync reactos/dll/win32/wmi # Autosync reactos/dll/win32/wtsapi32 # Autosync reactos/dll/win32/wuapi # Autosync +reactos/dll/win32/xinput1_1 # Autosync +reactos/dll/win32/xinput1_2 # Autosync +reactos/dll/win32/xinput1_3 # Autosync +reactos/dll/win32/xinput9_1_0 # Autosync ReactOS shares the following programs with Winehq.