Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2314 lines
93 KiB

  1. /****************************************************************************
  2. *
  3. * Copyright (C) 1996-1999 Microsoft Corporation. All Rights Reserved.
  4. *
  5. * File: dinput.h
  6. * Content: DirectInput include file
  7. *
  8. ****************************************************************************/
  9. #ifndef __DINPUT_INCLUDED__
  10. #define __DINPUT_INCLUDED__
  11. #ifndef DIJ_RINGZERO
  12. #ifdef _WIN32
  13. #define COM_NO_WINDOWS_H
  14. #include <objbase.h>
  15. #endif
  16. #endif /* DIJ_RINGZERO */
  17. #ifdef __cplusplus
  18. extern "C" {
  19. #endif
  20. /*
  21. * To build applications for older versions of DirectInput
  22. *
  23. * #define DIRECTINPUT_VERSION 0x0300
  24. * or
  25. * #define DIRECTINPUT_VERSION 0x0500
  26. *
  27. * before #include <dinput.h>. By default, #include <dinput.h>
  28. * will produce a DirectX 7-compatible header file.
  29. *
  30. */
  31. #ifndef DIRECTINPUT_VERSION
  32. #define DIRECTINPUT_VERSION 0x0700
  33. #endif
  34. #ifndef DIJ_RINGZERO
  35. /****************************************************************************
  36. *
  37. * Class IDs
  38. *
  39. ****************************************************************************/
  40. DEFINE_GUID(CLSID_DirectInput, 0x25E609E0,0xB259,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
  41. DEFINE_GUID(CLSID_DirectInputDevice,0x25E609E1,0xB259,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
  42. /****************************************************************************
  43. *
  44. * Interfaces
  45. *
  46. ****************************************************************************/
  47. DEFINE_GUID(IID_IDirectInputA, 0x89521360,0xAA8A,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
  48. DEFINE_GUID(IID_IDirectInputW, 0x89521361,0xAA8A,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
  49. DEFINE_GUID(IID_IDirectInput2A, 0x5944E662,0xAA8A,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
  50. DEFINE_GUID(IID_IDirectInput2W, 0x5944E663,0xAA8A,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
  51. DEFINE_GUID(IID_IDirectInput7A, 0X9A4CB684,0X236D,0X11D3,0X8E,0X9D,0X00,0XC0,0X4F,0X68,0X44,0XAE);
  52. DEFINE_GUID(IID_IDirectInput7W, 0X9A4CB685,0X236D,0X11D3,0X8E,0X9D,0X00,0XC0,0X4F,0X68,0X44,0XAE);
  53. DEFINE_GUID(IID_IDirectInputDeviceA, 0x5944E680,0xC92E,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
  54. DEFINE_GUID(IID_IDirectInputDeviceW, 0x5944E681,0xC92E,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
  55. DEFINE_GUID(IID_IDirectInputDevice2A,0x5944E682,0xC92E,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
  56. DEFINE_GUID(IID_IDirectInputDevice2W,0x5944E683,0xC92E,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
  57. DEFINE_GUID(IID_IDirectInputEffect, 0xE7E1F7C0,0x88D2,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
  58. DEFINE_GUID(IID_IDirectInputDevice7A,0X57D7C6BC,0X2356,0X11D3,0X8E,0X9D,0X00,0XC0,0X4F,0X68,0X44,0XAE);
  59. DEFINE_GUID(IID_IDirectInputDevice7W,0X57D7C6BD,0X2356,0X11D3,0X8E,0X9D,0X00,0XC0,0X4F,0X68,0X44,0XAE);
  60. /****************************************************************************
  61. *
  62. * Predefined object types
  63. *
  64. ****************************************************************************/
  65. DEFINE_GUID(GUID_XAxis, 0xA36D02E0,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
  66. DEFINE_GUID(GUID_YAxis, 0xA36D02E1,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
  67. DEFINE_GUID(GUID_ZAxis, 0xA36D02E2,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
  68. DEFINE_GUID(GUID_RxAxis, 0xA36D02F4,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
  69. DEFINE_GUID(GUID_RyAxis, 0xA36D02F5,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
  70. DEFINE_GUID(GUID_RzAxis, 0xA36D02E3,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
  71. DEFINE_GUID(GUID_Slider, 0xA36D02E4,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
  72. DEFINE_GUID(GUID_Button, 0xA36D02F0,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
  73. DEFINE_GUID(GUID_Key, 0x55728220,0xD33C,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
  74. DEFINE_GUID(GUID_POV, 0xA36D02F2,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
  75. DEFINE_GUID(GUID_Unknown, 0xA36D02F3,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
  76. /****************************************************************************
  77. *
  78. * Predefined product GUIDs
  79. *
  80. ****************************************************************************/
  81. DEFINE_GUID(GUID_SysMouse, 0x6F1D2B60,0xD5A0,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
  82. DEFINE_GUID(GUID_SysKeyboard,0x6F1D2B61,0xD5A0,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
  83. DEFINE_GUID(GUID_Joystick ,0x6F1D2B70,0xD5A0,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
  84. DEFINE_GUID(GUID_SysMouseEm, 0x6F1D2B80,0xD5A0,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
  85. DEFINE_GUID(GUID_SysMouseEm2,0x6F1D2B81,0xD5A0,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
  86. DEFINE_GUID(GUID_SysKeyboardEm, 0x6F1D2B82,0xD5A0,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
  87. DEFINE_GUID(GUID_SysKeyboardEm2,0x6F1D2B83,0xD5A0,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
  88. /****************************************************************************
  89. *
  90. * Predefined force feedback effects
  91. *
  92. ****************************************************************************/
  93. DEFINE_GUID(GUID_ConstantForce, 0x13541C20,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
  94. DEFINE_GUID(GUID_RampForce, 0x13541C21,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
  95. DEFINE_GUID(GUID_Square, 0x13541C22,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
  96. DEFINE_GUID(GUID_Sine, 0x13541C23,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
  97. DEFINE_GUID(GUID_Triangle, 0x13541C24,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
  98. DEFINE_GUID(GUID_SawtoothUp, 0x13541C25,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
  99. DEFINE_GUID(GUID_SawtoothDown, 0x13541C26,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
  100. DEFINE_GUID(GUID_Spring, 0x13541C27,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
  101. DEFINE_GUID(GUID_Damper, 0x13541C28,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
  102. DEFINE_GUID(GUID_Inertia, 0x13541C29,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
  103. DEFINE_GUID(GUID_Friction, 0x13541C2A,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
  104. DEFINE_GUID(GUID_CustomForce, 0x13541C2B,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
  105. #endif /* DIJ_RINGZERO */
  106. /****************************************************************************
  107. *
  108. * Interfaces and Structures...
  109. *
  110. ****************************************************************************/
  111. #if(DIRECTINPUT_VERSION >= 0x0500)
  112. /****************************************************************************
  113. *
  114. * IDirectInputEffect
  115. *
  116. ****************************************************************************/
  117. #define DIEFT_ALL 0x00000000
  118. #define DIEFT_CONSTANTFORCE 0x00000001
  119. #define DIEFT_RAMPFORCE 0x00000002
  120. #define DIEFT_PERIODIC 0x00000003
  121. #define DIEFT_CONDITION 0x00000004
  122. #define DIEFT_CUSTOMFORCE 0x00000005
  123. #define DIEFT_HARDWARE 0x000000FF
  124. #define DIEFT_FFATTACK 0x00000200
  125. #define DIEFT_FFFADE 0x00000400
  126. #define DIEFT_SATURATION 0x00000800
  127. #define DIEFT_POSNEGCOEFFICIENTS 0x00001000
  128. #define DIEFT_POSNEGSATURATION 0x00002000
  129. #define DIEFT_DEADBAND 0x00004000
  130. #define DIEFT_STARTDELAY 0x00008000
  131. #define DIEFT_GETTYPE(n) LOBYTE(n)
  132. #define DI_DEGREES 100
  133. #define DI_FFNOMINALMAX 10000
  134. #define DI_SECONDS 1000000
  135. typedef struct DICONSTANTFORCE {
  136. LONG lMagnitude;
  137. } DICONSTANTFORCE, *LPDICONSTANTFORCE;
  138. typedef const DICONSTANTFORCE *LPCDICONSTANTFORCE;
  139. typedef struct DIRAMPFORCE {
  140. LONG lStart;
  141. LONG lEnd;
  142. } DIRAMPFORCE, *LPDIRAMPFORCE;
  143. typedef const DIRAMPFORCE *LPCDIRAMPFORCE;
  144. typedef struct DIPERIODIC {
  145. DWORD dwMagnitude;
  146. LONG lOffset;
  147. DWORD dwPhase;
  148. DWORD dwPeriod;
  149. } DIPERIODIC, *LPDIPERIODIC;
  150. typedef const DIPERIODIC *LPCDIPERIODIC;
  151. typedef struct DICONDITION {
  152. LONG lOffset;
  153. LONG lPositiveCoefficient;
  154. LONG lNegativeCoefficient;
  155. DWORD dwPositiveSaturation;
  156. DWORD dwNegativeSaturation;
  157. LONG lDeadBand;
  158. } DICONDITION, *LPDICONDITION;
  159. typedef const DICONDITION *LPCDICONDITION;
  160. typedef struct DICUSTOMFORCE {
  161. DWORD cChannels;
  162. DWORD dwSamplePeriod;
  163. DWORD cSamples;
  164. LPLONG rglForceData;
  165. } DICUSTOMFORCE, *LPDICUSTOMFORCE;
  166. typedef const DICUSTOMFORCE *LPCDICUSTOMFORCE;
  167. typedef struct DIENVELOPE {
  168. DWORD dwSize; /* sizeof(DIENVELOPE) */
  169. DWORD dwAttackLevel;
  170. DWORD dwAttackTime; /* Microseconds */
  171. DWORD dwFadeLevel;
  172. DWORD dwFadeTime; /* Microseconds */
  173. } DIENVELOPE, *LPDIENVELOPE;
  174. typedef const DIENVELOPE *LPCDIENVELOPE;
  175. /* This structure is defined for DirectX 5.0 compatibility */
  176. typedef struct DIEFFECT_DX5 {
  177. DWORD dwSize; /* sizeof(DIEFFECT_DX5) */
  178. DWORD dwFlags; /* DIEFF_* */
  179. DWORD dwDuration; /* Microseconds */
  180. DWORD dwSamplePeriod; /* Microseconds */
  181. DWORD dwGain;
  182. DWORD dwTriggerButton; /* or DIEB_NOTRIGGER */
  183. DWORD dwTriggerRepeatInterval; /* Microseconds */
  184. DWORD cAxes; /* Number of axes */
  185. LPDWORD rgdwAxes; /* Array of axes */
  186. LPLONG rglDirection; /* Array of directions */
  187. LPDIENVELOPE lpEnvelope; /* Optional */
  188. DWORD cbTypeSpecificParams; /* Size of params */
  189. LPVOID lpvTypeSpecificParams; /* Pointer to params */
  190. } DIEFFECT_DX5, *LPDIEFFECT_DX5;
  191. typedef const DIEFFECT_DX5 *LPCDIEFFECT_DX5;
  192. typedef struct DIEFFECT {
  193. DWORD dwSize; /* sizeof(DIEFFECT) */
  194. DWORD dwFlags; /* DIEFF_* */
  195. DWORD dwDuration; /* Microseconds */
  196. DWORD dwSamplePeriod; /* Microseconds */
  197. DWORD dwGain;
  198. DWORD dwTriggerButton; /* or DIEB_NOTRIGGER */
  199. DWORD dwTriggerRepeatInterval; /* Microseconds */
  200. DWORD cAxes; /* Number of axes */
  201. LPDWORD rgdwAxes; /* Array of axes */
  202. LPLONG rglDirection; /* Array of directions */
  203. LPDIENVELOPE lpEnvelope; /* Optional */
  204. DWORD cbTypeSpecificParams; /* Size of params */
  205. LPVOID lpvTypeSpecificParams; /* Pointer to params */
  206. #if(DIRECTINPUT_VERSION >= 0x0600)
  207. DWORD dwStartDelay; /* Microseconds */
  208. #endif /* DIRECTINPUT_VERSION >= 0x0600 */
  209. } DIEFFECT, *LPDIEFFECT;
  210. typedef DIEFFECT DIEFFECT_DX6;
  211. typedef LPDIEFFECT LPDIEFFECT_DX6;
  212. typedef const DIEFFECT *LPCDIEFFECT;
  213. #if(DIRECTINPUT_VERSION >= 0x0700)
  214. #ifndef DIJ_RINGZERO
  215. typedef struct DIFILEEFFECT{
  216. DWORD dwSize;
  217. GUID GuidEffect;
  218. LPCDIEFFECT lpDiEffect;
  219. CHAR szFriendlyName[MAX_PATH];
  220. }DIFILEEFFECT, *LPDIFILEEFFECT;
  221. typedef const DIFILEEFFECT *LPCDIFILEEFFECT;
  222. typedef BOOL (FAR PASCAL * LPDIENUMEFFECTSINFILECALLBACK)(LPCDIFILEEFFECT , LPVOID);
  223. #endif /* DIJ_RINGZERO */
  224. #endif /* DIRECTINPUT_VERSION >= 0x0700 */
  225. #define DIEFF_OBJECTIDS 0x00000001
  226. #define DIEFF_OBJECTOFFSETS 0x00000002
  227. #define DIEFF_CARTESIAN 0x00000010
  228. #define DIEFF_POLAR 0x00000020
  229. #define DIEFF_SPHERICAL 0x00000040
  230. #define DIEP_DURATION 0x00000001
  231. #define DIEP_SAMPLEPERIOD 0x00000002
  232. #define DIEP_GAIN 0x00000004
  233. #define DIEP_TRIGGERBUTTON 0x00000008
  234. #define DIEP_TRIGGERREPEATINTERVAL 0x00000010
  235. #define DIEP_AXES 0x00000020
  236. #define DIEP_DIRECTION 0x00000040
  237. #define DIEP_ENVELOPE 0x00000080
  238. #define DIEP_TYPESPECIFICPARAMS 0x00000100
  239. #if(DIRECTINPUT_VERSION >= 0x0600)
  240. #define DIEP_STARTDELAY 0x00000200
  241. #define DIEP_ALLPARAMS_DX5 0x000001FF
  242. #define DIEP_ALLPARAMS 0x000003FF
  243. #else /* DIRECTINPUT_VERSION < 0x0600 */
  244. #define DIEP_ALLPARAMS 0x000001FF
  245. #endif /* DIRECTINPUT_VERSION < 0x0600 */
  246. #define DIEP_START 0x20000000
  247. #define DIEP_NORESTART 0x40000000
  248. #define DIEP_NODOWNLOAD 0x80000000
  249. #define DIEB_NOTRIGGER 0xFFFFFFFF
  250. #define DIES_SOLO 0x00000001
  251. #define DIES_NODOWNLOAD 0x80000000
  252. #define DIEGES_PLAYING 0x00000001
  253. #define DIEGES_EMULATED 0x00000002
  254. typedef struct DIEFFESCAPE {
  255. DWORD dwSize;
  256. DWORD dwCommand;
  257. LPVOID lpvInBuffer;
  258. DWORD cbInBuffer;
  259. LPVOID lpvOutBuffer;
  260. DWORD cbOutBuffer;
  261. } DIEFFESCAPE, *LPDIEFFESCAPE;
  262. #ifndef DIJ_RINGZERO
  263. #undef INTERFACE
  264. #define INTERFACE IDirectInputEffect
  265. DECLARE_INTERFACE_(IDirectInputEffect, IUnknown)
  266. {
  267. /*** IUnknown methods ***/
  268. STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE;
  269. STDMETHOD_(ULONG,AddRef)(THIS) PURE;
  270. STDMETHOD_(ULONG,Release)(THIS) PURE;
  271. /*** IDirectInputEffect methods ***/
  272. STDMETHOD(Initialize)(THIS_ HINSTANCE,DWORD,REFGUID) PURE;
  273. STDMETHOD(GetEffectGuid)(THIS_ LPGUID) PURE;
  274. STDMETHOD(GetParameters)(THIS_ LPDIEFFECT,DWORD) PURE;
  275. STDMETHOD(SetParameters)(THIS_ LPCDIEFFECT,DWORD) PURE;
  276. STDMETHOD(Start)(THIS_ DWORD,DWORD) PURE;
  277. STDMETHOD(Stop)(THIS) PURE;
  278. STDMETHOD(GetEffectStatus)(THIS_ LPDWORD) PURE;
  279. STDMETHOD(Download)(THIS) PURE;
  280. STDMETHOD(Unload)(THIS) PURE;
  281. STDMETHOD(Escape)(THIS_ LPDIEFFESCAPE) PURE;
  282. };
  283. typedef struct IDirectInputEffect *LPDIRECTINPUTEFFECT;
  284. #if !defined(__cplusplus) || defined(CINTERFACE)
  285. #define IDirectInputEffect_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
  286. #define IDirectInputEffect_AddRef(p) (p)->lpVtbl->AddRef(p)
  287. #define IDirectInputEffect_Release(p) (p)->lpVtbl->Release(p)
  288. #define IDirectInputEffect_Initialize(p,a,b,c) (p)->lpVtbl->Initialize(p,a,b,c)
  289. #define IDirectInputEffect_GetEffectGuid(p,a) (p)->lpVtbl->GetEffectGuid(p,a)
  290. #define IDirectInputEffect_GetParameters(p,a,b) (p)->lpVtbl->GetParameters(p,a,b)
  291. #define IDirectInputEffect_SetParameters(p,a,b) (p)->lpVtbl->SetParameters(p,a,b)
  292. #define IDirectInputEffect_Start(p,a,b) (p)->lpVtbl->Start(p,a,b)
  293. #define IDirectInputEffect_Stop(p) (p)->lpVtbl->Stop(p)
  294. #define IDirectInputEffect_GetEffectStatus(p,a) (p)->lpVtbl->GetEffectStatus(p,a)
  295. #define IDirectInputEffect_Download(p) (p)->lpVtbl->Download(p)
  296. #define IDirectInputEffect_Unload(p) (p)->lpVtbl->Unload(p)
  297. #define IDirectInputEffect_Escape(p,a) (p)->lpVtbl->Escape(p,a)
  298. #else
  299. #define IDirectInputEffect_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
  300. #define IDirectInputEffect_AddRef(p) (p)->AddRef()
  301. #define IDirectInputEffect_Release(p) (p)->Release()
  302. #define IDirectInputEffect_Initialize(p,a,b,c) (p)->Initialize(a,b,c)
  303. #define IDirectInputEffect_GetEffectGuid(p,a) (p)->GetEffectGuid(a)
  304. #define IDirectInputEffect_GetParameters(p,a,b) (p)->GetParameters(a,b)
  305. #define IDirectInputEffect_SetParameters(p,a,b) (p)->SetParameters(a,b)
  306. #define IDirectInputEffect_Start(p,a,b) (p)->Start(a,b)
  307. #define IDirectInputEffect_Stop(p) (p)->Stop()
  308. #define IDirectInputEffect_GetEffectStatus(p,a) (p)->GetEffectStatus(a)
  309. #define IDirectInputEffect_Download(p) (p)->Download()
  310. #define IDirectInputEffect_Unload(p) (p)->Unload()
  311. #define IDirectInputEffect_Escape(p,a) (p)->Escape(a)
  312. #endif
  313. #endif /* DIJ_RINGZERO */
  314. #endif /* DIRECTINPUT_VERSION >= 0x0500 */
  315. /****************************************************************************
  316. *
  317. * IDirectInputDevice
  318. *
  319. ****************************************************************************/
  320. #define DIDEVTYPE_DEVICE 1
  321. #define DIDEVTYPE_MOUSE 2
  322. #define DIDEVTYPE_KEYBOARD 3
  323. #define DIDEVTYPE_JOYSTICK 4
  324. #define DIDEVTYPE_HID 0x00010000
  325. #define DIDEVTYPEMOUSE_UNKNOWN 1
  326. #define DIDEVTYPEMOUSE_TRADITIONAL 2
  327. #define DIDEVTYPEMOUSE_FINGERSTICK 3
  328. #define DIDEVTYPEMOUSE_TOUCHPAD 4
  329. #define DIDEVTYPEMOUSE_TRACKBALL 5
  330. #define DIDEVTYPEKEYBOARD_UNKNOWN 0
  331. #define DIDEVTYPEKEYBOARD_PCXT 1
  332. #define DIDEVTYPEKEYBOARD_OLIVETTI 2
  333. #define DIDEVTYPEKEYBOARD_PCAT 3
  334. #define DIDEVTYPEKEYBOARD_PCENH 4
  335. #define DIDEVTYPEKEYBOARD_NOKIA1050 5
  336. #define DIDEVTYPEKEYBOARD_NOKIA9140 6
  337. #define DIDEVTYPEKEYBOARD_NEC98 7
  338. #define DIDEVTYPEKEYBOARD_NEC98LAPTOP 8
  339. #define DIDEVTYPEKEYBOARD_NEC98106 9
  340. #define DIDEVTYPEKEYBOARD_JAPAN106 10
  341. #define DIDEVTYPEKEYBOARD_JAPANAX 11
  342. #define DIDEVTYPEKEYBOARD_J3100 12
  343. #define DIDEVTYPEJOYSTICK_UNKNOWN 1
  344. #define DIDEVTYPEJOYSTICK_TRADITIONAL 2
  345. #define DIDEVTYPEJOYSTICK_FLIGHTSTICK 3
  346. #define DIDEVTYPEJOYSTICK_GAMEPAD 4
  347. #define DIDEVTYPEJOYSTICK_RUDDER 5
  348. #define DIDEVTYPEJOYSTICK_WHEEL 6
  349. #define DIDEVTYPEJOYSTICK_HEADTRACKER 7
  350. #define GET_DIDEVICE_TYPE(dwDevType) LOBYTE(dwDevType)
  351. #define GET_DIDEVICE_SUBTYPE(dwDevType) HIBYTE(dwDevType)
  352. #if(DIRECTINPUT_VERSION >= 0x0500)
  353. /* This structure is defined for DirectX 3.0 compatibility */
  354. typedef struct DIDEVCAPS_DX3 {
  355. DWORD dwSize;
  356. DWORD dwFlags;
  357. DWORD dwDevType;
  358. DWORD dwAxes;
  359. DWORD dwButtons;
  360. DWORD dwPOVs;
  361. } DIDEVCAPS_DX3, *LPDIDEVCAPS_DX3;
  362. #endif /* DIRECTINPUT_VERSION >= 0x0500 */
  363. typedef struct DIDEVCAPS {
  364. DWORD dwSize;
  365. DWORD dwFlags;
  366. DWORD dwDevType;
  367. DWORD dwAxes;
  368. DWORD dwButtons;
  369. DWORD dwPOVs;
  370. #if(DIRECTINPUT_VERSION >= 0x0500)
  371. DWORD dwFFSamplePeriod;
  372. DWORD dwFFMinTimeResolution;
  373. DWORD dwFirmwareRevision;
  374. DWORD dwHardwareRevision;
  375. DWORD dwFFDriverVersion;
  376. #endif /* DIRECTINPUT_VERSION >= 0x0500 */
  377. } DIDEVCAPS, *LPDIDEVCAPS;
  378. #define DIDC_ATTACHED 0x00000001
  379. #define DIDC_POLLEDDEVICE 0x00000002
  380. #define DIDC_EMULATED 0x00000004
  381. #define DIDC_POLLEDDATAFORMAT 0x00000008
  382. #if(DIRECTINPUT_VERSION >= 0x0500)
  383. #define DIDC_FORCEFEEDBACK 0x00000100
  384. #define DIDC_FFATTACK 0x00000200
  385. #define DIDC_FFFADE 0x00000400
  386. #define DIDC_SATURATION 0x00000800
  387. #define DIDC_POSNEGCOEFFICIENTS 0x00001000
  388. #define DIDC_POSNEGSATURATION 0x00002000
  389. #define DIDC_DEADBAND 0x00004000
  390. #endif /* DIRECTINPUT_VERSION >= 0x0500 */
  391. #define DIDC_STARTDELAY 0x00008000
  392. #if(DIRECTINPUT_VERSION >= 0x050a)
  393. #define DIDC_ALIAS 0x00010000
  394. #define DIDC_PHANTOM 0x00020000
  395. #endif /* DIRECTINPUT_VERSION >= 0x050a */
  396. #define DIDFT_ALL 0x00000000
  397. #define DIDFT_RELAXIS 0x00000001
  398. #define DIDFT_ABSAXIS 0x00000002
  399. #define DIDFT_AXIS 0x00000003
  400. #define DIDFT_PSHBUTTON 0x00000004
  401. #define DIDFT_TGLBUTTON 0x00000008
  402. #define DIDFT_BUTTON 0x0000000C
  403. #define DIDFT_POV 0x00000010
  404. #define DIDFT_COLLECTION 0x00000040
  405. #define DIDFT_NODATA 0x00000080
  406. #define DIDFT_ANYINSTANCE 0x00FFFF00
  407. #define DIDFT_INSTANCEMASK DIDFT_ANYINSTANCE
  408. #define DIDFT_MAKEINSTANCE(n) ((WORD)(n) << 8)
  409. #define DIDFT_GETTYPE(n) LOBYTE(n)
  410. #define DIDFT_GETINSTANCE(n) LOWORD((n) >> 8)
  411. #define DIDFT_FFACTUATOR 0x01000000
  412. #define DIDFT_FFEFFECTTRIGGER 0x02000000
  413. #if(DIRECTINPUT_VERSION >= 0x050a)
  414. #define DIDFT_OUTPUT 0x10000000
  415. #define DIDFT_VENDORDEFINED 0x04000000
  416. #define DIDFT_ALIAS 0x08000000
  417. #endif /* DIRECTINPUT_VERSION >= 0x050a */
  418. #define DIDFT_ENUMCOLLECTION(n) ((WORD)(n) << 8)
  419. #define DIDFT_NOCOLLECTION 0x00FFFF00
  420. #ifndef DIJ_RINGZERO
  421. typedef struct _DIOBJECTDATAFORMAT {
  422. const GUID *pguid;
  423. DWORD dwOfs;
  424. DWORD dwType;
  425. DWORD dwFlags;
  426. } DIOBJECTDATAFORMAT, *LPDIOBJECTDATAFORMAT;
  427. typedef const DIOBJECTDATAFORMAT *LPCDIOBJECTDATAFORMAT;
  428. typedef struct _DIDATAFORMAT {
  429. DWORD dwSize;
  430. DWORD dwObjSize;
  431. DWORD dwFlags;
  432. DWORD dwDataSize;
  433. DWORD dwNumObjs;
  434. LPDIOBJECTDATAFORMAT rgodf;
  435. } DIDATAFORMAT, *LPDIDATAFORMAT;
  436. typedef const DIDATAFORMAT *LPCDIDATAFORMAT;
  437. #define DIDF_ABSAXIS 0x00000001
  438. #define DIDF_RELAXIS 0x00000002
  439. #ifdef __cplusplus
  440. extern "C" {
  441. #endif
  442. extern const DIDATAFORMAT c_dfDIMouse;
  443. #if(DIRECTINPUT_VERSION >= 0x0700)
  444. extern const DIDATAFORMAT c_dfDIMouse2;
  445. #endif /* DIRECTINPUT_VERSION >= 0x0700 */
  446. extern const DIDATAFORMAT c_dfDIKeyboard;
  447. #if(DIRECTINPUT_VERSION >= 0x0500)
  448. extern const DIDATAFORMAT c_dfDIJoystick;
  449. extern const DIDATAFORMAT c_dfDIJoystick2;
  450. #endif /* DIRECTINPUT_VERSION >= 0x0500 */
  451. #ifdef __cplusplus
  452. };
  453. #endif
  454. #if(DIRECTINPUT_VERSION >= 0x0500)
  455. /* These structures are defined for DirectX 3.0 compatibility */
  456. typedef struct DIDEVICEOBJECTINSTANCE_DX3A {
  457. DWORD dwSize;
  458. GUID guidType;
  459. DWORD dwOfs;
  460. DWORD dwType;
  461. DWORD dwFlags;
  462. CHAR tszName[MAX_PATH];
  463. } DIDEVICEOBJECTINSTANCE_DX3A, *LPDIDEVICEOBJECTINSTANCE_DX3A;
  464. typedef struct DIDEVICEOBJECTINSTANCE_DX3W {
  465. DWORD dwSize;
  466. GUID guidType;
  467. DWORD dwOfs;
  468. DWORD dwType;
  469. DWORD dwFlags;
  470. WCHAR tszName[MAX_PATH];
  471. } DIDEVICEOBJECTINSTANCE_DX3W, *LPDIDEVICEOBJECTINSTANCE_DX3W;
  472. #ifdef UNICODE
  473. typedef DIDEVICEOBJECTINSTANCE_DX3W DIDEVICEOBJECTINSTANCE_DX3;
  474. typedef LPDIDEVICEOBJECTINSTANCE_DX3W LPDIDEVICEOBJECTINSTANCE_DX3;
  475. #else
  476. typedef DIDEVICEOBJECTINSTANCE_DX3A DIDEVICEOBJECTINSTANCE_DX3;
  477. typedef LPDIDEVICEOBJECTINSTANCE_DX3A LPDIDEVICEOBJECTINSTANCE_DX3;
  478. #endif // UNICODE
  479. typedef const DIDEVICEOBJECTINSTANCE_DX3A *LPCDIDEVICEOBJECTINSTANCE_DX3A;
  480. typedef const DIDEVICEOBJECTINSTANCE_DX3W *LPCDIDEVICEOBJECTINSTANCE_DX3W;
  481. typedef const DIDEVICEOBJECTINSTANCE_DX3 *LPCDIDEVICEOBJECTINSTANCE_DX3;
  482. #endif /* DIRECTINPUT_VERSION >= 0x0500 */
  483. typedef struct DIDEVICEOBJECTINSTANCEA {
  484. DWORD dwSize;
  485. GUID guidType;
  486. DWORD dwOfs;
  487. DWORD dwType;
  488. DWORD dwFlags;
  489. CHAR tszName[MAX_PATH];
  490. #if(DIRECTINPUT_VERSION >= 0x0500)
  491. DWORD dwFFMaxForce;
  492. DWORD dwFFForceResolution;
  493. WORD wCollectionNumber;
  494. WORD wDesignatorIndex;
  495. WORD wUsagePage;
  496. WORD wUsage;
  497. DWORD dwDimension;
  498. WORD wExponent;
  499. WORD wReportId;
  500. #endif /* DIRECTINPUT_VERSION >= 0x0500 */
  501. } DIDEVICEOBJECTINSTANCEA, *LPDIDEVICEOBJECTINSTANCEA;
  502. typedef struct DIDEVICEOBJECTINSTANCEW {
  503. DWORD dwSize;
  504. GUID guidType;
  505. DWORD dwOfs;
  506. DWORD dwType;
  507. DWORD dwFlags;
  508. WCHAR tszName[MAX_PATH];
  509. #if(DIRECTINPUT_VERSION >= 0x0500)
  510. DWORD dwFFMaxForce;
  511. DWORD dwFFForceResolution;
  512. WORD wCollectionNumber;
  513. WORD wDesignatorIndex;
  514. WORD wUsagePage;
  515. WORD wUsage;
  516. DWORD dwDimension;
  517. WORD wExponent;
  518. WORD wReportId;
  519. #endif /* DIRECTINPUT_VERSION >= 0x0500 */
  520. } DIDEVICEOBJECTINSTANCEW, *LPDIDEVICEOBJECTINSTANCEW;
  521. #ifdef UNICODE
  522. typedef DIDEVICEOBJECTINSTANCEW DIDEVICEOBJECTINSTANCE;
  523. typedef LPDIDEVICEOBJECTINSTANCEW LPDIDEVICEOBJECTINSTANCE;
  524. #else
  525. typedef DIDEVICEOBJECTINSTANCEA DIDEVICEOBJECTINSTANCE;
  526. typedef LPDIDEVICEOBJECTINSTANCEA LPDIDEVICEOBJECTINSTANCE;
  527. #endif // UNICODE
  528. typedef const DIDEVICEOBJECTINSTANCEA *LPCDIDEVICEOBJECTINSTANCEA;
  529. typedef const DIDEVICEOBJECTINSTANCEW *LPCDIDEVICEOBJECTINSTANCEW;
  530. typedef const DIDEVICEOBJECTINSTANCE *LPCDIDEVICEOBJECTINSTANCE;
  531. typedef BOOL (FAR PASCAL * LPDIENUMDEVICEOBJECTSCALLBACKA)(LPCDIDEVICEOBJECTINSTANCEA, LPVOID);
  532. typedef BOOL (FAR PASCAL * LPDIENUMDEVICEOBJECTSCALLBACKW)(LPCDIDEVICEOBJECTINSTANCEW, LPVOID);
  533. #ifdef UNICODE
  534. #define LPDIENUMDEVICEOBJECTSCALLBACK LPDIENUMDEVICEOBJECTSCALLBACKW
  535. #else
  536. #define LPDIENUMDEVICEOBJECTSCALLBACK LPDIENUMDEVICEOBJECTSCALLBACKA
  537. #endif // !UNICODE
  538. #if(DIRECTINPUT_VERSION >= 0x0500)
  539. #define DIDOI_FFACTUATOR 0x00000001
  540. #define DIDOI_FFEFFECTTRIGGER 0x00000002
  541. #define DIDOI_POLLED 0x00008000
  542. #define DIDOI_ASPECTPOSITION 0x00000100
  543. #define DIDOI_ASPECTVELOCITY 0x00000200
  544. #define DIDOI_ASPECTACCEL 0x00000300
  545. #define DIDOI_ASPECTFORCE 0x00000400
  546. #define DIDOI_ASPECTMASK 0x00000F00
  547. #endif /* DIRECTINPUT_VERSION >= 0x0500 */
  548. #if(DIRECTINPUT_VERSION >= 0x050a)
  549. #define DIDOI_GUIDISUSAGE 0x00010000
  550. #endif /* DIRECTINPUT_VERSION >= 0x050a */
  551. typedef struct DIPROPHEADER {
  552. DWORD dwSize;
  553. DWORD dwHeaderSize;
  554. DWORD dwObj;
  555. DWORD dwHow;
  556. } DIPROPHEADER, *LPDIPROPHEADER;
  557. typedef const DIPROPHEADER *LPCDIPROPHEADER;
  558. #define DIPH_DEVICE 0
  559. #define DIPH_BYOFFSET 1
  560. #define DIPH_BYID 2
  561. #if(DIRECTINPUT_VERSION >= 0x050a)
  562. #define DIPH_BYUSAGE 3
  563. #define DIMAKEUSAGEDWORD(UsagePage, Usage) \
  564. (DWORD)MAKELONG(Usage, UsagePage)
  565. #endif /* DIRECTINPUT_VERSION >= 0x050a */
  566. typedef struct DIPROPDWORD {
  567. DIPROPHEADER diph;
  568. DWORD dwData;
  569. } DIPROPDWORD, *LPDIPROPDWORD;
  570. typedef const DIPROPDWORD *LPCDIPROPDWORD;
  571. typedef struct DIPROPRANGE {
  572. DIPROPHEADER diph;
  573. LONG lMin;
  574. LONG lMax;
  575. } DIPROPRANGE, *LPDIPROPRANGE;
  576. typedef const DIPROPRANGE *LPCDIPROPRANGE;
  577. #define DIPROPRANGE_NOMIN ((LONG)0x80000000)
  578. #define DIPROPRANGE_NOMAX ((LONG)0x7FFFFFFF)
  579. #if(DIRECTINPUT_VERSION >= 0x050a)
  580. typedef struct DIPROPCAL {
  581. DIPROPHEADER diph;
  582. LONG lMin;
  583. LONG lCenter;
  584. LONG lMax;
  585. } DIPROPCAL, *LPDIPROPCAL;
  586. typedef const DIPROPCAL *LPCDIPROPCAL;
  587. typedef struct DIPROPGUIDANDPATH {
  588. DIPROPHEADER diph;
  589. GUID guidClass;
  590. WCHAR wszPath[MAX_PATH];
  591. } DIPROPGUIDANDPATH, *LPDIPROPGUIDANDPATH;
  592. typedef const DIPROPGUIDANDPATH *LPCDIPROPGUIDANDPATH;
  593. typedef struct DIPROPSTRING {
  594. DIPROPHEADER diph;
  595. WCHAR wsz[MAX_PATH];
  596. } DIPROPSTRING, *LPDIPROPSTRING;
  597. typedef const DIPROPSTRING *LPCDIPROPSTRING;
  598. #endif /* DIRECTINPUT_VERSION >= 0x050a */
  599. #ifdef __cplusplus
  600. #define MAKEDIPROP(prop) (*(const GUID *)(prop))
  601. #else
  602. #define MAKEDIPROP(prop) ((REFGUID)(prop))
  603. #endif
  604. #define DIPROP_BUFFERSIZE MAKEDIPROP(1)
  605. #define DIPROP_AXISMODE MAKEDIPROP(2)
  606. #define DIPROPAXISMODE_ABS 0
  607. #define DIPROPAXISMODE_REL 1
  608. #define DIPROP_GRANULARITY MAKEDIPROP(3)
  609. #define DIPROP_RANGE MAKEDIPROP(4)
  610. #define DIPROP_DEADZONE MAKEDIPROP(5)
  611. #define DIPROP_SATURATION MAKEDIPROP(6)
  612. #define DIPROP_FFGAIN MAKEDIPROP(7)
  613. #define DIPROP_FFLOAD MAKEDIPROP(8)
  614. #define DIPROP_AUTOCENTER MAKEDIPROP(9)
  615. #define DIPROPAUTOCENTER_OFF 0
  616. #define DIPROPAUTOCENTER_ON 1
  617. #define DIPROP_CALIBRATIONMODE MAKEDIPROP(10)
  618. #define DIPROPCALIBRATIONMODE_COOKED 0
  619. #define DIPROPCALIBRATIONMODE_RAW 1
  620. #if(DIRECTINPUT_VERSION >= 0x050a)
  621. #define DIPROP_CALIBRATION MAKEDIPROP(11)
  622. #define DIPROP_GUIDANDPATH MAKEDIPROP(12)
  623. #define DIPROP_INSTANCENAME MAKEDIPROP(13)
  624. #define DIPROP_PRODUCTNAME MAKEDIPROP(14)
  625. #endif /* DIRECTINPUT_VERSION >= 0x050a */
  626. #define DIPROP_JOYSTICKID MAKEDIPROP(15)
  627. #define DIPROP_GETPORTDISPLAYNAME MAKEDIPROP(16)
  628. #define DIPROP_ENABLEREPORTID MAKEDIPROP(17)
  629. #define DIPROP_GETPHYSICALRANGE MAKEDIPROP(18)
  630. #define DIPROP_GETLOGICALRANGE MAKEDIPROP(19)
  631. typedef struct DIDEVICEOBJECTDATA {
  632. DWORD dwOfs;
  633. DWORD dwData;
  634. DWORD dwTimeStamp;
  635. DWORD dwSequence;
  636. } DIDEVICEOBJECTDATA, *LPDIDEVICEOBJECTDATA;
  637. typedef const DIDEVICEOBJECTDATA *LPCDIDEVICEOBJECTDATA;
  638. #define DIGDD_PEEK 0x00000001
  639. #define DISEQUENCE_COMPARE(dwSequence1, cmp, dwSequence2) \
  640. ((int)((dwSequence1) - (dwSequence2)) cmp 0)
  641. #define DISCL_EXCLUSIVE 0x00000001
  642. #define DISCL_NONEXCLUSIVE 0x00000002
  643. #define DISCL_FOREGROUND 0x00000004
  644. #define DISCL_BACKGROUND 0x00000008
  645. #define DISCL_NOWINKEY 0x00000010
  646. #if(DIRECTINPUT_VERSION >= 0x0500)
  647. /* These structures are defined for DirectX 3.0 compatibility */
  648. typedef struct DIDEVICEINSTANCE_DX3A {
  649. DWORD dwSize;
  650. GUID guidInstance;
  651. GUID guidProduct;
  652. DWORD dwDevType;
  653. CHAR tszInstanceName[MAX_PATH];
  654. CHAR tszProductName[MAX_PATH];
  655. } DIDEVICEINSTANCE_DX3A, *LPDIDEVICEINSTANCE_DX3A;
  656. typedef struct DIDEVICEINSTANCE_DX3W {
  657. DWORD dwSize;
  658. GUID guidInstance;
  659. GUID guidProduct;
  660. DWORD dwDevType;
  661. WCHAR tszInstanceName[MAX_PATH];
  662. WCHAR tszProductName[MAX_PATH];
  663. } DIDEVICEINSTANCE_DX3W, *LPDIDEVICEINSTANCE_DX3W;
  664. #ifdef UNICODE
  665. typedef DIDEVICEINSTANCE_DX3W DIDEVICEINSTANCE_DX3;
  666. typedef LPDIDEVICEINSTANCE_DX3W LPDIDEVICEINSTANCE_DX3;
  667. #else
  668. typedef DIDEVICEINSTANCE_DX3A DIDEVICEINSTANCE_DX3;
  669. typedef LPDIDEVICEINSTANCE_DX3A LPDIDEVICEINSTANCE_DX3;
  670. #endif // UNICODE
  671. typedef const DIDEVICEINSTANCE_DX3A *LPCDIDEVICEINSTANCE_DX3A;
  672. typedef const DIDEVICEINSTANCE_DX3W *LPCDIDEVICEINSTANCE_DX3W;
  673. typedef const DIDEVICEINSTANCE_DX3 *LPCDIDEVICEINSTANCE_DX3;
  674. #endif /* DIRECTINPUT_VERSION >= 0x0500 */
  675. typedef struct DIDEVICEINSTANCEA {
  676. DWORD dwSize;
  677. GUID guidInstance;
  678. GUID guidProduct;
  679. DWORD dwDevType;
  680. CHAR tszInstanceName[MAX_PATH];
  681. CHAR tszProductName[MAX_PATH];
  682. #if(DIRECTINPUT_VERSION >= 0x0500)
  683. GUID guidFFDriver;
  684. WORD wUsagePage;
  685. WORD wUsage;
  686. #endif /* DIRECTINPUT_VERSION >= 0x0500 */
  687. } DIDEVICEINSTANCEA, *LPDIDEVICEINSTANCEA;
  688. typedef struct DIDEVICEINSTANCEW {
  689. DWORD dwSize;
  690. GUID guidInstance;
  691. GUID guidProduct;
  692. DWORD dwDevType;
  693. WCHAR tszInstanceName[MAX_PATH];
  694. WCHAR tszProductName[MAX_PATH];
  695. #if(DIRECTINPUT_VERSION >= 0x0500)
  696. GUID guidFFDriver;
  697. WORD wUsagePage;
  698. WORD wUsage;
  699. #endif /* DIRECTINPUT_VERSION >= 0x0500 */
  700. } DIDEVICEINSTANCEW, *LPDIDEVICEINSTANCEW;
  701. #ifdef UNICODE
  702. typedef DIDEVICEINSTANCEW DIDEVICEINSTANCE;
  703. typedef LPDIDEVICEINSTANCEW LPDIDEVICEINSTANCE;
  704. #else
  705. typedef DIDEVICEINSTANCEA DIDEVICEINSTANCE;
  706. typedef LPDIDEVICEINSTANCEA LPDIDEVICEINSTANCE;
  707. #endif // UNICODE
  708. typedef const DIDEVICEINSTANCEA *LPCDIDEVICEINSTANCEA;
  709. typedef const DIDEVICEINSTANCEW *LPCDIDEVICEINSTANCEW;
  710. typedef const DIDEVICEINSTANCE *LPCDIDEVICEINSTANCE;
  711. #undef INTERFACE
  712. #define INTERFACE IDirectInputDeviceW
  713. DECLARE_INTERFACE_(IDirectInputDeviceW, IUnknown)
  714. {
  715. /*** IUnknown methods ***/
  716. STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE;
  717. STDMETHOD_(ULONG,AddRef)(THIS) PURE;
  718. STDMETHOD_(ULONG,Release)(THIS) PURE;
  719. /*** IDirectInputDeviceW methods ***/
  720. STDMETHOD(GetCapabilities)(THIS_ LPDIDEVCAPS) PURE;
  721. STDMETHOD(EnumObjects)(THIS_ LPDIENUMDEVICEOBJECTSCALLBACKW,LPVOID,DWORD) PURE;
  722. STDMETHOD(GetProperty)(THIS_ REFGUID,LPDIPROPHEADER) PURE;
  723. STDMETHOD(SetProperty)(THIS_ REFGUID,LPCDIPROPHEADER) PURE;
  724. STDMETHOD(Acquire)(THIS) PURE;
  725. STDMETHOD(Unacquire)(THIS) PURE;
  726. STDMETHOD(GetDeviceState)(THIS_ DWORD,LPVOID) PURE;
  727. STDMETHOD(GetDeviceData)(THIS_ DWORD,LPDIDEVICEOBJECTDATA,LPDWORD,DWORD) PURE;
  728. STDMETHOD(SetDataFormat)(THIS_ LPCDIDATAFORMAT) PURE;
  729. STDMETHOD(SetEventNotification)(THIS_ HANDLE) PURE;
  730. STDMETHOD(SetCooperativeLevel)(THIS_ HWND,DWORD) PURE;
  731. STDMETHOD(GetObjectInfo)(THIS_ LPDIDEVICEOBJECTINSTANCEW,DWORD,DWORD) PURE;
  732. STDMETHOD(GetDeviceInfo)(THIS_ LPDIDEVICEINSTANCEW) PURE;
  733. STDMETHOD(RunControlPanel)(THIS_ HWND,DWORD) PURE;
  734. STDMETHOD(Initialize)(THIS_ HINSTANCE,DWORD,REFGUID) PURE;
  735. };
  736. typedef struct IDirectInputDeviceW *LPDIRECTINPUTDEVICEW;
  737. #undef INTERFACE
  738. #define INTERFACE IDirectInputDeviceA
  739. DECLARE_INTERFACE_(IDirectInputDeviceA, IUnknown)
  740. {
  741. /*** IUnknown methods ***/
  742. STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE;
  743. STDMETHOD_(ULONG,AddRef)(THIS) PURE;
  744. STDMETHOD_(ULONG,Release)(THIS) PURE;
  745. /*** IDirectInputDeviceA methods ***/
  746. STDMETHOD(GetCapabilities)(THIS_ LPDIDEVCAPS) PURE;
  747. STDMETHOD(EnumObjects)(THIS_ LPDIENUMDEVICEOBJECTSCALLBACKA,LPVOID,DWORD) PURE;
  748. STDMETHOD(GetProperty)(THIS_ REFGUID,LPDIPROPHEADER) PURE;
  749. STDMETHOD(SetProperty)(THIS_ REFGUID,LPCDIPROPHEADER) PURE;
  750. STDMETHOD(Acquire)(THIS) PURE;
  751. STDMETHOD(Unacquire)(THIS) PURE;
  752. STDMETHOD(GetDeviceState)(THIS_ DWORD,LPVOID) PURE;
  753. STDMETHOD(GetDeviceData)(THIS_ DWORD,LPDIDEVICEOBJECTDATA,LPDWORD,DWORD) PURE;
  754. STDMETHOD(SetDataFormat)(THIS_ LPCDIDATAFORMAT) PURE;
  755. STDMETHOD(SetEventNotification)(THIS_ HANDLE) PURE;
  756. STDMETHOD(SetCooperativeLevel)(THIS_ HWND,DWORD) PURE;
  757. STDMETHOD(GetObjectInfo)(THIS_ LPDIDEVICEOBJECTINSTANCEA,DWORD,DWORD) PURE;
  758. STDMETHOD(GetDeviceInfo)(THIS_ LPDIDEVICEINSTANCEA) PURE;
  759. STDMETHOD(RunControlPanel)(THIS_ HWND,DWORD) PURE;
  760. STDMETHOD(Initialize)(THIS_ HINSTANCE,DWORD,REFGUID) PURE;
  761. };
  762. typedef struct IDirectInputDeviceA *LPDIRECTINPUTDEVICEA;
  763. #ifdef UNICODE
  764. #define IID_IDirectInputDevice IID_IDirectInputDeviceW
  765. #define IDirectInputDevice IDirectInputDeviceW
  766. #define IDirectInputDeviceVtbl IDirectInputDeviceWVtbl
  767. #else
  768. #define IID_IDirectInputDevice IID_IDirectInputDeviceA
  769. #define IDirectInputDevice IDirectInputDeviceA
  770. #define IDirectInputDeviceVtbl IDirectInputDeviceAVtbl
  771. #endif
  772. typedef struct IDirectInputDevice *LPDIRECTINPUTDEVICE;
  773. #if !defined(__cplusplus) || defined(CINTERFACE)
  774. #define IDirectInputDevice_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
  775. #define IDirectInputDevice_AddRef(p) (p)->lpVtbl->AddRef(p)
  776. #define IDirectInputDevice_Release(p) (p)->lpVtbl->Release(p)
  777. #define IDirectInputDevice_GetCapabilities(p,a) (p)->lpVtbl->GetCapabilities(p,a)
  778. #define IDirectInputDevice_EnumObjects(p,a,b,c) (p)->lpVtbl->EnumObjects(p,a,b,c)
  779. #define IDirectInputDevice_GetProperty(p,a,b) (p)->lpVtbl->GetProperty(p,a,b)
  780. #define IDirectInputDevice_SetProperty(p,a,b) (p)->lpVtbl->SetProperty(p,a,b)
  781. #define IDirectInputDevice_Acquire(p) (p)->lpVtbl->Acquire(p)
  782. #define IDirectInputDevice_Unacquire(p) (p)->lpVtbl->Unacquire(p)
  783. #define IDirectInputDevice_GetDeviceState(p,a,b) (p)->lpVtbl->GetDeviceState(p,a,b)
  784. #define IDirectInputDevice_GetDeviceData(p,a,b,c,d) (p)->lpVtbl->GetDeviceData(p,a,b,c,d)
  785. #define IDirectInputDevice_SetDataFormat(p,a) (p)->lpVtbl->SetDataFormat(p,a)
  786. #define IDirectInputDevice_SetEventNotification(p,a) (p)->lpVtbl->SetEventNotification(p,a)
  787. #define IDirectInputDevice_SetCooperativeLevel(p,a,b) (p)->lpVtbl->SetCooperativeLevel(p,a,b)
  788. #define IDirectInputDevice_GetObjectInfo(p,a,b,c) (p)->lpVtbl->GetObjectInfo(p,a,b,c)
  789. #define IDirectInputDevice_GetDeviceInfo(p,a) (p)->lpVtbl->GetDeviceInfo(p,a)
  790. #define IDirectInputDevice_RunControlPanel(p,a,b) (p)->lpVtbl->RunControlPanel(p,a,b)
  791. #define IDirectInputDevice_Initialize(p,a,b,c) (p)->lpVtbl->Initialize(p,a,b,c)
  792. #else
  793. #define IDirectInputDevice_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
  794. #define IDirectInputDevice_AddRef(p) (p)->AddRef()
  795. #define IDirectInputDevice_Release(p) (p)->Release()
  796. #define IDirectInputDevice_GetCapabilities(p,a) (p)->GetCapabilities(a)
  797. #define IDirectInputDevice_EnumObjects(p,a,b,c) (p)->EnumObjects(a,b,c)
  798. #define IDirectInputDevice_GetProperty(p,a,b) (p)->GetProperty(a,b)
  799. #define IDirectInputDevice_SetProperty(p,a,b) (p)->SetProperty(a,b)
  800. #define IDirectInputDevice_Acquire(p) (p)->Acquire()
  801. #define IDirectInputDevice_Unacquire(p) (p)->Unacquire()
  802. #define IDirectInputDevice_GetDeviceState(p,a,b) (p)->GetDeviceState(a,b)
  803. #define IDirectInputDevice_GetDeviceData(p,a,b,c,d) (p)->GetDeviceData(a,b,c,d)
  804. #define IDirectInputDevice_SetDataFormat(p,a) (p)->SetDataFormat(a)
  805. #define IDirectInputDevice_SetEventNotification(p,a) (p)->SetEventNotification(a)
  806. #define IDirectInputDevice_SetCooperativeLevel(p,a,b) (p)->SetCooperativeLevel(a,b)
  807. #define IDirectInputDevice_GetObjectInfo(p,a,b,c) (p)->GetObjectInfo(a,b,c)
  808. #define IDirectInputDevice_GetDeviceInfo(p,a) (p)->GetDeviceInfo(a)
  809. #define IDirectInputDevice_RunControlPanel(p,a,b) (p)->RunControlPanel(a,b)
  810. #define IDirectInputDevice_Initialize(p,a,b,c) (p)->Initialize(a,b,c)
  811. #endif
  812. #endif /* DIJ_RINGZERO */
  813. #if(DIRECTINPUT_VERSION >= 0x0500)
  814. #define DISFFC_RESET 0x00000001
  815. #define DISFFC_STOPALL 0x00000002
  816. #define DISFFC_PAUSE 0x00000004
  817. #define DISFFC_CONTINUE 0x00000008
  818. #define DISFFC_SETACTUATORSON 0x00000010
  819. #define DISFFC_SETACTUATORSOFF 0x00000020
  820. #define DIGFFS_EMPTY 0x00000001
  821. #define DIGFFS_STOPPED 0x00000002
  822. #define DIGFFS_PAUSED 0x00000004
  823. #define DIGFFS_ACTUATORSON 0x00000010
  824. #define DIGFFS_ACTUATORSOFF 0x00000020
  825. #define DIGFFS_POWERON 0x00000040
  826. #define DIGFFS_POWEROFF 0x00000080
  827. #define DIGFFS_SAFETYSWITCHON 0x00000100
  828. #define DIGFFS_SAFETYSWITCHOFF 0x00000200
  829. #define DIGFFS_USERFFSWITCHON 0x00000400
  830. #define DIGFFS_USERFFSWITCHOFF 0x00000800
  831. #define DIGFFS_DEVICELOST 0x80000000
  832. #ifndef DIJ_RINGZERO
  833. typedef struct DIEFFECTINFOA {
  834. DWORD dwSize;
  835. GUID guid;
  836. DWORD dwEffType;
  837. DWORD dwStaticParams;
  838. DWORD dwDynamicParams;
  839. CHAR tszName[MAX_PATH];
  840. } DIEFFECTINFOA, *LPDIEFFECTINFOA;
  841. typedef struct DIEFFECTINFOW {
  842. DWORD dwSize;
  843. GUID guid;
  844. DWORD dwEffType;
  845. DWORD dwStaticParams;
  846. DWORD dwDynamicParams;
  847. WCHAR tszName[MAX_PATH];
  848. } DIEFFECTINFOW, *LPDIEFFECTINFOW;
  849. #ifdef UNICODE
  850. typedef DIEFFECTINFOW DIEFFECTINFO;
  851. typedef LPDIEFFECTINFOW LPDIEFFECTINFO;
  852. #else
  853. typedef DIEFFECTINFOA DIEFFECTINFO;
  854. typedef LPDIEFFECTINFOA LPDIEFFECTINFO;
  855. #endif // UNICODE
  856. typedef const DIEFFECTINFOA *LPCDIEFFECTINFOA;
  857. typedef const DIEFFECTINFOW *LPCDIEFFECTINFOW;
  858. typedef const DIEFFECTINFO *LPCDIEFFECTINFO;
  859. #define DISDD_CONTINUE 0x00000001
  860. typedef BOOL (FAR PASCAL * LPDIENUMEFFECTSCALLBACKA)(LPCDIEFFECTINFOA, LPVOID);
  861. typedef BOOL (FAR PASCAL * LPDIENUMEFFECTSCALLBACKW)(LPCDIEFFECTINFOW, LPVOID);
  862. #ifdef UNICODE
  863. #define LPDIENUMEFFECTSCALLBACK LPDIENUMEFFECTSCALLBACKW
  864. #else
  865. #define LPDIENUMEFFECTSCALLBACK LPDIENUMEFFECTSCALLBACKA
  866. #endif // !UNICODE
  867. typedef BOOL (FAR PASCAL * LPDIENUMCREATEDEFFECTOBJECTSCALLBACK)(LPDIRECTINPUTEFFECT, LPVOID);
  868. #undef INTERFACE
  869. #define INTERFACE IDirectInputDevice2W
  870. DECLARE_INTERFACE_(IDirectInputDevice2W, IDirectInputDeviceW)
  871. {
  872. /*** IUnknown methods ***/
  873. STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE;
  874. STDMETHOD_(ULONG,AddRef)(THIS) PURE;
  875. STDMETHOD_(ULONG,Release)(THIS) PURE;
  876. /*** IDirectInputDeviceW methods ***/
  877. STDMETHOD(GetCapabilities)(THIS_ LPDIDEVCAPS) PURE;
  878. STDMETHOD(EnumObjects)(THIS_ LPDIENUMDEVICEOBJECTSCALLBACKW,LPVOID,DWORD) PURE;
  879. STDMETHOD(GetProperty)(THIS_ REFGUID,LPDIPROPHEADER) PURE;
  880. STDMETHOD(SetProperty)(THIS_ REFGUID,LPCDIPROPHEADER) PURE;
  881. STDMETHOD(Acquire)(THIS) PURE;
  882. STDMETHOD(Unacquire)(THIS) PURE;
  883. STDMETHOD(GetDeviceState)(THIS_ DWORD,LPVOID) PURE;
  884. STDMETHOD(GetDeviceData)(THIS_ DWORD,LPDIDEVICEOBJECTDATA,LPDWORD,DWORD) PURE;
  885. STDMETHOD(SetDataFormat)(THIS_ LPCDIDATAFORMAT) PURE;
  886. STDMETHOD(SetEventNotification)(THIS_ HANDLE) PURE;
  887. STDMETHOD(SetCooperativeLevel)(THIS_ HWND,DWORD) PURE;
  888. STDMETHOD(GetObjectInfo)(THIS_ LPDIDEVICEOBJECTINSTANCEW,DWORD,DWORD) PURE;
  889. STDMETHOD(GetDeviceInfo)(THIS_ LPDIDEVICEINSTANCEW) PURE;
  890. STDMETHOD(RunControlPanel)(THIS_ HWND,DWORD) PURE;
  891. STDMETHOD(Initialize)(THIS_ HINSTANCE,DWORD,REFGUID) PURE;
  892. /*** IDirectInputDevice2W methods ***/
  893. STDMETHOD(CreateEffect)(THIS_ REFGUID,LPCDIEFFECT,LPDIRECTINPUTEFFECT *,LPUNKNOWN) PURE;
  894. STDMETHOD(EnumEffects)(THIS_ LPDIENUMEFFECTSCALLBACKW,LPVOID,DWORD) PURE;
  895. STDMETHOD(GetEffectInfo)(THIS_ LPDIEFFECTINFOW,REFGUID) PURE;
  896. STDMETHOD(GetForceFeedbackState)(THIS_ LPDWORD) PURE;
  897. STDMETHOD(SendForceFeedbackCommand)(THIS_ DWORD) PURE;
  898. STDMETHOD(EnumCreatedEffectObjects)(THIS_ LPDIENUMCREATEDEFFECTOBJECTSCALLBACK,LPVOID,DWORD) PURE;
  899. STDMETHOD(Escape)(THIS_ LPDIEFFESCAPE) PURE;
  900. STDMETHOD(Poll)(THIS) PURE;
  901. STDMETHOD(SendDeviceData)(THIS_ DWORD,LPCDIDEVICEOBJECTDATA,LPDWORD,DWORD) PURE;
  902. };
  903. typedef struct IDirectInputDevice2W *LPDIRECTINPUTDEVICE2W;
  904. #undef INTERFACE
  905. #define INTERFACE IDirectInputDevice2A
  906. DECLARE_INTERFACE_(IDirectInputDevice2A, IDirectInputDeviceA)
  907. {
  908. /*** IUnknown methods ***/
  909. STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE;
  910. STDMETHOD_(ULONG,AddRef)(THIS) PURE;
  911. STDMETHOD_(ULONG,Release)(THIS) PURE;
  912. /*** IDirectInputDeviceA methods ***/
  913. STDMETHOD(GetCapabilities)(THIS_ LPDIDEVCAPS) PURE;
  914. STDMETHOD(EnumObjects)(THIS_ LPDIENUMDEVICEOBJECTSCALLBACKA,LPVOID,DWORD) PURE;
  915. STDMETHOD(GetProperty)(THIS_ REFGUID,LPDIPROPHEADER) PURE;
  916. STDMETHOD(SetProperty)(THIS_ REFGUID,LPCDIPROPHEADER) PURE;
  917. STDMETHOD(Acquire)(THIS) PURE;
  918. STDMETHOD(Unacquire)(THIS) PURE;
  919. STDMETHOD(GetDeviceState)(THIS_ DWORD,LPVOID) PURE;
  920. STDMETHOD(GetDeviceData)(THIS_ DWORD,LPDIDEVICEOBJECTDATA,LPDWORD,DWORD) PURE;
  921. STDMETHOD(SetDataFormat)(THIS_ LPCDIDATAFORMAT) PURE;
  922. STDMETHOD(SetEventNotification)(THIS_ HANDLE) PURE;
  923. STDMETHOD(SetCooperativeLevel)(THIS_ HWND,DWORD) PURE;
  924. STDMETHOD(GetObjectInfo)(THIS_ LPDIDEVICEOBJECTINSTANCEA,DWORD,DWORD) PURE;
  925. STDMETHOD(GetDeviceInfo)(THIS_ LPDIDEVICEINSTANCEA) PURE;
  926. STDMETHOD(RunControlPanel)(THIS_ HWND,DWORD) PURE;
  927. STDMETHOD(Initialize)(THIS_ HINSTANCE,DWORD,REFGUID) PURE;
  928. /*** IDirectInputDevice2A methods ***/
  929. STDMETHOD(CreateEffect)(THIS_ REFGUID,LPCDIEFFECT,LPDIRECTINPUTEFFECT *,LPUNKNOWN) PURE;
  930. STDMETHOD(EnumEffects)(THIS_ LPDIENUMEFFECTSCALLBACKA,LPVOID,DWORD) PURE;
  931. STDMETHOD(GetEffectInfo)(THIS_ LPDIEFFECTINFOA,REFGUID) PURE;
  932. STDMETHOD(GetForceFeedbackState)(THIS_ LPDWORD) PURE;
  933. STDMETHOD(SendForceFeedbackCommand)(THIS_ DWORD) PURE;
  934. STDMETHOD(EnumCreatedEffectObjects)(THIS_ LPDIENUMCREATEDEFFECTOBJECTSCALLBACK,LPVOID,DWORD) PURE;
  935. STDMETHOD(Escape)(THIS_ LPDIEFFESCAPE) PURE;
  936. STDMETHOD(Poll)(THIS) PURE;
  937. STDMETHOD(SendDeviceData)(THIS_ DWORD,LPCDIDEVICEOBJECTDATA,LPDWORD,DWORD) PURE;
  938. };
  939. typedef struct IDirectInputDevice2A *LPDIRECTINPUTDEVICE2A;
  940. #ifdef UNICODE
  941. #define IID_IDirectInputDevice2 IID_IDirectInputDevice2W
  942. #define IDirectInputDevice2 IDirectInputDevice2W
  943. #define IDirectInputDevice2Vtbl IDirectInputDevice2WVtbl
  944. #else
  945. #define IID_IDirectInputDevice2 IID_IDirectInputDevice2A
  946. #define IDirectInputDevice2 IDirectInputDevice2A
  947. #define IDirectInputDevice2Vtbl IDirectInputDevice2AVtbl
  948. #endif
  949. typedef struct IDirectInputDevice2 *LPDIRECTINPUTDEVICE2;
  950. #if !defined(__cplusplus) || defined(CINTERFACE)
  951. #define IDirectInputDevice2_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
  952. #define IDirectInputDevice2_AddRef(p) (p)->lpVtbl->AddRef(p)
  953. #define IDirectInputDevice2_Release(p) (p)->lpVtbl->Release(p)
  954. #define IDirectInputDevice2_GetCapabilities(p,a) (p)->lpVtbl->GetCapabilities(p,a)
  955. #define IDirectInputDevice2_EnumObjects(p,a,b,c) (p)->lpVtbl->EnumObjects(p,a,b,c)
  956. #define IDirectInputDevice2_GetProperty(p,a,b) (p)->lpVtbl->GetProperty(p,a,b)
  957. #define IDirectInputDevice2_SetProperty(p,a,b) (p)->lpVtbl->SetProperty(p,a,b)
  958. #define IDirectInputDevice2_Acquire(p) (p)->lpVtbl->Acquire(p)
  959. #define IDirectInputDevice2_Unacquire(p) (p)->lpVtbl->Unacquire(p)
  960. #define IDirectInputDevice2_GetDeviceState(p,a,b) (p)->lpVtbl->GetDeviceState(p,a,b)
  961. #define IDirectInputDevice2_GetDeviceData(p,a,b,c,d) (p)->lpVtbl->GetDeviceData(p,a,b,c,d)
  962. #define IDirectInputDevice2_SetDataFormat(p,a) (p)->lpVtbl->SetDataFormat(p,a)
  963. #define IDirectInputDevice2_SetEventNotification(p,a) (p)->lpVtbl->SetEventNotification(p,a)
  964. #define IDirectInputDevice2_SetCooperativeLevel(p,a,b) (p)->lpVtbl->SetCooperativeLevel(p,a,b)
  965. #define IDirectInputDevice2_GetObjectInfo(p,a,b,c) (p)->lpVtbl->GetObjectInfo(p,a,b,c)
  966. #define IDirectInputDevice2_GetDeviceInfo(p,a) (p)->lpVtbl->GetDeviceInfo(p,a)
  967. #define IDirectInputDevice2_RunControlPanel(p,a,b) (p)->lpVtbl->RunControlPanel(p,a,b)
  968. #define IDirectInputDevice2_Initialize(p,a,b,c) (p)->lpVtbl->Initialize(p,a,b,c)
  969. #define IDirectInputDevice2_CreateEffect(p,a,b,c,d) (p)->lpVtbl->CreateEffect(p,a,b,c,d)
  970. #define IDirectInputDevice2_EnumEffects(p,a,b,c) (p)->lpVtbl->EnumEffects(p,a,b,c)
  971. #define IDirectInputDevice2_GetEffectInfo(p,a,b) (p)->lpVtbl->GetEffectInfo(p,a,b)
  972. #define IDirectInputDevice2_GetForceFeedbackState(p,a) (p)->lpVtbl->GetForceFeedbackState(p,a)
  973. #define IDirectInputDevice2_SendForceFeedbackCommand(p,a) (p)->lpVtbl->SendForceFeedbackCommand(p,a)
  974. #define IDirectInputDevice2_EnumCreatedEffectObjects(p,a,b,c) (p)->lpVtbl->EnumCreatedEffectObjects(p,a,b,c)
  975. #define IDirectInputDevice2_Escape(p,a) (p)->lpVtbl->Escape(p,a)
  976. #define IDirectInputDevice2_Poll(p) (p)->lpVtbl->Poll(p)
  977. #define IDirectInputDevice2_SendDeviceData(p,a,b,c,d) (p)->lpVtbl->SendDeviceData(p,a,b,c,d)
  978. #else
  979. #define IDirectInputDevice2_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
  980. #define IDirectInputDevice2_AddRef(p) (p)->AddRef()
  981. #define IDirectInputDevice2_Release(p) (p)->Release()
  982. #define IDirectInputDevice2_GetCapabilities(p,a) (p)->GetCapabilities(a)
  983. #define IDirectInputDevice2_EnumObjects(p,a,b,c) (p)->EnumObjects(a,b,c)
  984. #define IDirectInputDevice2_GetProperty(p,a,b) (p)->GetProperty(a,b)
  985. #define IDirectInputDevice2_SetProperty(p,a,b) (p)->SetProperty(a,b)
  986. #define IDirectInputDevice2_Acquire(p) (p)->Acquire()
  987. #define IDirectInputDevice2_Unacquire(p) (p)->Unacquire()
  988. #define IDirectInputDevice2_GetDeviceState(p,a,b) (p)->GetDeviceState(a,b)
  989. #define IDirectInputDevice2_GetDeviceData(p,a,b,c,d) (p)->GetDeviceData(a,b,c,d)
  990. #define IDirectInputDevice2_SetDataFormat(p,a) (p)->SetDataFormat(a)
  991. #define IDirectInputDevice2_SetEventNotification(p,a) (p)->SetEventNotification(a)
  992. #define IDirectInputDevice2_SetCooperativeLevel(p,a,b) (p)->SetCooperativeLevel(a,b)
  993. #define IDirectInputDevice2_GetObjectInfo(p,a,b,c) (p)->GetObjectInfo(a,b,c)
  994. #define IDirectInputDevice2_GetDeviceInfo(p,a) (p)->GetDeviceInfo(a)
  995. #define IDirectInputDevice2_RunControlPanel(p,a,b) (p)->RunControlPanel(a,b)
  996. #define IDirectInputDevice2_Initialize(p,a,b,c) (p)->Initialize(a,b,c)
  997. #define IDirectInputDevice2_CreateEffect(p,a,b,c,d) (p)->CreateEffect(a,b,c,d)
  998. #define IDirectInputDevice2_EnumEffects(p,a,b,c) (p)->EnumEffects(a,b,c)
  999. #define IDirectInputDevice2_GetEffectInfo(p,a,b) (p)->GetEffectInfo(a,b)
  1000. #define IDirectInputDevice2_GetForceFeedbackState(p,a) (p)->GetForceFeedbackState(a)
  1001. #define IDirectInputDevice2_SendForceFeedbackCommand(p,a) (p)->SendForceFeedbackCommand(a)
  1002. #define IDirectInputDevice2_EnumCreatedEffectObjects(p,a,b,c) (p)->EnumCreatedEffectObjects(a,b,c)
  1003. #define IDirectInputDevice2_Escape(p,a) (p)->Escape(a)
  1004. #define IDirectInputDevice2_Poll(p) (p)->Poll()
  1005. #define IDirectInputDevice2_SendDeviceData(p,a,b,c,d) (p)->SendDeviceData(a,b,c,d)
  1006. #endif
  1007. #endif /* DIJ_RINGZERO */
  1008. #endif /* DIRECTINPUT_VERSION >= 0x0500 */
  1009. #if(DIRECTINPUT_VERSION >= 0x0700)
  1010. #define DIFEF_DEFAULT 0x00000000
  1011. #define DIFEF_INCLUDENONSTANDARD 0x00000001
  1012. #define DIFEF_MODIFYIFNEEDED 0x00000010
  1013. #ifndef DIJ_RINGZERO
  1014. #undef INTERFACE
  1015. #define INTERFACE IDirectInputDevice7W
  1016. DECLARE_INTERFACE_(IDirectInputDevice7W, IDirectInputDevice2W)
  1017. {
  1018. /*** IUnknown methods ***/
  1019. STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE;
  1020. STDMETHOD_(ULONG,AddRef)(THIS) PURE;
  1021. STDMETHOD_(ULONG,Release)(THIS) PURE;
  1022. /*** IDirectInputDevice2W methods ***/
  1023. STDMETHOD(GetCapabilities)(THIS_ LPDIDEVCAPS) PURE;
  1024. STDMETHOD(EnumObjects)(THIS_ LPDIENUMDEVICEOBJECTSCALLBACKW,LPVOID,DWORD) PURE;
  1025. STDMETHOD(GetProperty)(THIS_ REFGUID,LPDIPROPHEADER) PURE;
  1026. STDMETHOD(SetProperty)(THIS_ REFGUID,LPCDIPROPHEADER) PURE;
  1027. STDMETHOD(Acquire)(THIS) PURE;
  1028. STDMETHOD(Unacquire)(THIS) PURE;
  1029. STDMETHOD(GetDeviceState)(THIS_ DWORD,LPVOID) PURE;
  1030. STDMETHOD(GetDeviceData)(THIS_ DWORD,LPDIDEVICEOBJECTDATA,LPDWORD,DWORD) PURE;
  1031. STDMETHOD(SetDataFormat)(THIS_ LPCDIDATAFORMAT) PURE;
  1032. STDMETHOD(SetEventNotification)(THIS_ HANDLE) PURE;
  1033. STDMETHOD(SetCooperativeLevel)(THIS_ HWND,DWORD) PURE;
  1034. STDMETHOD(GetObjectInfo)(THIS_ LPDIDEVICEOBJECTINSTANCEW,DWORD,DWORD) PURE;
  1035. STDMETHOD(GetDeviceInfo)(THIS_ LPDIDEVICEINSTANCEW) PURE;
  1036. STDMETHOD(RunControlPanel)(THIS_ HWND,DWORD) PURE;
  1037. STDMETHOD(Initialize)(THIS_ HINSTANCE,DWORD,REFGUID) PURE;
  1038. STDMETHOD(CreateEffect)(THIS_ REFGUID,LPCDIEFFECT,LPDIRECTINPUTEFFECT *,LPUNKNOWN) PURE;
  1039. STDMETHOD(EnumEffects)(THIS_ LPDIENUMEFFECTSCALLBACKW,LPVOID,DWORD) PURE;
  1040. STDMETHOD(GetEffectInfo)(THIS_ LPDIEFFECTINFOW,REFGUID) PURE;
  1041. STDMETHOD(GetForceFeedbackState)(THIS_ LPDWORD) PURE;
  1042. STDMETHOD(SendForceFeedbackCommand)(THIS_ DWORD) PURE;
  1043. STDMETHOD(EnumCreatedEffectObjects)(THIS_ LPDIENUMCREATEDEFFECTOBJECTSCALLBACK,LPVOID,DWORD) PURE;
  1044. STDMETHOD(Escape)(THIS_ LPDIEFFESCAPE) PURE;
  1045. STDMETHOD(Poll)(THIS) PURE;
  1046. STDMETHOD(SendDeviceData)(THIS_ DWORD,LPCDIDEVICEOBJECTDATA,LPDWORD,DWORD) PURE;
  1047. /*** IDirectInputDevice7W methods ***/
  1048. STDMETHOD(EnumEffectsInFile)(THIS_ LPCWSTR,LPDIENUMEFFECTSINFILECALLBACK,LPVOID,DWORD) PURE;
  1049. STDMETHOD(WriteEffectToFile)(THIS_ LPCWSTR,DWORD,LPDIFILEEFFECT,DWORD) PURE;
  1050. };
  1051. typedef struct IDirectInputDevice7W *LPDIRECTINPUTDEVICE7W;
  1052. #undef INTERFACE
  1053. #define INTERFACE IDirectInputDevice7A
  1054. DECLARE_INTERFACE_(IDirectInputDevice7A, IDirectInputDevice2A)
  1055. {
  1056. /*** IUnknown methods ***/
  1057. STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE;
  1058. STDMETHOD_(ULONG,AddRef)(THIS) PURE;
  1059. STDMETHOD_(ULONG,Release)(THIS) PURE;
  1060. /*** IDirectInputDevice2A methods ***/
  1061. STDMETHOD(GetCapabilities)(THIS_ LPDIDEVCAPS) PURE;
  1062. STDMETHOD(EnumObjects)(THIS_ LPDIENUMDEVICEOBJECTSCALLBACKA,LPVOID,DWORD) PURE;
  1063. STDMETHOD(GetProperty)(THIS_ REFGUID,LPDIPROPHEADER) PURE;
  1064. STDMETHOD(SetProperty)(THIS_ REFGUID,LPCDIPROPHEADER) PURE;
  1065. STDMETHOD(Acquire)(THIS) PURE;
  1066. STDMETHOD(Unacquire)(THIS) PURE;
  1067. STDMETHOD(GetDeviceState)(THIS_ DWORD,LPVOID) PURE;
  1068. STDMETHOD(GetDeviceData)(THIS_ DWORD,LPDIDEVICEOBJECTDATA,LPDWORD,DWORD) PURE;
  1069. STDMETHOD(SetDataFormat)(THIS_ LPCDIDATAFORMAT) PURE;
  1070. STDMETHOD(SetEventNotification)(THIS_ HANDLE) PURE;
  1071. STDMETHOD(SetCooperativeLevel)(THIS_ HWND,DWORD) PURE;
  1072. STDMETHOD(GetObjectInfo)(THIS_ LPDIDEVICEOBJECTINSTANCEA,DWORD,DWORD) PURE;
  1073. STDMETHOD(GetDeviceInfo)(THIS_ LPDIDEVICEINSTANCEA) PURE;
  1074. STDMETHOD(RunControlPanel)(THIS_ HWND,DWORD) PURE;
  1075. STDMETHOD(Initialize)(THIS_ HINSTANCE,DWORD,REFGUID) PURE;
  1076. STDMETHOD(CreateEffect)(THIS_ REFGUID,LPCDIEFFECT,LPDIRECTINPUTEFFECT *,LPUNKNOWN) PURE;
  1077. STDMETHOD(EnumEffects)(THIS_ LPDIENUMEFFECTSCALLBACKA,LPVOID,DWORD) PURE;
  1078. STDMETHOD(GetEffectInfo)(THIS_ LPDIEFFECTINFOA,REFGUID) PURE;
  1079. STDMETHOD(GetForceFeedbackState)(THIS_ LPDWORD) PURE;
  1080. STDMETHOD(SendForceFeedbackCommand)(THIS_ DWORD) PURE;
  1081. STDMETHOD(EnumCreatedEffectObjects)(THIS_ LPDIENUMCREATEDEFFECTOBJECTSCALLBACK,LPVOID,DWORD) PURE;
  1082. STDMETHOD(Escape)(THIS_ LPDIEFFESCAPE) PURE;
  1083. STDMETHOD(Poll)(THIS) PURE;
  1084. STDMETHOD(SendDeviceData)(THIS_ DWORD,LPCDIDEVICEOBJECTDATA,LPDWORD,DWORD) PURE;
  1085. /*** IDirectInputDevice7A methods ***/
  1086. STDMETHOD(EnumEffectsInFile)(THIS_ LPCSTR,LPDIENUMEFFECTSINFILECALLBACK,LPVOID,DWORD) PURE;
  1087. STDMETHOD(WriteEffectToFile)(THIS_ LPCSTR,DWORD,LPDIFILEEFFECT,DWORD) PURE;
  1088. };
  1089. typedef struct IDirectInputDevice7A *LPDIRECTINPUTDEVICE7A;
  1090. #ifdef UNICODE
  1091. #define IID_IDirectInputDevice7 IID_IDirectInputDevice7W
  1092. #define IDirectInputDevice7 IDirectInputDevice7W
  1093. #define IDirectInputDevice7Vtbl IDirectInputDevice7WVtbl
  1094. #else
  1095. #define IID_IDirectInputDevice7 IID_IDirectInputDevice7A
  1096. #define IDirectInputDevice7 IDirectInputDevice7A
  1097. #define IDirectInputDevice7Vtbl IDirectInputDevice7AVtbl
  1098. #endif
  1099. typedef struct IDirectInputDevice7 *LPDIRECTINPUTDEVICE7;
  1100. #if !defined(__cplusplus) || defined(CINTERFACE)
  1101. #define IDirectInputDevice7_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
  1102. #define IDirectInputDevice7_AddRef(p) (p)->lpVtbl->AddRef(p)
  1103. #define IDirectInputDevice7_Release(p) (p)->lpVtbl->Release(p)
  1104. #define IDirectInputDevice7_GetCapabilities(p,a) (p)->lpVtbl->GetCapabilities(p,a)
  1105. #define IDirectInputDevice7_EnumObjects(p,a,b,c) (p)->lpVtbl->EnumObjects(p,a,b,c)
  1106. #define IDirectInputDevice7_GetProperty(p,a,b) (p)->lpVtbl->GetProperty(p,a,b)
  1107. #define IDirectInputDevice7_SetProperty(p,a,b) (p)->lpVtbl->SetProperty(p,a,b)
  1108. #define IDirectInputDevice7_Acquire(p) (p)->lpVtbl->Acquire(p)
  1109. #define IDirectInputDevice7_Unacquire(p) (p)->lpVtbl->Unacquire(p)
  1110. #define IDirectInputDevice7_GetDeviceState(p,a,b) (p)->lpVtbl->GetDeviceState(p,a,b)
  1111. #define IDirectInputDevice7_GetDeviceData(p,a,b,c,d) (p)->lpVtbl->GetDeviceData(p,a,b,c,d)
  1112. #define IDirectInputDevice7_SetDataFormat(p,a) (p)->lpVtbl->SetDataFormat(p,a)
  1113. #define IDirectInputDevice7_SetEventNotification(p,a) (p)->lpVtbl->SetEventNotification(p,a)
  1114. #define IDirectInputDevice7_SetCooperativeLevel(p,a,b) (p)->lpVtbl->SetCooperativeLevel(p,a,b)
  1115. #define IDirectInputDevice7_GetObjectInfo(p,a,b,c) (p)->lpVtbl->GetObjectInfo(p,a,b,c)
  1116. #define IDirectInputDevice7_GetDeviceInfo(p,a) (p)->lpVtbl->GetDeviceInfo(p,a)
  1117. #define IDirectInputDevice7_RunControlPanel(p,a,b) (p)->lpVtbl->RunControlPanel(p,a,b)
  1118. #define IDirectInputDevice7_Initialize(p,a,b,c) (p)->lpVtbl->Initialize(p,a,b,c)
  1119. #define IDirectInputDevice7_CreateEffect(p,a,b,c,d) (p)->lpVtbl->CreateEffect(p,a,b,c,d)
  1120. #define IDirectInputDevice7_EnumEffects(p,a,b,c) (p)->lpVtbl->EnumEffects(p,a,b,c)
  1121. #define IDirectInputDevice7_GetEffectInfo(p,a,b) (p)->lpVtbl->GetEffectInfo(p,a,b)
  1122. #define IDirectInputDevice7_GetForceFeedbackState(p,a) (p)->lpVtbl->GetForceFeedbackState(p,a)
  1123. #define IDirectInputDevice7_SendForceFeedbackCommand(p,a) (p)->lpVtbl->SendForceFeedbackCommand(p,a)
  1124. #define IDirectInputDevice7_EnumCreatedEffectObjects(p,a,b,c) (p)->lpVtbl->EnumCreatedEffectObjects(p,a,b,c)
  1125. #define IDirectInputDevice7_Escape(p,a) (p)->lpVtbl->Escape(p,a)
  1126. #define IDirectInputDevice7_Poll(p) (p)->lpVtbl->Poll(p)
  1127. #define IDirectInputDevice7_SendDeviceData(p,a,b,c,d) (p)->lpVtbl->SendDeviceData(p,a,b,c,d)
  1128. #define IDirectInputDevice7_EnumEffectsInFile(p,a,b,c,d) (p)->lpVtbl->EnumEffectsInFile(p,a,b,c,d)
  1129. #define IDirectInputDevice7_WriteEffectToFile(p,a,b,c,d) (p)->lpVtbl->WriteEffectToFile(p,a,b,c,d)
  1130. #else
  1131. #define IDirectInputDevice7_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
  1132. #define IDirectInputDevice7_AddRef(p) (p)->AddRef()
  1133. #define IDirectInputDevice7_Release(p) (p)->Release()
  1134. #define IDirectInputDevice7_GetCapabilities(p,a) (p)->GetCapabilities(a)
  1135. #define IDirectInputDevice7_EnumObjects(p,a,b,c) (p)->EnumObjects(a,b,c)
  1136. #define IDirectInputDevice7_GetProperty(p,a,b) (p)->GetProperty(a,b)
  1137. #define IDirectInputDevice7_SetProperty(p,a,b) (p)->SetProperty(a,b)
  1138. #define IDirectInputDevice7_Acquire(p) (p)->Acquire()
  1139. #define IDirectInputDevice7_Unacquire(p) (p)->Unacquire()
  1140. #define IDirectInputDevice7_GetDeviceState(p,a,b) (p)->GetDeviceState(a,b)
  1141. #define IDirectInputDevice7_GetDeviceData(p,a,b,c,d) (p)->GetDeviceData(a,b,c,d)
  1142. #define IDirectInputDevice7_SetDataFormat(p,a) (p)->SetDataFormat(a)
  1143. #define IDirectInputDevice7_SetEventNotification(p,a) (p)->SetEventNotification(a)
  1144. #define IDirectInputDevice7_SetCooperativeLevel(p,a,b) (p)->SetCooperativeLevel(a,b)
  1145. #define IDirectInputDevice7_GetObjectInfo(p,a,b,c) (p)->GetObjectInfo(a,b,c)
  1146. #define IDirectInputDevice7_GetDeviceInfo(p,a) (p)->GetDeviceInfo(a)
  1147. #define IDirectInputDevice7_RunControlPanel(p,a,b) (p)->RunControlPanel(a,b)
  1148. #define IDirectInputDevice7_Initialize(p,a,b,c) (p)->Initialize(a,b,c)
  1149. #define IDirectInputDevice7_CreateEffect(p,a,b,c,d) (p)->CreateEffect(a,b,c,d)
  1150. #define IDirectInputDevice7_EnumEffects(p,a,b,c) (p)->EnumEffects(a,b,c)
  1151. #define IDirectInputDevice7_GetEffectInfo(p,a,b) (p)->GetEffectInfo(a,b)
  1152. #define IDirectInputDevice7_GetForceFeedbackState(p,a) (p)->GetForceFeedbackState(a)
  1153. #define IDirectInputDevice7_SendForceFeedbackCommand(p,a) (p)->SendForceFeedbackCommand(a)
  1154. #define IDirectInputDevice7_EnumCreatedEffectObjects(p,a,b,c) (p)->EnumCreatedEffectObjects(a,b,c)
  1155. #define IDirectInputDevice7_Escape(p,a) (p)->Escape(a)
  1156. #define IDirectInputDevice7_Poll(p) (p)->Poll()
  1157. #define IDirectInputDevice7_SendDeviceData(p,a,b,c,d) (p)->SendDeviceData(a,b,c,d)
  1158. #define IDirectInputDevice7_EnumEffectsInFile(p,a,b,c,d) (p)->EnumEffectsInFile(a,b,c,d)
  1159. #define IDirectInputDevice7_WriteEffectToFile(p,a,b,c,d) (p)->WriteEffectToFile(a,b,c,d)
  1160. #endif
  1161. #endif /* DIJ_RINGZERO */
  1162. #endif /* DIRECTINPUT_VERSION >= 0x0700 */
  1163. /****************************************************************************
  1164. *
  1165. * Mouse
  1166. *
  1167. ****************************************************************************/
  1168. #ifndef DIJ_RINGZERO
  1169. typedef struct _DIMOUSESTATE {
  1170. LONG lX;
  1171. LONG lY;
  1172. LONG lZ;
  1173. BYTE rgbButtons[4];
  1174. } DIMOUSESTATE, *LPDIMOUSESTATE;
  1175. #if DIRECTINPUT_VERSION >= 0x0700
  1176. typedef struct _DIMOUSESTATE2 {
  1177. LONG lX;
  1178. LONG lY;
  1179. LONG lZ;
  1180. BYTE rgbButtons[8];
  1181. } DIMOUSESTATE2, *LPDIMOUSESTATE2;
  1182. #endif
  1183. #define DIMOFS_X FIELD_OFFSET(DIMOUSESTATE, lX)
  1184. #define DIMOFS_Y FIELD_OFFSET(DIMOUSESTATE, lY)
  1185. #define DIMOFS_Z FIELD_OFFSET(DIMOUSESTATE, lZ)
  1186. #define DIMOFS_BUTTON0 (FIELD_OFFSET(DIMOUSESTATE, rgbButtons) + 0)
  1187. #define DIMOFS_BUTTON1 (FIELD_OFFSET(DIMOUSESTATE, rgbButtons) + 1)
  1188. #define DIMOFS_BUTTON2 (FIELD_OFFSET(DIMOUSESTATE, rgbButtons) + 2)
  1189. #define DIMOFS_BUTTON3 (FIELD_OFFSET(DIMOUSESTATE, rgbButtons) + 3)
  1190. #if (DIRECTINPUT_VERSION >= 0x0700)
  1191. #define DIMOFS_BUTTON4 (FIELD_OFFSET(DIMOUSESTATE2, rgbButtons) + 4)
  1192. #define DIMOFS_BUTTON5 (FIELD_OFFSET(DIMOUSESTATE2, rgbButtons) + 5)
  1193. #define DIMOFS_BUTTON6 (FIELD_OFFSET(DIMOUSESTATE2, rgbButtons) + 6)
  1194. #define DIMOFS_BUTTON7 (FIELD_OFFSET(DIMOUSESTATE2, rgbButtons) + 7)
  1195. #endif
  1196. #endif /* DIJ_RINGZERO */
  1197. /****************************************************************************
  1198. *
  1199. * Keyboard
  1200. *
  1201. ****************************************************************************/
  1202. #ifndef DIJ_RINGZERO
  1203. /****************************************************************************
  1204. *
  1205. * DirectInput keyboard scan codes
  1206. *
  1207. ****************************************************************************/
  1208. #define DIK_ESCAPE 0x01
  1209. #define DIK_1 0x02
  1210. #define DIK_2 0x03
  1211. #define DIK_3 0x04
  1212. #define DIK_4 0x05
  1213. #define DIK_5 0x06
  1214. #define DIK_6 0x07
  1215. #define DIK_7 0x08
  1216. #define DIK_8 0x09
  1217. #define DIK_9 0x0A
  1218. #define DIK_0 0x0B
  1219. #define DIK_MINUS 0x0C /* - on main keyboard */
  1220. #define DIK_EQUALS 0x0D
  1221. #define DIK_BACK 0x0E /* backspace */
  1222. #define DIK_TAB 0x0F
  1223. #define DIK_Q 0x10
  1224. #define DIK_W 0x11
  1225. #define DIK_E 0x12
  1226. #define DIK_R 0x13
  1227. #define DIK_T 0x14
  1228. #define DIK_Y 0x15
  1229. #define DIK_U 0x16
  1230. #define DIK_I 0x17
  1231. #define DIK_O 0x18
  1232. #define DIK_P 0x19
  1233. #define DIK_LBRACKET 0x1A
  1234. #define DIK_RBRACKET 0x1B
  1235. #define DIK_RETURN 0x1C /* Enter on main keyboard */
  1236. #define DIK_LCONTROL 0x1D
  1237. #define DIK_A 0x1E
  1238. #define DIK_S 0x1F
  1239. #define DIK_D 0x20
  1240. #define DIK_F 0x21
  1241. #define DIK_G 0x22
  1242. #define DIK_H 0x23
  1243. #define DIK_J 0x24
  1244. #define DIK_K 0x25
  1245. #define DIK_L 0x26
  1246. #define DIK_SEMICOLON 0x27
  1247. #define DIK_APOSTROPHE 0x28
  1248. #define DIK_GRAVE 0x29 /* accent grave */
  1249. #define DIK_LSHIFT 0x2A
  1250. #define DIK_BACKSLASH 0x2B
  1251. #define DIK_Z 0x2C
  1252. #define DIK_X 0x2D
  1253. #define DIK_C 0x2E
  1254. #define DIK_V 0x2F
  1255. #define DIK_B 0x30
  1256. #define DIK_N 0x31
  1257. #define DIK_M 0x32
  1258. #define DIK_COMMA 0x33
  1259. #define DIK_PERIOD 0x34 /* . on main keyboard */
  1260. #define DIK_SLASH 0x35 /* / on main keyboard */
  1261. #define DIK_RSHIFT 0x36
  1262. #define DIK_MULTIPLY 0x37 /* * on numeric keypad */
  1263. #define DIK_LMENU 0x38 /* left Alt */
  1264. #define DIK_SPACE 0x39
  1265. #define DIK_CAPITAL 0x3A
  1266. #define DIK_F1 0x3B
  1267. #define DIK_F2 0x3C
  1268. #define DIK_F3 0x3D
  1269. #define DIK_F4 0x3E
  1270. #define DIK_F5 0x3F
  1271. #define DIK_F6 0x40
  1272. #define DIK_F7 0x41
  1273. #define DIK_F8 0x42
  1274. #define DIK_F9 0x43
  1275. #define DIK_F10 0x44
  1276. #define DIK_NUMLOCK 0x45
  1277. #define DIK_SCROLL 0x46 /* Scroll Lock */
  1278. #define DIK_NUMPAD7 0x47
  1279. #define DIK_NUMPAD8 0x48
  1280. #define DIK_NUMPAD9 0x49
  1281. #define DIK_SUBTRACT 0x4A /* - on numeric keypad */
  1282. #define DIK_NUMPAD4 0x4B
  1283. #define DIK_NUMPAD5 0x4C
  1284. #define DIK_NUMPAD6 0x4D
  1285. #define DIK_ADD 0x4E /* + on numeric keypad */
  1286. #define DIK_NUMPAD1 0x4F
  1287. #define DIK_NUMPAD2 0x50
  1288. #define DIK_NUMPAD3 0x51
  1289. #define DIK_NUMPAD0 0x52
  1290. #define DIK_DECIMAL 0x53 /* . on numeric keypad */
  1291. #define DIK_OEM_102 0x56 /* < > | on UK/Germany keyboards */
  1292. #define DIK_F11 0x57
  1293. #define DIK_F12 0x58
  1294. #define DIK_F13 0x64 /* (NEC PC98) */
  1295. #define DIK_F14 0x65 /* (NEC PC98) */
  1296. #define DIK_F15 0x66 /* (NEC PC98) */
  1297. #define DIK_KANA 0x70 /* (Japanese keyboard) */
  1298. #define DIK_ABNT_C1 0x73 /* / ? on Portugese (Brazilian) keyboards */
  1299. #define DIK_CONVERT 0x79 /* (Japanese keyboard) */
  1300. #define DIK_NOCONVERT 0x7B /* (Japanese keyboard) */
  1301. #define DIK_YEN 0x7D /* (Japanese keyboard) */
  1302. #define DIK_ABNT_C2 0x7E /* Numpad . on Portugese (Brazilian) keyboards */
  1303. #define DIK_NUMPADEQUALS 0x8D /* = on numeric keypad (NEC PC98) */
  1304. #define DIK_PREVTRACK 0x90 /* Previous Track (DIK_CIRCUMFLEX on Japanese keyboard) */
  1305. #define DIK_AT 0x91 /* (NEC PC98) */
  1306. #define DIK_COLON 0x92 /* (NEC PC98) */
  1307. #define DIK_UNDERLINE 0x93 /* (NEC PC98) */
  1308. #define DIK_KANJI 0x94 /* (Japanese keyboard) */
  1309. #define DIK_STOP 0x95 /* (NEC PC98) */
  1310. #define DIK_AX 0x96 /* (Japan AX) */
  1311. #define DIK_UNLABELED 0x97 /* (J3100) */
  1312. #define DIK_NEXTTRACK 0x99 /* Next Track */
  1313. #define DIK_NUMPADENTER 0x9C /* Enter on numeric keypad */
  1314. #define DIK_RCONTROL 0x9D
  1315. #define DIK_MUTE 0xA0 /* Mute */
  1316. #define DIK_CALCULATOR 0xA1 /* Calculator */
  1317. #define DIK_PLAYPAUSE 0xA2 /* Play / Pause */
  1318. #define DIK_MEDIASTOP 0xA4 /* Media Stop */
  1319. #define DIK_VOLUMEDOWN 0xAE /* Volume - */
  1320. #define DIK_VOLUMEUP 0xB0 /* Volume + */
  1321. #define DIK_WEBHOME 0xB2 /* Web home */
  1322. #define DIK_NUMPADCOMMA 0xB3 /* , on numeric keypad (NEC PC98) */
  1323. #define DIK_DIVIDE 0xB5 /* / on numeric keypad */
  1324. #define DIK_SYSRQ 0xB7
  1325. #define DIK_RMENU 0xB8 /* right Alt */
  1326. #define DIK_PAUSE 0xC5 /* Pause */
  1327. #define DIK_HOME 0xC7 /* Home on arrow keypad */
  1328. #define DIK_UP 0xC8 /* UpArrow on arrow keypad */
  1329. #define DIK_PRIOR 0xC9 /* PgUp on arrow keypad */
  1330. #define DIK_LEFT 0xCB /* LeftArrow on arrow keypad */
  1331. #define DIK_RIGHT 0xCD /* RightArrow on arrow keypad */
  1332. #define DIK_END 0xCF /* End on arrow keypad */
  1333. #define DIK_DOWN 0xD0 /* DownArrow on arrow keypad */
  1334. #define DIK_NEXT 0xD1 /* PgDn on arrow keypad */
  1335. #define DIK_INSERT 0xD2 /* Insert on arrow keypad */
  1336. #define DIK_DELETE 0xD3 /* Delete on arrow keypad */
  1337. #define DIK_LWIN 0xDB /* Left Windows key */
  1338. #define DIK_RWIN 0xDC /* Right Windows key */
  1339. #define DIK_APPS 0xDD /* AppMenu key */
  1340. #define DIK_POWER 0xDE /* System Power */
  1341. #define DIK_SLEEP 0xDF /* System Sleep */
  1342. #define DIK_WAKE 0xE3 /* System Wake */
  1343. #define DIK_WEBSEARCH 0xE5 /* Web Search */
  1344. #define DIK_WEBFAVORITES 0xE6 /* Web Favorites */
  1345. #define DIK_WEBREFRESH 0xE7 /* Web Refresh */
  1346. #define DIK_WEBSTOP 0xE8 /* Web Stop */
  1347. #define DIK_WEBFORWARD 0xE9 /* Web Forward */
  1348. #define DIK_WEBBACK 0xEA /* Web Back */
  1349. #define DIK_MYCOMPUTER 0xEB /* My Computer */
  1350. #define DIK_MAIL 0xEC /* Mail */
  1351. #define DIK_MEDIASELECT 0xED /* Media Select */
  1352. /*
  1353. * Alternate names for keys, to facilitate transition from DOS.
  1354. */
  1355. #define DIK_BACKSPACE DIK_BACK /* backspace */
  1356. #define DIK_NUMPADSTAR DIK_MULTIPLY /* * on numeric keypad */
  1357. #define DIK_LALT DIK_LMENU /* left Alt */
  1358. #define DIK_CAPSLOCK DIK_CAPITAL /* CapsLock */
  1359. #define DIK_NUMPADMINUS DIK_SUBTRACT /* - on numeric keypad */
  1360. #define DIK_NUMPADPLUS DIK_ADD /* + on numeric keypad */
  1361. #define DIK_NUMPADPERIOD DIK_DECIMAL /* . on numeric keypad */
  1362. #define DIK_NUMPADSLASH DIK_DIVIDE /* / on numeric keypad */
  1363. #define DIK_RALT DIK_RMENU /* right Alt */
  1364. #define DIK_UPARROW DIK_UP /* UpArrow on arrow keypad */
  1365. #define DIK_PGUP DIK_PRIOR /* PgUp on arrow keypad */
  1366. #define DIK_LEFTARROW DIK_LEFT /* LeftArrow on arrow keypad */
  1367. #define DIK_RIGHTARROW DIK_RIGHT /* RightArrow on arrow keypad */
  1368. #define DIK_DOWNARROW DIK_DOWN /* DownArrow on arrow keypad */
  1369. #define DIK_PGDN DIK_NEXT /* PgDn on arrow keypad */
  1370. /*
  1371. * Alternate names for keys originally not used on US keyboards.
  1372. */
  1373. #define DIK_CIRCUMFLEX DIK_PREVTRACK /* Japanese keyboard */
  1374. #endif /* DIJ_RINGZERO */
  1375. /****************************************************************************
  1376. *
  1377. * Joystick
  1378. *
  1379. ****************************************************************************/
  1380. #ifndef DIJ_RINGZERO
  1381. typedef struct DIJOYSTATE {
  1382. LONG lX; /* x-axis position */
  1383. LONG lY; /* y-axis position */
  1384. LONG lZ; /* z-axis position */
  1385. LONG lRx; /* x-axis rotation */
  1386. LONG lRy; /* y-axis rotation */
  1387. LONG lRz; /* z-axis rotation */
  1388. LONG rglSlider[2]; /* extra axes positions */
  1389. DWORD rgdwPOV[4]; /* POV directions */
  1390. BYTE rgbButtons[32]; /* 32 buttons */
  1391. } DIJOYSTATE, *LPDIJOYSTATE;
  1392. typedef struct DIJOYSTATE2 {
  1393. LONG lX; /* x-axis position */
  1394. LONG lY; /* y-axis position */
  1395. LONG lZ; /* z-axis position */
  1396. LONG lRx; /* x-axis rotation */
  1397. LONG lRy; /* y-axis rotation */
  1398. LONG lRz; /* z-axis rotation */
  1399. LONG rglSlider[2]; /* extra axes positions */
  1400. DWORD rgdwPOV[4]; /* POV directions */
  1401. BYTE rgbButtons[128]; /* 128 buttons */
  1402. LONG lVX; /* x-axis velocity */
  1403. LONG lVY; /* y-axis velocity */
  1404. LONG lVZ; /* z-axis velocity */
  1405. LONG lVRx; /* x-axis angular velocity */
  1406. LONG lVRy; /* y-axis angular velocity */
  1407. LONG lVRz; /* z-axis angular velocity */
  1408. LONG rglVSlider[2]; /* extra axes velocities */
  1409. LONG lAX; /* x-axis acceleration */
  1410. LONG lAY; /* y-axis acceleration */
  1411. LONG lAZ; /* z-axis acceleration */
  1412. LONG lARx; /* x-axis angular acceleration */
  1413. LONG lARy; /* y-axis angular acceleration */
  1414. LONG lARz; /* z-axis angular acceleration */
  1415. LONG rglASlider[2]; /* extra axes accelerations */
  1416. LONG lFX; /* x-axis force */
  1417. LONG lFY; /* y-axis force */
  1418. LONG lFZ; /* z-axis force */
  1419. LONG lFRx; /* x-axis torque */
  1420. LONG lFRy; /* y-axis torque */
  1421. LONG lFRz; /* z-axis torque */
  1422. LONG rglFSlider[2]; /* extra axes forces */
  1423. } DIJOYSTATE2, *LPDIJOYSTATE2;
  1424. #define DIJOFS_X FIELD_OFFSET(DIJOYSTATE, lX)
  1425. #define DIJOFS_Y FIELD_OFFSET(DIJOYSTATE, lY)
  1426. #define DIJOFS_Z FIELD_OFFSET(DIJOYSTATE, lZ)
  1427. #define DIJOFS_RX FIELD_OFFSET(DIJOYSTATE, lRx)
  1428. #define DIJOFS_RY FIELD_OFFSET(DIJOYSTATE, lRy)
  1429. #define DIJOFS_RZ FIELD_OFFSET(DIJOYSTATE, lRz)
  1430. #define DIJOFS_SLIDER(n) (FIELD_OFFSET(DIJOYSTATE, rglSlider) + \
  1431. (n) * sizeof(LONG))
  1432. #define DIJOFS_POV(n) (FIELD_OFFSET(DIJOYSTATE, rgdwPOV) + \
  1433. (n) * sizeof(DWORD))
  1434. #define DIJOFS_BUTTON(n) (FIELD_OFFSET(DIJOYSTATE, rgbButtons) + (n))
  1435. #define DIJOFS_BUTTON0 DIJOFS_BUTTON(0)
  1436. #define DIJOFS_BUTTON1 DIJOFS_BUTTON(1)
  1437. #define DIJOFS_BUTTON2 DIJOFS_BUTTON(2)
  1438. #define DIJOFS_BUTTON3 DIJOFS_BUTTON(3)
  1439. #define DIJOFS_BUTTON4 DIJOFS_BUTTON(4)
  1440. #define DIJOFS_BUTTON5 DIJOFS_BUTTON(5)
  1441. #define DIJOFS_BUTTON6 DIJOFS_BUTTON(6)
  1442. #define DIJOFS_BUTTON7 DIJOFS_BUTTON(7)
  1443. #define DIJOFS_BUTTON8 DIJOFS_BUTTON(8)
  1444. #define DIJOFS_BUTTON9 DIJOFS_BUTTON(9)
  1445. #define DIJOFS_BUTTON10 DIJOFS_BUTTON(10)
  1446. #define DIJOFS_BUTTON11 DIJOFS_BUTTON(11)
  1447. #define DIJOFS_BUTTON12 DIJOFS_BUTTON(12)
  1448. #define DIJOFS_BUTTON13 DIJOFS_BUTTON(13)
  1449. #define DIJOFS_BUTTON14 DIJOFS_BUTTON(14)
  1450. #define DIJOFS_BUTTON15 DIJOFS_BUTTON(15)
  1451. #define DIJOFS_BUTTON16 DIJOFS_BUTTON(16)
  1452. #define DIJOFS_BUTTON17 DIJOFS_BUTTON(17)
  1453. #define DIJOFS_BUTTON18 DIJOFS_BUTTON(18)
  1454. #define DIJOFS_BUTTON19 DIJOFS_BUTTON(19)
  1455. #define DIJOFS_BUTTON20 DIJOFS_BUTTON(20)
  1456. #define DIJOFS_BUTTON21 DIJOFS_BUTTON(21)
  1457. #define DIJOFS_BUTTON22 DIJOFS_BUTTON(22)
  1458. #define DIJOFS_BUTTON23 DIJOFS_BUTTON(23)
  1459. #define DIJOFS_BUTTON24 DIJOFS_BUTTON(24)
  1460. #define DIJOFS_BUTTON25 DIJOFS_BUTTON(25)
  1461. #define DIJOFS_BUTTON26 DIJOFS_BUTTON(26)
  1462. #define DIJOFS_BUTTON27 DIJOFS_BUTTON(27)
  1463. #define DIJOFS_BUTTON28 DIJOFS_BUTTON(28)
  1464. #define DIJOFS_BUTTON29 DIJOFS_BUTTON(29)
  1465. #define DIJOFS_BUTTON30 DIJOFS_BUTTON(30)
  1466. #define DIJOFS_BUTTON31 DIJOFS_BUTTON(31)
  1467. #endif /* DIJ_RINGZERO */
  1468. /****************************************************************************
  1469. *
  1470. * IDirectInput
  1471. *
  1472. ****************************************************************************/
  1473. #ifndef DIJ_RINGZERO
  1474. #define DIENUM_STOP 0
  1475. #define DIENUM_CONTINUE 1
  1476. typedef BOOL (FAR PASCAL * LPDIENUMDEVICESCALLBACKA)(LPCDIDEVICEINSTANCEA, LPVOID);
  1477. typedef BOOL (FAR PASCAL * LPDIENUMDEVICESCALLBACKW)(LPCDIDEVICEINSTANCEW, LPVOID);
  1478. #ifdef UNICODE
  1479. #define LPDIENUMDEVICESCALLBACK LPDIENUMDEVICESCALLBACKW
  1480. #else
  1481. #define LPDIENUMDEVICESCALLBACK LPDIENUMDEVICESCALLBACKA
  1482. #endif // !UNICODE
  1483. #define DIEDFL_ALLDEVICES 0x00000000
  1484. #define DIEDFL_ATTACHEDONLY 0x00000001
  1485. #if(DIRECTINPUT_VERSION >= 0x0500)
  1486. #define DIEDFL_FORCEFEEDBACK 0x00000100
  1487. #endif /* DIRECTINPUT_VERSION >= 0x0500 */
  1488. #if(DIRECTINPUT_VERSION >= 0x050a)
  1489. #define DIEDFL_INCLUDEALIASES 0x00010000
  1490. #define DIEDFL_INCLUDEPHANTOMS 0x00020000
  1491. #endif /* DIRECTINPUT_VERSION >= 0x050a */
  1492. #undef INTERFACE
  1493. #define INTERFACE IDirectInputW
  1494. DECLARE_INTERFACE_(IDirectInputW, IUnknown)
  1495. {
  1496. /*** IUnknown methods ***/
  1497. STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE;
  1498. STDMETHOD_(ULONG,AddRef)(THIS) PURE;
  1499. STDMETHOD_(ULONG,Release)(THIS) PURE;
  1500. /*** IDirectInputW methods ***/
  1501. STDMETHOD(CreateDevice)(THIS_ REFGUID,LPDIRECTINPUTDEVICEW *,LPUNKNOWN) PURE;
  1502. STDMETHOD(EnumDevices)(THIS_ DWORD,LPDIENUMDEVICESCALLBACKW,LPVOID,DWORD) PURE;
  1503. STDMETHOD(GetDeviceStatus)(THIS_ REFGUID) PURE;
  1504. STDMETHOD(RunControlPanel)(THIS_ HWND,DWORD) PURE;
  1505. STDMETHOD(Initialize)(THIS_ HINSTANCE,DWORD) PURE;
  1506. };
  1507. typedef struct IDirectInputW *LPDIRECTINPUTW;
  1508. #undef INTERFACE
  1509. #define INTERFACE IDirectInputA
  1510. DECLARE_INTERFACE_(IDirectInputA, IUnknown)
  1511. {
  1512. /*** IUnknown methods ***/
  1513. STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE;
  1514. STDMETHOD_(ULONG,AddRef)(THIS) PURE;
  1515. STDMETHOD_(ULONG,Release)(THIS) PURE;
  1516. /*** IDirectInputA methods ***/
  1517. STDMETHOD(CreateDevice)(THIS_ REFGUID,LPDIRECTINPUTDEVICEA *,LPUNKNOWN) PURE;
  1518. STDMETHOD(EnumDevices)(THIS_ DWORD,LPDIENUMDEVICESCALLBACKA,LPVOID,DWORD) PURE;
  1519. STDMETHOD(GetDeviceStatus)(THIS_ REFGUID) PURE;
  1520. STDMETHOD(RunControlPanel)(THIS_ HWND,DWORD) PURE;
  1521. STDMETHOD(Initialize)(THIS_ HINSTANCE,DWORD) PURE;
  1522. };
  1523. typedef struct IDirectInputA *LPDIRECTINPUTA;
  1524. #ifdef UNICODE
  1525. #define IID_IDirectInput IID_IDirectInputW
  1526. #define IDirectInput IDirectInputW
  1527. #define IDirectInputVtbl IDirectInputWVtbl
  1528. #else
  1529. #define IID_IDirectInput IID_IDirectInputA
  1530. #define IDirectInput IDirectInputA
  1531. #define IDirectInputVtbl IDirectInputAVtbl
  1532. #endif
  1533. typedef struct IDirectInput *LPDIRECTINPUT;
  1534. #if !defined(__cplusplus) || defined(CINTERFACE)
  1535. #define IDirectInput_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
  1536. #define IDirectInput_AddRef(p) (p)->lpVtbl->AddRef(p)
  1537. #define IDirectInput_Release(p) (p)->lpVtbl->Release(p)
  1538. #define IDirectInput_CreateDevice(p,a,b,c) (p)->lpVtbl->CreateDevice(p,a,b,c)
  1539. #define IDirectInput_EnumDevices(p,a,b,c,d) (p)->lpVtbl->EnumDevices(p,a,b,c,d)
  1540. #define IDirectInput_GetDeviceStatus(p,a) (p)->lpVtbl->GetDeviceStatus(p,a)
  1541. #define IDirectInput_RunControlPanel(p,a,b) (p)->lpVtbl->RunControlPanel(p,a,b)
  1542. #define IDirectInput_Initialize(p,a,b) (p)->lpVtbl->Initialize(p,a,b)
  1543. #else
  1544. #define IDirectInput_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
  1545. #define IDirectInput_AddRef(p) (p)->AddRef()
  1546. #define IDirectInput_Release(p) (p)->Release()
  1547. #define IDirectInput_CreateDevice(p,a,b,c) (p)->CreateDevice(a,b,c)
  1548. #define IDirectInput_EnumDevices(p,a,b,c,d) (p)->EnumDevices(a,b,c,d)
  1549. #define IDirectInput_GetDeviceStatus(p,a) (p)->GetDeviceStatus(a)
  1550. #define IDirectInput_RunControlPanel(p,a,b) (p)->RunControlPanel(a,b)
  1551. #define IDirectInput_Initialize(p,a,b) (p)->Initialize(a,b)
  1552. #endif
  1553. #undef INTERFACE
  1554. #define INTERFACE IDirectInput2W
  1555. DECLARE_INTERFACE_(IDirectInput2W, IDirectInputW)
  1556. {
  1557. /*** IUnknown methods ***/
  1558. STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE;
  1559. STDMETHOD_(ULONG,AddRef)(THIS) PURE;
  1560. STDMETHOD_(ULONG,Release)(THIS) PURE;
  1561. /*** IDirectInputW methods ***/
  1562. STDMETHOD(CreateDevice)(THIS_ REFGUID,LPDIRECTINPUTDEVICEW *,LPUNKNOWN) PURE;
  1563. STDMETHOD(EnumDevices)(THIS_ DWORD,LPDIENUMDEVICESCALLBACKW,LPVOID,DWORD) PURE;
  1564. STDMETHOD(GetDeviceStatus)(THIS_ REFGUID) PURE;
  1565. STDMETHOD(RunControlPanel)(THIS_ HWND,DWORD) PURE;
  1566. STDMETHOD(Initialize)(THIS_ HINSTANCE,DWORD) PURE;
  1567. /*** IDirectInput2W methods ***/
  1568. STDMETHOD(FindDevice)(THIS_ REFGUID,LPCWSTR,LPGUID) PURE;
  1569. };
  1570. typedef struct IDirectInput2W *LPDIRECTINPUT2W;
  1571. #undef INTERFACE
  1572. #define INTERFACE IDirectInput2A
  1573. DECLARE_INTERFACE_(IDirectInput2A, IDirectInputA)
  1574. {
  1575. /*** IUnknown methods ***/
  1576. STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE;
  1577. STDMETHOD_(ULONG,AddRef)(THIS) PURE;
  1578. STDMETHOD_(ULONG,Release)(THIS) PURE;
  1579. /*** IDirectInputA methods ***/
  1580. STDMETHOD(CreateDevice)(THIS_ REFGUID,LPDIRECTINPUTDEVICEA *,LPUNKNOWN) PURE;
  1581. STDMETHOD(EnumDevices)(THIS_ DWORD,LPDIENUMDEVICESCALLBACKA,LPVOID,DWORD) PURE;
  1582. STDMETHOD(GetDeviceStatus)(THIS_ REFGUID) PURE;
  1583. STDMETHOD(RunControlPanel)(THIS_ HWND,DWORD) PURE;
  1584. STDMETHOD(Initialize)(THIS_ HINSTANCE,DWORD) PURE;
  1585. /*** IDirectInput2A methods ***/
  1586. STDMETHOD(FindDevice)(THIS_ REFGUID,LPCSTR,LPGUID) PURE;
  1587. };
  1588. typedef struct IDirectInput2A *LPDIRECTINPUT2A;
  1589. #ifdef UNICODE
  1590. #define IID_IDirectInput2 IID_IDirectInput2W
  1591. #define IDirectInput2 IDirectInput2W
  1592. #define IDirectInput2Vtbl IDirectInput2WVtbl
  1593. #else
  1594. #define IID_IDirectInput2 IID_IDirectInput2A
  1595. #define IDirectInput2 IDirectInput2A
  1596. #define IDirectInput2Vtbl IDirectInput2AVtbl
  1597. #endif
  1598. typedef struct IDirectInput2 *LPDIRECTINPUT2;
  1599. #if !defined(__cplusplus) || defined(CINTERFACE)
  1600. #define IDirectInput2_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
  1601. #define IDirectInput2_AddRef(p) (p)->lpVtbl->AddRef(p)
  1602. #define IDirectInput2_Release(p) (p)->lpVtbl->Release(p)
  1603. #define IDirectInput2_CreateDevice(p,a,b,c) (p)->lpVtbl->CreateDevice(p,a,b,c)
  1604. #define IDirectInput2_EnumDevices(p,a,b,c,d) (p)->lpVtbl->EnumDevices(p,a,b,c,d)
  1605. #define IDirectInput2_GetDeviceStatus(p,a) (p)->lpVtbl->GetDeviceStatus(p,a)
  1606. #define IDirectInput2_RunControlPanel(p,a,b) (p)->lpVtbl->RunControlPanel(p,a,b)
  1607. #define IDirectInput2_Initialize(p,a,b) (p)->lpVtbl->Initialize(p,a,b)
  1608. #define IDirectInput2_FindDevice(p,a,b,c) (p)->lpVtbl->FindDevice(p,a,b,c)
  1609. #else
  1610. #define IDirectInput2_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
  1611. #define IDirectInput2_AddRef(p) (p)->AddRef()
  1612. #define IDirectInput2_Release(p) (p)->Release()
  1613. #define IDirectInput2_CreateDevice(p,a,b,c) (p)->CreateDevice(a,b,c)
  1614. #define IDirectInput2_EnumDevices(p,a,b,c,d) (p)->EnumDevices(a,b,c,d)
  1615. #define IDirectInput2_GetDeviceStatus(p,a) (p)->GetDeviceStatus(a)
  1616. #define IDirectInput2_RunControlPanel(p,a,b) (p)->RunControlPanel(a,b)
  1617. #define IDirectInput2_Initialize(p,a,b) (p)->Initialize(a,b)
  1618. #define IDirectInput2_FindDevice(p,a,b,c) (p)->FindDevice(a,b,c)
  1619. #endif
  1620. #undef INTERFACE
  1621. #define INTERFACE IDirectInput7W
  1622. DECLARE_INTERFACE_(IDirectInput7W, IDirectInput2W)
  1623. {
  1624. /*** IUnknown methods ***/
  1625. STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE;
  1626. STDMETHOD_(ULONG,AddRef)(THIS) PURE;
  1627. STDMETHOD_(ULONG,Release)(THIS) PURE;
  1628. /*** IDirectInput2W methods ***/
  1629. STDMETHOD(CreateDevice)(THIS_ REFGUID,LPDIRECTINPUTDEVICEW *,LPUNKNOWN) PURE;
  1630. STDMETHOD(EnumDevices)(THIS_ DWORD,LPDIENUMDEVICESCALLBACKW,LPVOID,DWORD) PURE;
  1631. STDMETHOD(GetDeviceStatus)(THIS_ REFGUID) PURE;
  1632. STDMETHOD(RunControlPanel)(THIS_ HWND,DWORD) PURE;
  1633. STDMETHOD(Initialize)(THIS_ HINSTANCE,DWORD) PURE;
  1634. STDMETHOD(FindDevice)(THIS_ REFGUID,LPCWSTR,LPGUID) PURE;
  1635. /*** IDirectInput7W methods ***/
  1636. STDMETHOD(CreateDeviceEx)(THIS_ REFGUID,REFIID,LPVOID *,LPUNKNOWN) PURE;
  1637. };
  1638. typedef struct IDirectInput7W *LPDIRECTINPUT7W;
  1639. #undef INTERFACE
  1640. #define INTERFACE IDirectInput7A
  1641. DECLARE_INTERFACE_(IDirectInput7A, IDirectInput2A)
  1642. {
  1643. /*** IUnknown methods ***/
  1644. STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE;
  1645. STDMETHOD_(ULONG,AddRef)(THIS) PURE;
  1646. STDMETHOD_(ULONG,Release)(THIS) PURE;
  1647. /*** IDirectInput2A methods ***/
  1648. STDMETHOD(CreateDevice)(THIS_ REFGUID,LPDIRECTINPUTDEVICEA *,LPUNKNOWN) PURE;
  1649. STDMETHOD(EnumDevices)(THIS_ DWORD,LPDIENUMDEVICESCALLBACKA,LPVOID,DWORD) PURE;
  1650. STDMETHOD(GetDeviceStatus)(THIS_ REFGUID) PURE;
  1651. STDMETHOD(RunControlPanel)(THIS_ HWND,DWORD) PURE;
  1652. STDMETHOD(Initialize)(THIS_ HINSTANCE,DWORD) PURE;
  1653. STDMETHOD(FindDevice)(THIS_ REFGUID,LPCSTR,LPGUID) PURE;
  1654. /*** IDirectInput7A methods ***/
  1655. STDMETHOD(CreateDeviceEx)(THIS_ REFGUID,REFIID,LPVOID *,LPUNKNOWN) PURE;
  1656. };
  1657. typedef struct IDirectInput7A *LPDIRECTINPUT7A;
  1658. #ifdef UNICODE
  1659. #define IID_IDirectInput7 IID_IDirectInput7W
  1660. #define IDirectInput7 IDirectInput7W
  1661. #define IDirectInput7Vtbl IDirectInput7WVtbl
  1662. #else
  1663. #define IID_IDirectInput7 IID_IDirectInput7A
  1664. #define IDirectInput7 IDirectInput7A
  1665. #define IDirectInput7Vtbl IDirectInput7AVtbl
  1666. #endif
  1667. typedef struct IDirectInput7 *LPDIRECTINPUT7;
  1668. #if !defined(__cplusplus) || defined(CINTERFACE)
  1669. #define IDirectInput7_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
  1670. #define IDirectInput7_AddRef(p) (p)->lpVtbl->AddRef(p)
  1671. #define IDirectInput7_Release(p) (p)->lpVtbl->Release(p)
  1672. #define IDirectInput7_CreateDevice(p,a,b,c) (p)->lpVtbl->CreateDevice(p,a,b,c)
  1673. #define IDirectInput7_EnumDevices(p,a,b,c,d) (p)->lpVtbl->EnumDevices(p,a,b,c,d)
  1674. #define IDirectInput7_GetDeviceStatus(p,a) (p)->lpVtbl->GetDeviceStatus(p,a)
  1675. #define IDirectInput7_RunControlPanel(p,a,b) (p)->lpVtbl->RunControlPanel(p,a,b)
  1676. #define IDirectInput7_Initialize(p,a,b) (p)->lpVtbl->Initialize(p,a,b)
  1677. #define IDirectInput7_FindDevice(p,a,b,c) (p)->lpVtbl->FindDevice(p,a,b,c)
  1678. #define IDirectInput7_CreateDeviceEx(p,a,b,c,d) (p)->lpVtbl->CreateDeviceEx(p,a,b,c,d)
  1679. #else
  1680. #define IDirectInput7_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
  1681. #define IDirectInput7_AddRef(p) (p)->AddRef()
  1682. #define IDirectInput7_Release(p) (p)->Release()
  1683. #define IDirectInput7_CreateDevice(p,a,b,c) (p)->CreateDevice(a,b,c)
  1684. #define IDirectInput7_EnumDevices(p,a,b,c,d) (p)->EnumDevices(a,b,c,d)
  1685. #define IDirectInput7_GetDeviceStatus(p,a) (p)->GetDeviceStatus(a)
  1686. #define IDirectInput7_RunControlPanel(p,a,b) (p)->RunControlPanel(a,b)
  1687. #define IDirectInput7_Initialize(p,a,b) (p)->Initialize(a,b)
  1688. #define IDirectInput7_FindDevice(p,a,b,c) (p)->FindDevice(a,b,c)
  1689. #define IDirectInput7_CreateDeviceEx(p,a,b,c,d) (p)->CreateDeviceEx(a,b,c,d)
  1690. #endif
  1691. extern HRESULT WINAPI DirectInputCreateA(HINSTANCE hinst, DWORD dwVersion, LPDIRECTINPUTA *ppDI, LPUNKNOWN punkOuter);
  1692. extern HRESULT WINAPI DirectInputCreateW(HINSTANCE hinst, DWORD dwVersion, LPDIRECTINPUTW *ppDI, LPUNKNOWN punkOuter);
  1693. #ifdef UNICODE
  1694. #define DirectInputCreate DirectInputCreateW
  1695. #else
  1696. #define DirectInputCreate DirectInputCreateA
  1697. #endif // !UNICODE
  1698. extern HRESULT WINAPI DirectInputCreateEx(HINSTANCE hinst, DWORD dwVersion, REFIID riidltf, LPVOID *ppvOut, LPUNKNOWN punkOuter);
  1699. #endif /* DIJ_RINGZERO */
  1700. /****************************************************************************
  1701. *
  1702. * Return Codes
  1703. *
  1704. ****************************************************************************/
  1705. /*
  1706. * The operation completed successfully.
  1707. */
  1708. #define DI_OK S_OK
  1709. /*
  1710. * The device exists but is not currently attached.
  1711. */
  1712. #define DI_NOTATTACHED S_FALSE
  1713. /*
  1714. * The device buffer overflowed. Some input was lost.
  1715. */
  1716. #define DI_BUFFEROVERFLOW S_FALSE
  1717. /*
  1718. * The change in device properties had no effect.
  1719. */
  1720. #define DI_PROPNOEFFECT S_FALSE
  1721. /*
  1722. * The operation had no effect.
  1723. */
  1724. #define DI_NOEFFECT S_FALSE
  1725. /*
  1726. * The device is a polled device. As a result, device buffering
  1727. * will not collect any data and event notifications will not be
  1728. * signalled until GetDeviceState is called.
  1729. */
  1730. #define DI_POLLEDDEVICE ((HRESULT)0x00000002L)
  1731. /*
  1732. * The parameters of the effect were successfully updated by
  1733. * IDirectInputEffect::SetParameters, but the effect was not
  1734. * downloaded because the device is not exclusively acquired
  1735. * or because the DIEP_NODOWNLOAD flag was passed.
  1736. */
  1737. #define DI_DOWNLOADSKIPPED ((HRESULT)0x00000003L)
  1738. /*
  1739. * The parameters of the effect were successfully updated by
  1740. * IDirectInputEffect::SetParameters, but in order to change
  1741. * the parameters, the effect needed to be restarted.
  1742. */
  1743. #define DI_EFFECTRESTARTED ((HRESULT)0x00000004L)
  1744. /*
  1745. * The parameters of the effect were successfully updated by
  1746. * IDirectInputEffect::SetParameters, but some of them were
  1747. * beyond the capabilities of the device and were truncated.
  1748. */
  1749. #define DI_TRUNCATED ((HRESULT)0x00000008L)
  1750. /*
  1751. * Equal to DI_EFFECTRESTARTED | DI_TRUNCATED.
  1752. */
  1753. #define DI_TRUNCATEDANDRESTARTED ((HRESULT)0x0000000CL)
  1754. /*
  1755. * The application requires a newer version of DirectInput.
  1756. */
  1757. #define DIERR_OLDDIRECTINPUTVERSION \
  1758. MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_OLD_WIN_VERSION)
  1759. /*
  1760. * The application was written for an unsupported prerelease version
  1761. * of DirectInput.
  1762. */
  1763. #define DIERR_BETADIRECTINPUTVERSION \
  1764. MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_RMODE_APP)
  1765. /*
  1766. * The object could not be created due to an incompatible driver version
  1767. * or mismatched or incomplete driver components.
  1768. */
  1769. #define DIERR_BADDRIVERVER \
  1770. MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_BAD_DRIVER_LEVEL)
  1771. /*
  1772. * The device or device instance or effect is not registered with DirectInput.
  1773. */
  1774. #define DIERR_DEVICENOTREG REGDB_E_CLASSNOTREG
  1775. /*
  1776. * The requested object does not exist.
  1777. */
  1778. #define DIERR_NOTFOUND \
  1779. MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_FILE_NOT_FOUND)
  1780. /*
  1781. * The requested object does not exist.
  1782. */
  1783. #define DIERR_OBJECTNOTFOUND \
  1784. MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_FILE_NOT_FOUND)
  1785. /*
  1786. * An invalid parameter was passed to the returning function,
  1787. * or the object was not in a state that admitted the function
  1788. * to be called.
  1789. */
  1790. #define DIERR_INVALIDPARAM E_INVALIDARG
  1791. /*
  1792. * The specified interface is not supported by the object
  1793. */
  1794. #define DIERR_NOINTERFACE E_NOINTERFACE
  1795. /*
  1796. * An undetermined error occured inside the DInput subsystem
  1797. */
  1798. #define DIERR_GENERIC E_FAIL
  1799. /*
  1800. * The DInput subsystem couldn't allocate sufficient memory to complete the
  1801. * caller's request.
  1802. */
  1803. #define DIERR_OUTOFMEMORY E_OUTOFMEMORY
  1804. /*
  1805. * The function called is not supported at this time
  1806. */
  1807. #define DIERR_UNSUPPORTED E_NOTIMPL
  1808. /*
  1809. * This object has not been initialized
  1810. */
  1811. #define DIERR_NOTINITIALIZED \
  1812. MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_NOT_READY)
  1813. /*
  1814. * This object is already initialized
  1815. */
  1816. #define DIERR_ALREADYINITIALIZED \
  1817. MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_ALREADY_INITIALIZED)
  1818. /*
  1819. * This object does not support aggregation
  1820. */
  1821. #define DIERR_NOAGGREGATION CLASS_E_NOAGGREGATION
  1822. /*
  1823. * Another app has a higher priority level, preventing this call from
  1824. * succeeding.
  1825. */
  1826. #define DIERR_OTHERAPPHASPRIO E_ACCESSDENIED
  1827. /*
  1828. * Access to the device has been lost. It must be re-acquired.
  1829. */
  1830. #define DIERR_INPUTLOST \
  1831. MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_READ_FAULT)
  1832. /*
  1833. * The operation cannot be performed while the device is acquired.
  1834. */
  1835. #define DIERR_ACQUIRED \
  1836. MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_BUSY)
  1837. /*
  1838. * The operation cannot be performed unless the device is acquired.
  1839. */
  1840. #define DIERR_NOTACQUIRED \
  1841. MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_INVALID_ACCESS)
  1842. /*
  1843. * The specified property cannot be changed.
  1844. */
  1845. #define DIERR_READONLY E_ACCESSDENIED
  1846. /*
  1847. * The device already has an event notification associated with it.
  1848. */
  1849. #define DIERR_HANDLEEXISTS E_ACCESSDENIED
  1850. /*
  1851. * Data is not yet available.
  1852. */
  1853. #ifndef E_PENDING
  1854. #define E_PENDING 0x8000000AL
  1855. #endif
  1856. /*
  1857. * Unable to IDirectInputJoyConfig_Acquire because the user
  1858. * does not have sufficient privileges to change the joystick
  1859. * configuration.
  1860. */
  1861. #define DIERR_INSUFFICIENTPRIVS 0x80040200L
  1862. /*
  1863. * The device is full.
  1864. */
  1865. #define DIERR_DEVICEFULL 0x80040201L
  1866. /*
  1867. * Not all the requested information fit into the buffer.
  1868. */
  1869. #define DIERR_MOREDATA 0x80040202L
  1870. /*
  1871. * The effect is not downloaded.
  1872. */
  1873. #define DIERR_NOTDOWNLOADED 0x80040203L
  1874. /*
  1875. * The device cannot be reinitialized because there are still effects
  1876. * attached to it.
  1877. */
  1878. #define DIERR_HASEFFECTS 0x80040204L
  1879. /*
  1880. * The operation cannot be performed unless the device is acquired
  1881. * in DISCL_EXCLUSIVE mode.
  1882. */
  1883. #define DIERR_NOTEXCLUSIVEACQUIRED 0x80040205L
  1884. /*
  1885. * The effect could not be downloaded because essential information
  1886. * is missing. For example, no axes have been associated with the
  1887. * effect, or no type-specific information has been created.
  1888. */
  1889. #define DIERR_INCOMPLETEEFFECT 0x80040206L
  1890. /*
  1891. * Attempted to read buffered device data from a device that is
  1892. * not buffered.
  1893. */
  1894. #define DIERR_NOTBUFFERED 0x80040207L
  1895. /*
  1896. * An attempt was made to modify parameters of an effect while it is
  1897. * playing. Not all hardware devices support altering the parameters
  1898. * of an effect while it is playing.
  1899. */
  1900. #define DIERR_EFFECTPLAYING 0x80040208L
  1901. /*
  1902. * The operation could not be completed because the device is not
  1903. * plugged in.
  1904. */
  1905. #define DIERR_UNPLUGGED 0x80040209L
  1906. /*
  1907. * SendDeviceData failed because more information was requested
  1908. * to be sent than can be sent to the device. Some devices have
  1909. * restrictions on how much data can be sent to them. (For example,
  1910. * there might be a limit on the number of buttons that can be
  1911. * pressed at once.)
  1912. */
  1913. #define DIERR_REPORTFULL 0x8004020AL
  1914. #ifdef __cplusplus
  1915. };
  1916. #endif
  1917. #endif /* __DINPUT_INCLUDED__ */
  1918. /****************************************************************************
  1919. *
  1920. * Definitions for non-IDirectInput (VJoyD) features defined more recently
  1921. * than the current sdk files
  1922. *
  1923. ****************************************************************************/
  1924. #ifdef _INC_MMSYSTEM
  1925. #ifndef MMNOJOY
  1926. #ifndef __VJOYDX_INCLUDED__
  1927. #define __VJOYDX_INCLUDED__
  1928. #ifdef __cplusplus
  1929. extern "C" {
  1930. #endif
  1931. /*
  1932. * Flag to indicate that the dwReserved2 field of the JOYINFOEX structure
  1933. * contains mini-driver specific data to be passed by VJoyD to the mini-
  1934. * driver instead of doing a poll.
  1935. */
  1936. #define JOY_PASSDRIVERDATA 0x10000000l
  1937. /*
  1938. * Informs the joystick driver that the configuration has been changed
  1939. * and should be reloaded from the registery.
  1940. * dwFlags is reserved and should be set to zero
  1941. */
  1942. WINMMAPI MMRESULT WINAPI joyConfigChanged( DWORD dwFlags );
  1943. /*
  1944. * Hardware Setting indicating that the device is a headtracker
  1945. */
  1946. #define JOY_HWS_ISHEADTRACKER 0x02000000l
  1947. /*
  1948. * Hardware Setting indicating that the VxD is used to replace
  1949. * the standard analog polling
  1950. */
  1951. #define JOY_HWS_ISGAMEPORTDRIVER 0x04000000l
  1952. /*
  1953. * Hardware Setting indicating that the driver needs a standard
  1954. * gameport in order to communicate with the device.
  1955. */
  1956. #define JOY_HWS_ISANALOGPORTDRIVER 0x08000000l
  1957. /*
  1958. * Hardware Setting indicating that VJoyD should not load this
  1959. * driver, it will be loaded externally and will register with
  1960. * VJoyD of it's own accord.
  1961. */
  1962. #define JOY_HWS_AUTOLOAD 0x10000000l
  1963. /*
  1964. * Hardware Setting indicating that the driver acquires any
  1965. * resources needed without needing a devnode through VJoyD.
  1966. */
  1967. #define JOY_HWS_NODEVNODE 0x20000000l
  1968. /*
  1969. * Hardware Setting indicating that the device is a gameport bus
  1970. */
  1971. #define JOY_HWS_ISGAMEPORTBUS 0x80000000l
  1972. #define JOY_HWS_GAMEPORTBUSBUSY 0x00000001l
  1973. /*
  1974. * Usage Setting indicating that the settings are volatile and
  1975. * should be removed if still present on a reboot.
  1976. */
  1977. #define JOY_US_VOLATILE 0x00000008L
  1978. #ifdef __cplusplus
  1979. };
  1980. #endif
  1981. #endif /* __VJOYDX_INCLUDED__ */
  1982. #endif /* not MMNOJOY */
  1983. #endif /* _INC_MMSYSTEM */
  1984. /****************************************************************************
  1985. *
  1986. * Definitions for non-IDirectInput (VJoyD) features defined more recently
  1987. * than the current ddk files
  1988. *
  1989. ****************************************************************************/
  1990. #ifndef DIJ_RINGZERO
  1991. #ifdef _INC_MMDDK
  1992. #ifndef MMNOJOYDEV
  1993. #ifndef __VJOYDXD_INCLUDED__
  1994. #define __VJOYDXD_INCLUDED__
  1995. /*
  1996. * Poll type in which the do_other field of the JOYOEMPOLLDATA
  1997. * structure contains mini-driver specific data passed from an app.
  1998. */
  1999. #define JOY_OEMPOLL_PASSDRIVERDATA 7
  2000. #endif /* __VJOYDXD_INCLUDED__ */
  2001. #endif /* not MMNOJOYDEV */
  2002. #endif /* _INC_MMDDK */
  2003. #endif /* DIJ_RINGZERO */