ReactOS  0.4.14-dev-115-g4576127
xinput1_3_main.c File Reference
#include <config.h>
#include <wine/debug.h>
#include <winbase.h>
#include <xinput.h>
Include dependency graph for xinput1_3_main.c:

Go to the source code of this file.

Macros

#define XINPUT_GAMEPAD_GUIDE   0x0400
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (xinput)
 
BOOL WINAPI DllMain (HINSTANCE inst, DWORD reason, LPVOID reserved)
 
void WINAPI DECLSPEC_HOTPATCH XInputEnable (BOOL enable)
 
DWORD WINAPI XInputSetState (DWORD index, XINPUT_VIBRATION *vibration)
 
DWORD WINAPI DECLSPEC_HOTPATCH XInputGetState (DWORD index, XINPUT_STATE *state)
 
DWORD WINAPI DECLSPEC_HOTPATCH XInputGetStateEx (DWORD index, XINPUT_STATE_EX *state_ex)
 
DWORD WINAPI XInputGetKeystroke (DWORD index, DWORD reserved, PXINPUT_KEYSTROKE keystroke)
 
DWORD WINAPI XInputGetCapabilities (DWORD index, DWORD flags, XINPUT_CAPABILITIES *capabilities)
 
DWORD WINAPI XInputGetDSoundAudioDeviceGuids (DWORD index, GUID *render_guid, GUID *capture_guid)
 
DWORD WINAPI XInputGetBatteryInformation (DWORD index, BYTE type, XINPUT_BATTERY_INFORMATION *battery)
 

Variables

struct {
   BOOL   connected
 
controllers [XUSER_MAX_COUNT]
 

Macro Definition Documentation

◆ XINPUT_GAMEPAD_GUIDE

#define XINPUT_GAMEPAD_GUIDE   0x0400

Definition at line 33 of file xinput1_3_main.c.

Function Documentation

◆ DllMain()

BOOL WINAPI DllMain ( HINSTANCE  inst,
DWORD  reason,
LPVOID  reserved 
)

Definition at line 42 of file xinput1_3_main.c.

43 {
44  switch(reason)
45  {
46  case DLL_PROCESS_ATTACH:
48  break;
49  }
50  return TRUE;
51 }
#define TRUE
Definition: types.h:120
BOOL WINAPI DisableThreadLibraryCalls(IN HMODULE hLibModule)
Definition: loader.c:85
#define DLL_PROCESS_ATTACH
Definition: compat.h:120
static WCHAR reason[MAX_STRING_RESOURCE_LEN]
Definition: object.c:1904

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( xinput  )

◆ XInputEnable()

void WINAPI DECLSPEC_HOTPATCH XInputEnable ( BOOL  enable)

Definition at line 53 of file xinput1_3_main.c.

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 }
#define FIXME(fmt,...)
Definition: debug.h:110
GLboolean enable
Definition: glext.h:11120

◆ XInputGetBatteryInformation()

DWORD WINAPI XInputGetBatteryInformation ( DWORD  index,
BYTE  type,
XINPUT_BATTERY_INFORMATION battery 
)

Definition at line 155 of file xinput1_3_main.c.

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 XUSER_MAX_COUNT
Definition: xinput.h:156
#define ERROR_BAD_ARGUMENTS
Definition: winerror.h:232
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
#define ERROR_DEVICE_NOT_CONNECTED
Definition: winerror.h:689
#define FIXME(fmt,...)
Definition: debug.h:110
GLuint index
Definition: glext.h:6031
struct @581 controllers[XUSER_MAX_COUNT]
#define ERROR_NOT_SUPPORTED
Definition: compat.h:90
BOOL connected

◆ XInputGetCapabilities()

DWORD WINAPI XInputGetCapabilities ( DWORD  index,
DWORD  flags,
XINPUT_CAPABILITIES capabilities 
)

Definition at line 128 of file xinput1_3_main.c.

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 }
#define XUSER_MAX_COUNT
Definition: xinput.h:156
#define ERROR_BAD_ARGUMENTS
Definition: winerror.h:232
#define ERROR_DEVICE_NOT_CONNECTED
Definition: winerror.h:689
#define FIXME(fmt,...)
Definition: debug.h:110
GLuint index
Definition: glext.h:6031
GLbitfield flags
Definition: glext.h:7161
struct @581 controllers[XUSER_MAX_COUNT]
#define ERROR_NOT_SUPPORTED
Definition: compat.h:90
BOOL connected

◆ XInputGetDSoundAudioDeviceGuids()

DWORD WINAPI XInputGetDSoundAudioDeviceGuids ( DWORD  index,
GUID render_guid,
GUID capture_guid 
)

Definition at line 143 of file xinput1_3_main.c.

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 }
#define XUSER_MAX_COUNT
Definition: xinput.h:156
#define ERROR_BAD_ARGUMENTS
Definition: winerror.h:232
#define ERROR_DEVICE_NOT_CONNECTED
Definition: winerror.h:689
#define FIXME(fmt,...)
Definition: debug.h:110
GLuint index
Definition: glext.h:6031
struct @581 controllers[XUSER_MAX_COUNT]
#define ERROR_NOT_SUPPORTED
Definition: compat.h:90
BOOL connected

◆ XInputGetKeystroke()

DWORD WINAPI XInputGetKeystroke ( DWORD  index,
DWORD  reserved,
PXINPUT_KEYSTROKE  keystroke 
)

Definition at line 113 of file xinput1_3_main.c.

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 }
#define XUSER_MAX_COUNT
Definition: xinput.h:156
#define ERROR_BAD_ARGUMENTS
Definition: winerror.h:232
#define ERROR_DEVICE_NOT_CONNECTED
Definition: winerror.h:689
#define FIXME(fmt,...)
Definition: debug.h:110
r reserved
Definition: btrfs.c:2893
GLuint index
Definition: glext.h:6031
struct @581 controllers[XUSER_MAX_COUNT]
#define ERROR_NOT_SUPPORTED
Definition: compat.h:90
BOOL connected

◆ XInputGetState()

DWORD WINAPI DECLSPEC_HOTPATCH XInputGetState ( DWORD  index,
XINPUT_STATE state 
)

Definition at line 74 of file xinput1_3_main.c.

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 }
#define XINPUT_GAMEPAD_GUIDE
#define ERROR_SUCCESS
Definition: deptool.c:10
#define FIXME(fmt,...)
Definition: debug.h:110
GLuint index
Definition: glext.h:6031
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
static int state
Definition: maze.c:121
DWORD WINAPI DECLSPEC_HOTPATCH XInputGetStateEx(DWORD index, XINPUT_STATE_EX *state_ex)

◆ XInputGetStateEx()

DWORD WINAPI DECLSPEC_HOTPATCH XInputGetStateEx ( DWORD  index,
XINPUT_STATE_EX state_ex 
)

Definition at line 98 of file xinput1_3_main.c.

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 }
#define XUSER_MAX_COUNT
Definition: xinput.h:156
#define ERROR_BAD_ARGUMENTS
Definition: winerror.h:232
#define ERROR_DEVICE_NOT_CONNECTED
Definition: winerror.h:689
#define FIXME(fmt,...)
Definition: debug.h:110
GLuint index
Definition: glext.h:6031
struct @581 controllers[XUSER_MAX_COUNT]
#define ERROR_NOT_SUPPORTED
Definition: compat.h:90
BOOL connected

Referenced by XInputGetState().

◆ XInputSetState()

DWORD WINAPI XInputSetState ( DWORD  index,
XINPUT_VIBRATION vibration 
)

Definition at line 62 of file xinput1_3_main.c.

63 {
64  FIXME("(index %u, vibration %p) Stub!\n", index, vibration);
65 
66  if (index >= XUSER_MAX_COUNT)
67  return ERROR_BAD_ARGUMENTS;
70 
71  return ERROR_NOT_SUPPORTED;
72 }
#define XUSER_MAX_COUNT
Definition: xinput.h:156
#define ERROR_BAD_ARGUMENTS
Definition: winerror.h:232
#define ERROR_DEVICE_NOT_CONNECTED
Definition: winerror.h:689
#define FIXME(fmt,...)
Definition: debug.h:110
GLuint index
Definition: glext.h:6031
struct @581 controllers[XUSER_MAX_COUNT]
#define ERROR_NOT_SUPPORTED
Definition: compat.h:90
BOOL connected

Variable Documentation

◆ connected

◆ controllers