ReactOS 0.4.15-dev-7942-gd23573b
xinput1_3_main.c
Go to the documentation of this file.
1/*
2 * The Wine project - Xinput Joystick Library
3 * Copyright 2008 Andrew Fenn
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
18 */
19
20#include <config.h>
21//#include <assert.h>
22//#include <stdarg.h>
23//#include <string.h>
24
25#include <wine/debug.h>
26//#include "windef.h"
27#include <winbase.h>
28//#include "winerror.h"
29
30#include <xinput.h>
31
32/* Not defined in the headers, used only by XInputGetStateEx */
33#define XINPUT_GAMEPAD_GUIDE 0x0400
34
36
37struct
38{
41
43{
44 switch(reason)
45 {
48 break;
49 }
50 return TRUE;
51}
52
54{
55 /* Setting to false will stop messages from XInputSetState being sent
56 to the controllers. Setting to true will send the last vibration
57 value (sent to XInputSetState) to the controller and allow messages to
58 be sent */
59 FIXME("(enable %d) Stub!\n", enable);
60}
61
63{
64 FIXME("(index %u, vibration %p) Stub!\n", index, vibration);
65
70
72}
73
75{
76 union
77 {
79 XINPUT_STATE_EX state_ex;
80 } xinput;
81 DWORD ret;
82 static int warn_once;
83
84 if (!warn_once++)
85 FIXME("(index %u, state %p) Stub!\n", index, state);
86
87 ret = XInputGetStateEx(index, &xinput.state_ex);
88 if (ret != ERROR_SUCCESS)
89 return ret;
90
91 /* The main difference between this and the Ex version is the media guide button */
92 xinput.state.Gamepad.wButtons &= ~XINPUT_GAMEPAD_GUIDE;
93 *state = xinput.state;
94
95 return ERROR_SUCCESS;
96}
97
99{
100 static int warn_once;
101
102 if (!warn_once++)
103 FIXME("(index %u, state %p) Stub!\n", index, state_ex);
104
105 if (index >= XUSER_MAX_COUNT)
106 return ERROR_BAD_ARGUMENTS;
109
110 return ERROR_NOT_SUPPORTED;
111}
112
114{
115 static int warn_once;
116
117 if (!warn_once++)
118 FIXME("(index %u, reserved %u, keystroke %p) Stub!\n", index, reserved, keystroke);
119
120 if (index >= XUSER_MAX_COUNT)
121 return ERROR_BAD_ARGUMENTS;
124
125 return ERROR_NOT_SUPPORTED;
126}
127
129{
130 static int warn_once;
131
132 if (!warn_once++)
133 FIXME("(index %u, flags 0x%x, capabilities %p) Stub!\n", index, flags, capabilities);
134
135 if (index >= XUSER_MAX_COUNT)
136 return ERROR_BAD_ARGUMENTS;
139
140 return ERROR_NOT_SUPPORTED;
141}
142
144{
145 FIXME("(index %u, render guid %p, capture guid %p) Stub!\n", index, render_guid, capture_guid);
146
147 if (index >= XUSER_MAX_COUNT)
148 return ERROR_BAD_ARGUMENTS;
151
152 return ERROR_NOT_SUPPORTED;
153}
154
156{
157 FIXME("(index %u, type %u, battery %p) Stub!\n", index, type, battery);
158
159 if (index >= XUSER_MAX_COUNT)
160 return ERROR_BAD_ARGUMENTS;
163
164 return ERROR_NOT_SUPPORTED;
165}
#define DECLSPEC_HOTPATCH
Definition: _mingw.h:243
static int state
Definition: maze.c:121
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
Definition: precomp.h:23
#define FIXME(fmt,...)
Definition: debug.h:111
#define ERROR_SUCCESS
Definition: deptool.c:10
#define TRUE
Definition: types.h:120
static WCHAR reason[MAX_STRING_RESOURCE_LEN]
Definition: object.c:1904
#define DLL_PROCESS_ATTACH
Definition: compat.h:131
#define ERROR_NOT_SUPPORTED
Definition: compat.h:100
BOOL WINAPI DisableThreadLibraryCalls(IN HMODULE hLibModule)
Definition: loader.c:85
r reserved
Definition: btrfs.c:3006
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
GLuint index
Definition: glext.h:6031
GLbitfield flags
Definition: glext.h:7161
GLboolean enable
Definition: glext.h:11120
int ret
#define WINAPI
Definition: msvc.h:6
#define ERROR_DEVICE_NOT_CONNECTED
Definition: winerror.h:689
#define ERROR_BAD_ARGUMENTS
Definition: winerror.h:232
DWORD WINAPI DECLSPEC_HOTPATCH XInputGetStateEx(DWORD index, XINPUT_STATE_EX *state_ex)
struct @606 controllers[XUSER_MAX_COUNT]
DWORD WINAPI XInputGetKeystroke(DWORD index, DWORD reserved, PXINPUT_KEYSTROKE keystroke)
BOOL WINAPI DllMain(HINSTANCE inst, DWORD reason, LPVOID reserved)
DWORD WINAPI XInputSetState(DWORD index, XINPUT_VIBRATION *vibration)
DWORD WINAPI XInputGetDSoundAudioDeviceGuids(DWORD index, GUID *render_guid, GUID *capture_guid)
DWORD WINAPI XInputGetCapabilities(DWORD index, DWORD flags, XINPUT_CAPABILITIES *capabilities)
void WINAPI DECLSPEC_HOTPATCH XInputEnable(BOOL enable)
BOOL connected
DWORD WINAPI DECLSPEC_HOTPATCH XInputGetState(DWORD index, XINPUT_STATE *state)
DWORD WINAPI XInputGetBatteryInformation(DWORD index, BYTE type, XINPUT_BATTERY_INFORMATION *battery)
#define XUSER_MAX_COUNT
Definition: xinput.h:156
unsigned char BYTE
Definition: xxhash.c:193