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.

755 lines
32 KiB

  1. /****************************************************************************
  2. *
  3. * Copyright (C) 1995-2000 Microsoft Corporation. All Rights Reserved.
  4. *
  5. * File: dinputd.h
  6. * Content: DirectInput include file for device driver implementors
  7. *
  8. ****************************************************************************/
  9. #ifndef __DINPUTD_INCLUDED__
  10. #define __DINPUTD_INCLUDED__
  11. #ifndef DIRECTINPUT_VERSION
  12. #define DIRECTINPUT_VERSION 0x0800
  13. #pragma message(__FILE__ ": DIRECTINPUT_VERSION undefined. Defaulting to version 0x0800")
  14. #endif
  15. #ifdef __cplusplus
  16. extern "C" {
  17. #endif
  18. /****************************************************************************
  19. *
  20. * Interfaces
  21. *
  22. ****************************************************************************/
  23. #ifndef DIJ_RINGZERO
  24. DEFINE_GUID(IID_IDirectInputEffectDriver, 0x02538130,0x898F,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
  25. DEFINE_GUID(IID_IDirectInputJoyConfig, 0x1DE12AB1,0xC9F5,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
  26. DEFINE_GUID(IID_IDirectInputPIDDriver, 0xEEC6993A,0xB3FD,0x11D2,0xA9,0x16,0x00,0xC0,0x4F,0xB9,0x86,0x38);
  27. DEFINE_GUID(IID_IDirectInputJoyConfig8, 0xeb0d7dfa,0x1990,0x4f27,0xb4,0xd6,0xed,0xf2,0xee,0xc4,0xa4,0x4c);
  28. #endif /* DIJ_RINGZERO */
  29. /****************************************************************************
  30. *
  31. * IDirectInputEffectDriver
  32. *
  33. ****************************************************************************/
  34. typedef struct DIOBJECTATTRIBUTES {
  35. DWORD dwFlags;
  36. WORD wUsagePage;
  37. WORD wUsage;
  38. } DIOBJECTATTRIBUTES, *LPDIOBJECTATTRIBUTES;
  39. typedef const DIOBJECTATTRIBUTES *LPCDIOBJECTATTRIBUTES;
  40. typedef struct DIFFOBJECTATTRIBUTES {
  41. DWORD dwFFMaxForce;
  42. DWORD dwFFForceResolution;
  43. } DIFFOBJECTATTRIBUTES, *LPDIFFOBJECTATTRIBUTES;
  44. typedef const DIFFOBJECTATTRIBUTES *LPCDIFFOBJECTATTRIBUTES;
  45. typedef struct DIOBJECTCALIBRATION {
  46. LONG lMin;
  47. LONG lCenter;
  48. LONG lMax;
  49. } DIOBJECTCALIBRATION, *LPDIOBJECTCALIBRATION;
  50. typedef const DIOBJECTCALIBRATION *LPCDIOBJECTCALIBRATION;
  51. typedef struct DIPOVCALIBRATION {
  52. LONG lMin[5];
  53. LONG lMax[5];
  54. } DIPOVCALIBRATION, *LPDIPOVCALIBRATION;
  55. typedef const DIPOVCALIBRATION *LPCDIPOVCALIBRATION;
  56. typedef struct DIEFFECTATTRIBUTES {
  57. DWORD dwEffectId;
  58. DWORD dwEffType;
  59. DWORD dwStaticParams;
  60. DWORD dwDynamicParams;
  61. DWORD dwCoords;
  62. } DIEFFECTATTRIBUTES, *LPDIEFFECTATTRIBUTES;
  63. typedef const DIEFFECTATTRIBUTES *LPCDIEFFECTATTRIBUTES;
  64. typedef struct DIFFDEVICEATTRIBUTES {
  65. DWORD dwFlags;
  66. DWORD dwFFSamplePeriod;
  67. DWORD dwFFMinTimeResolution;
  68. } DIFFDEVICEATTRIBUTES, *LPDIFFDEVICEATTRIBUTES;
  69. typedef const DIFFDEVICEATTRIBUTES *LPCDIFFDEVICEATTRIBUTES;
  70. typedef struct DIDRIVERVERSIONS {
  71. DWORD dwSize;
  72. DWORD dwFirmwareRevision;
  73. DWORD dwHardwareRevision;
  74. DWORD dwFFDriverVersion;
  75. } DIDRIVERVERSIONS, *LPDIDRIVERVERSIONS;
  76. typedef const DIDRIVERVERSIONS *LPCDIDRIVERVERSIONS;
  77. typedef struct DIDEVICESTATE {
  78. DWORD dwSize;
  79. DWORD dwState;
  80. DWORD dwLoad;
  81. } DIDEVICESTATE, *LPDIDEVICESTATE;
  82. #define DEV_STS_EFFECT_RUNNING DIEGES_PLAYING
  83. #ifndef DIJ_RINGZERO
  84. typedef struct DIHIDFFINITINFO {
  85. DWORD dwSize;
  86. LPWSTR pwszDeviceInterface;
  87. GUID GuidInstance;
  88. } DIHIDFFINITINFO, *LPDIHIDFFINITINFO;
  89. #undef INTERFACE
  90. #define INTERFACE IDirectInputEffectDriver
  91. DECLARE_INTERFACE_(IDirectInputEffectDriver, IUnknown)
  92. {
  93. /*** IUnknown methods ***/
  94. STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE;
  95. STDMETHOD_(ULONG,AddRef)(THIS) PURE;
  96. STDMETHOD_(ULONG,Release)(THIS) PURE;
  97. /*** IDirectInputEffectDriver methods ***/
  98. STDMETHOD(DeviceID)(THIS_ DWORD,DWORD,DWORD,DWORD,LPVOID) PURE;
  99. STDMETHOD(GetVersions)(THIS_ LPDIDRIVERVERSIONS) PURE;
  100. STDMETHOD(Escape)(THIS_ DWORD,DWORD,LPDIEFFESCAPE) PURE;
  101. STDMETHOD(SetGain)(THIS_ DWORD,DWORD) PURE;
  102. STDMETHOD(SendForceFeedbackCommand)(THIS_ DWORD,DWORD) PURE;
  103. STDMETHOD(GetForceFeedbackState)(THIS_ DWORD,LPDIDEVICESTATE) PURE;
  104. STDMETHOD(DownloadEffect)(THIS_ DWORD,DWORD,LPDWORD,LPCDIEFFECT,DWORD) PURE;
  105. STDMETHOD(DestroyEffect)(THIS_ DWORD,DWORD) PURE;
  106. STDMETHOD(StartEffect)(THIS_ DWORD,DWORD,DWORD,DWORD) PURE;
  107. STDMETHOD(StopEffect)(THIS_ DWORD,DWORD) PURE;
  108. STDMETHOD(GetEffectStatus)(THIS_ DWORD,DWORD,LPDWORD) PURE;
  109. };
  110. typedef struct IDirectInputEffectDriver *LPDIRECTINPUTEFFECTDRIVER;
  111. #if !defined(__cplusplus) || defined(CINTERFACE)
  112. #define IDirectInputEffectDriver_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
  113. #define IDirectInputEffectDriver_AddRef(p) (p)->lpVtbl->AddRef(p)
  114. #define IDirectInputEffectDriver_Release(p) (p)->lpVtbl->Release(p)
  115. #define IDirectInputEffectDriver_DeviceID(p,a,b,c,d,e) (p)->lpVtbl->DeviceID(p,a,b,c,d,e)
  116. #define IDirectInputEffectDriver_GetVersions(p,a) (p)->lpVtbl->GetVersions(p,a)
  117. #define IDirectInputEffectDriver_Escape(p,a,b,c) (p)->lpVtbl->Escape(p,a,b,c)
  118. #define IDirectInputEffectDriver_SetGain(p,a,b) (p)->lpVtbl->SetGain(p,a,b)
  119. #define IDirectInputEffectDriver_SendForceFeedbackCommand(p,a,b) (p)->lpVtbl->SendForceFeedbackCommand(p,a,b)
  120. #define IDirectInputEffectDriver_GetForceFeedbackState(p,a,b) (p)->lpVtbl->GetForceFeedbackState(p,a,b)
  121. #define IDirectInputEffectDriver_DownloadEffect(p,a,b,c,d,e) (p)->lpVtbl->DownloadEffect(p,a,b,c,d,e)
  122. #define IDirectInputEffectDriver_DestroyEffect(p,a,b) (p)->lpVtbl->DestroyEffect(p,a,b)
  123. #define IDirectInputEffectDriver_StartEffect(p,a,b,c,d) (p)->lpVtbl->StartEffect(p,a,b,c,d)
  124. #define IDirectInputEffectDriver_StopEffect(p,a,b) (p)->lpVtbl->StopEffect(p,a,b)
  125. #define IDirectInputEffectDriver_GetEffectStatus(p,a,b,c) (p)->lpVtbl->GetEffectStatus(p,a,b,c)
  126. #else
  127. #define IDirectInputEffectDriver_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
  128. #define IDirectInputEffectDriver_AddRef(p) (p)->AddRef()
  129. #define IDirectInputEffectDriver_Release(p) (p)->Release()
  130. #define IDirectInputEffectDriver_DeviceID(p,a,b,c,d,e) (p)->DeviceID(a,b,c,d,e)
  131. #define IDirectInputEffectDriver_GetVersions(p,a) (p)->GetVersions(a)
  132. #define IDirectInputEffectDriver_Escape(p,a,b,c) (p)->Escape(a,b,c)
  133. #define IDirectInputEffectDriver_SetGain(p,a,b) (p)->SetGain(a,b)
  134. #define IDirectInputEffectDriver_SendForceFeedbackCommand(p,a,b) (p)->SendForceFeedbackCommand(a,b)
  135. #define IDirectInputEffectDriver_GetForceFeedbackState(p,a,b) (p)->GetForceFeedbackState(a,b)
  136. #define IDirectInputEffectDriver_DownloadEffect(p,a,b,c,d,e) (p)->DownloadEffect(a,b,c,d,e)
  137. #define IDirectInputEffectDriver_DestroyEffect(p,a,b) (p)->DestroyEffect(a,b)
  138. #define IDirectInputEffectDriver_StartEffect(p,a,b,c,d) (p)->StartEffect(a,b,c,d)
  139. #define IDirectInputEffectDriver_StopEffect(p,a,b) (p)->StopEffect(a,b)
  140. #define IDirectInputEffectDriver_GetEffectStatus(p,a,b,c) (p)->GetEffectStatus(a,b,c)
  141. #endif
  142. #endif /* DIJ_RINGZERO */
  143. /****************************************************************************
  144. *
  145. * IDirectInputJoyConfig
  146. *
  147. ****************************************************************************/
  148. /****************************************************************************
  149. *
  150. * Definitions copied from the DDK
  151. *
  152. ****************************************************************************/
  153. #ifndef JOY_HW_NONE
  154. /* pre-defined joystick types */
  155. #define JOY_HW_NONE 0
  156. #define JOY_HW_CUSTOM 1
  157. #define JOY_HW_2A_2B_GENERIC 2
  158. #define JOY_HW_2A_4B_GENERIC 3
  159. #define JOY_HW_2B_GAMEPAD 4
  160. #define JOY_HW_2B_FLIGHTYOKE 5
  161. #define JOY_HW_2B_FLIGHTYOKETHROTTLE 6
  162. #define JOY_HW_3A_2B_GENERIC 7
  163. #define JOY_HW_3A_4B_GENERIC 8
  164. #define JOY_HW_4B_GAMEPAD 9
  165. #define JOY_HW_4B_FLIGHTYOKE 10
  166. #define JOY_HW_4B_FLIGHTYOKETHROTTLE 11
  167. #define JOY_HW_TWO_2A_2B_WITH_Y 12
  168. #define JOY_HW_LASTENTRY 13
  169. /* calibration flags */
  170. #define JOY_ISCAL_XY 0x00000001l /* XY are calibrated */
  171. #define JOY_ISCAL_Z 0x00000002l /* Z is calibrated */
  172. #define JOY_ISCAL_R 0x00000004l /* R is calibrated */
  173. #define JOY_ISCAL_U 0x00000008l /* U is calibrated */
  174. #define JOY_ISCAL_V 0x00000010l /* V is calibrated */
  175. #define JOY_ISCAL_POV 0x00000020l /* POV is calibrated */
  176. /* point of view constants */
  177. #define JOY_POV_NUMDIRS 4
  178. #define JOY_POVVAL_FORWARD 0
  179. #define JOY_POVVAL_BACKWARD 1
  180. #define JOY_POVVAL_LEFT 2
  181. #define JOY_POVVAL_RIGHT 3
  182. /* Specific settings for joystick hardware */
  183. #define JOY_HWS_HASZ 0x00000001l /* has Z info? */
  184. #define JOY_HWS_HASPOV 0x00000002l /* point of view hat present */
  185. #define JOY_HWS_POVISBUTTONCOMBOS 0x00000004l /* pov done through combo of buttons */
  186. #define JOY_HWS_POVISPOLL 0x00000008l /* pov done through polling */
  187. #define JOY_HWS_ISYOKE 0x00000010l /* joystick is a flight yoke */
  188. #define JOY_HWS_ISGAMEPAD 0x00000020l /* joystick is a game pad */
  189. #define JOY_HWS_ISCARCTRL 0x00000040l /* joystick is a car controller */
  190. /* X defaults to J1 X axis */
  191. #define JOY_HWS_XISJ1Y 0x00000080l /* X is on J1 Y axis */
  192. #define JOY_HWS_XISJ2X 0x00000100l /* X is on J2 X axis */
  193. #define JOY_HWS_XISJ2Y 0x00000200l /* X is on J2 Y axis */
  194. /* Y defaults to J1 Y axis */
  195. #define JOY_HWS_YISJ1X 0x00000400l /* Y is on J1 X axis */
  196. #define JOY_HWS_YISJ2X 0x00000800l /* Y is on J2 X axis */
  197. #define JOY_HWS_YISJ2Y 0x00001000l /* Y is on J2 Y axis */
  198. /* Z defaults to J2 Y axis */
  199. #define JOY_HWS_ZISJ1X 0x00002000l /* Z is on J1 X axis */
  200. #define JOY_HWS_ZISJ1Y 0x00004000l /* Z is on J1 Y axis */
  201. #define JOY_HWS_ZISJ2X 0x00008000l /* Z is on J2 X axis */
  202. /* POV defaults to J2 Y axis, if it is not button based */
  203. #define JOY_HWS_POVISJ1X 0x00010000l /* pov done through J1 X axis */
  204. #define JOY_HWS_POVISJ1Y 0x00020000l /* pov done through J1 Y axis */
  205. #define JOY_HWS_POVISJ2X 0x00040000l /* pov done through J2 X axis */
  206. /* R defaults to J2 X axis */
  207. #define JOY_HWS_HASR 0x00080000l /* has R (4th axis) info */
  208. #define JOY_HWS_RISJ1X 0x00100000l /* R done through J1 X axis */
  209. #define JOY_HWS_RISJ1Y 0x00200000l /* R done through J1 Y axis */
  210. #define JOY_HWS_RISJ2Y 0x00400000l /* R done through J2 X axis */
  211. /* U & V for future hardware */
  212. #define JOY_HWS_HASU 0x00800000l /* has U (5th axis) info */
  213. #define JOY_HWS_HASV 0x01000000l /* has V (6th axis) info */
  214. /* Usage settings */
  215. #define JOY_US_HASRUDDER 0x00000001l /* joystick configured with rudder */
  216. #define JOY_US_PRESENT 0x00000002l /* is joystick actually present? */
  217. #define JOY_US_ISOEM 0x00000004l /* joystick is an OEM defined type */
  218. /* reserved for future use -> as link to next possible dword */
  219. #define JOY_US_RESERVED 0x80000000l /* reserved */
  220. /* Settings for TypeInfo Flags1 */
  221. #define JOYTYPE_ZEROGAMEENUMOEMDATA 0x00000001l /* Zero GameEnum's OEM data field */
  222. #define JOYTYPE_NOAUTODETECTGAMEPORT 0x00000002l /* Device does not support Autodetect gameport*/
  223. #define JOYTYPE_NOHIDDIRECT 0x00000004l /* Do not use HID directly for this device */
  224. #define JOYTYPE_ANALOGCOMPAT 0x00000008l /* Expose the analog compatible ID */
  225. #define JOYTYPE_DEFAULTPROPSHEET 0x80000000l /* CPL overrides custom property sheet */
  226. /* Settings for TypeInfo Flags2 */
  227. #define JOYTYPE_DEVICEHIDE 0x00010000l /* Hide unclassified devices */
  228. #define JOYTYPE_MOUSEHIDE 0x00020000l /* Hide mice */
  229. #define JOYTYPE_KEYBHIDE 0x00040000l /* Hide keyboards */
  230. #define JOYTYPE_GAMEHIDE 0x00080000l /* Hide game controllers */
  231. #define JOYTYPE_HIDEACTIVE 0x00100000l /* Hide flags are active */
  232. #define JOYTYPE_INFOMASK 0x00E00000l /* Mask for type specific info */
  233. #define JOYTYPE_INFODEFAULT 0x00000000l /* Use default axis mappings */
  234. #define JOYTYPE_INFOYYPEDALS 0x00200000l /* Use Y as a combined pedals axis */
  235. #define JOYTYPE_INFOZYPEDALS 0x00400000l /* Use Z for accelerate, Y for brake */
  236. #define JOYTYPE_INFOYRPEDALS 0x00600000l /* Use Y for accelerate, R for brake */
  237. #define JOYTYPE_INFOZRPEDALS 0x00800000l /* Use Z for accelerate, R for brake */
  238. #define JOYTYPE_INFOZISSLIDER 0x00200000l /* Use Z as a slider */
  239. #define JOYTYPE_INFOZISZ 0x00400000l /* Use Z as Z axis */
  240. #define JOYTYPE_ENABLEINPUTREPORT 0x01000000l /* Enable initial input reports */
  241. /* struct for storing x,y, z, and rudder values */
  242. typedef struct joypos_tag {
  243. DWORD dwX;
  244. DWORD dwY;
  245. DWORD dwZ;
  246. DWORD dwR;
  247. DWORD dwU;
  248. DWORD dwV;
  249. } JOYPOS, FAR *LPJOYPOS;
  250. /* struct for storing ranges */
  251. typedef struct joyrange_tag {
  252. JOYPOS jpMin;
  253. JOYPOS jpMax;
  254. JOYPOS jpCenter;
  255. } JOYRANGE,FAR *LPJOYRANGE;
  256. /*
  257. * dwTimeout - value at which to timeout joystick polling
  258. * jrvRanges - range of values app wants returned for axes
  259. * jpDeadZone - area around center to be considered
  260. * as "dead". specified as a percentage
  261. * (0-100). Only X & Y handled by system driver
  262. */
  263. typedef struct joyreguservalues_tag {
  264. DWORD dwTimeOut;
  265. JOYRANGE jrvRanges;
  266. JOYPOS jpDeadZone;
  267. } JOYREGUSERVALUES, FAR *LPJOYREGUSERVALUES;
  268. typedef struct joyreghwsettings_tag {
  269. DWORD dwFlags;
  270. DWORD dwNumButtons;
  271. } JOYREGHWSETTINGS, FAR *LPJOYHWSETTINGS;
  272. /* range of values returned by the hardware (filled in by calibration) */
  273. /*
  274. * jrvHardware - values returned by hardware
  275. * dwPOVValues - POV values returned by hardware
  276. * dwCalFlags - what has been calibrated
  277. */
  278. typedef struct joyreghwvalues_tag {
  279. JOYRANGE jrvHardware;
  280. DWORD dwPOVValues[JOY_POV_NUMDIRS];
  281. DWORD dwCalFlags;
  282. } JOYREGHWVALUES, FAR *LPJOYREGHWVALUES;
  283. /* hardware configuration */
  284. /*
  285. * hws - hardware settings
  286. * dwUsageSettings - usage settings
  287. * hwv - values returned by hardware
  288. * dwType - type of joystick
  289. * dwReserved - reserved for OEM drivers
  290. */
  291. typedef struct joyreghwconfig_tag {
  292. JOYREGHWSETTINGS hws;
  293. DWORD dwUsageSettings;
  294. JOYREGHWVALUES hwv;
  295. DWORD dwType;
  296. DWORD dwReserved;
  297. } JOYREGHWCONFIG, FAR *LPJOYREGHWCONFIG;
  298. /* joystick calibration info structure */
  299. typedef struct joycalibrate_tag {
  300. UINT wXbase;
  301. UINT wXdelta;
  302. UINT wYbase;
  303. UINT wYdelta;
  304. UINT wZbase;
  305. UINT wZdelta;
  306. } JOYCALIBRATE;
  307. typedef JOYCALIBRATE FAR *LPJOYCALIBRATE;
  308. #endif
  309. #ifndef DIJ_RINGZERO
  310. #define MAX_JOYSTRING 256
  311. typedef BOOL (FAR PASCAL * LPDIJOYTYPECALLBACK)(LPCWSTR, LPVOID);
  312. #ifndef MAX_JOYSTICKOEMVXDNAME
  313. #define MAX_JOYSTICKOEMVXDNAME 260
  314. #endif
  315. #define DITC_REGHWSETTINGS 0x00000001
  316. #define DITC_CLSIDCONFIG 0x00000002
  317. #define DITC_DISPLAYNAME 0x00000004
  318. #define DITC_CALLOUT 0x00000008
  319. #define DITC_HARDWAREID 0x00000010
  320. #define DITC_FLAGS1 0x00000020
  321. #define DITC_FLAGS2 0x00000040
  322. #define DITC_MAPFILE 0x00000080
  323. /* This structure is defined for DirectX 5.0 compatibility */
  324. typedef struct DIJOYTYPEINFO_DX5 {
  325. DWORD dwSize;
  326. JOYREGHWSETTINGS hws;
  327. CLSID clsidConfig;
  328. WCHAR wszDisplayName[MAX_JOYSTRING];
  329. WCHAR wszCallout[MAX_JOYSTICKOEMVXDNAME];
  330. } DIJOYTYPEINFO_DX5, *LPDIJOYTYPEINFO_DX5;
  331. typedef const DIJOYTYPEINFO_DX5 *LPCDIJOYTYPEINFO_DX5;
  332. /* This structure is defined for DirectX 6.1 compatibility */
  333. typedef struct DIJOYTYPEINFO_DX6 {
  334. DWORD dwSize;
  335. JOYREGHWSETTINGS hws;
  336. CLSID clsidConfig;
  337. WCHAR wszDisplayName[MAX_JOYSTRING];
  338. WCHAR wszCallout[MAX_JOYSTICKOEMVXDNAME];
  339. WCHAR wszHardwareId[MAX_JOYSTRING];
  340. DWORD dwFlags1;
  341. } DIJOYTYPEINFO_DX6, *LPDIJOYTYPEINFO_DX6;
  342. typedef const DIJOYTYPEINFO_DX6 *LPCDIJOYTYPEINFO_DX6;
  343. typedef struct DIJOYTYPEINFO {
  344. DWORD dwSize;
  345. JOYREGHWSETTINGS hws;
  346. CLSID clsidConfig;
  347. WCHAR wszDisplayName[MAX_JOYSTRING];
  348. WCHAR wszCallout[MAX_JOYSTICKOEMVXDNAME];
  349. #if(DIRECTINPUT_VERSION >= 0x05b2)
  350. WCHAR wszHardwareId[MAX_JOYSTRING];
  351. DWORD dwFlags1;
  352. #if(DIRECTINPUT_VERSION >= 0x0800)
  353. DWORD dwFlags2;
  354. WCHAR wszMapFile[MAX_JOYSTRING];
  355. #endif /* DIRECTINPUT_VERSION >= 0x0800 */
  356. #endif /* DIRECTINPUT_VERSION >= 0x05b2 */
  357. } DIJOYTYPEINFO, *LPDIJOYTYPEINFO;
  358. typedef const DIJOYTYPEINFO *LPCDIJOYTYPEINFO;
  359. #define DIJC_GUIDINSTANCE 0x00000001
  360. #define DIJC_REGHWCONFIGTYPE 0x00000002
  361. #define DIJC_GAIN 0x00000004
  362. #define DIJC_CALLOUT 0x00000008
  363. #define DIJC_WDMGAMEPORT 0x00000010
  364. /* This structure is defined for DirectX 5.0 compatibility */
  365. typedef struct DIJOYCONFIG_DX5 {
  366. DWORD dwSize;
  367. GUID guidInstance;
  368. JOYREGHWCONFIG hwc;
  369. DWORD dwGain;
  370. WCHAR wszType[MAX_JOYSTRING];
  371. WCHAR wszCallout[MAX_JOYSTRING];
  372. } DIJOYCONFIG_DX5, *LPDIJOYCONFIG_DX5;
  373. typedef const DIJOYCONFIG_DX5 *LPCDIJOYCONFIG_DX5;
  374. typedef struct DIJOYCONFIG {
  375. DWORD dwSize;
  376. GUID guidInstance;
  377. JOYREGHWCONFIG hwc;
  378. DWORD dwGain;
  379. WCHAR wszType[MAX_JOYSTRING];
  380. WCHAR wszCallout[MAX_JOYSTRING];
  381. #if(DIRECTINPUT_VERSION >= 0x05b2)
  382. GUID guidGameport;
  383. #endif /* DIRECTINPUT_VERSION >= 0x05b2 */
  384. } DIJOYCONFIG, *LPDIJOYCONFIG;
  385. typedef const DIJOYCONFIG *LPCDIJOYCONFIG;
  386. #define DIJU_USERVALUES 0x00000001
  387. #define DIJU_GLOBALDRIVER 0x00000002
  388. #define DIJU_GAMEPORTEMULATOR 0x00000004
  389. typedef struct DIJOYUSERVALUES {
  390. DWORD dwSize;
  391. JOYREGUSERVALUES ruv;
  392. WCHAR wszGlobalDriver[MAX_JOYSTRING];
  393. WCHAR wszGameportEmulator[MAX_JOYSTRING];
  394. } DIJOYUSERVALUES, *LPDIJOYUSERVALUES;
  395. typedef const DIJOYUSERVALUES *LPCDIJOYUSERVALUES;
  396. DEFINE_GUID(GUID_KeyboardClass, 0x4D36E96B,0xE325,0x11CE,0xBF,0xC1,0x08,0x00,0x2B,0xE1,0x03,0x18);
  397. DEFINE_GUID(GUID_MediaClass, 0x4D36E96C,0xE325,0x11CE,0xBF,0xC1,0x08,0x00,0x2B,0xE1,0x03,0x18);
  398. DEFINE_GUID(GUID_MouseClass, 0x4D36E96F,0xE325,0x11CE,0xBF,0xC1,0x08,0x00,0x2B,0xE1,0x03,0x18);
  399. DEFINE_GUID(GUID_HIDClass, 0x745A17A0,0x74D3,0x11D0,0xB6,0xFE,0x00,0xA0,0xC9,0x0F,0x57,0xDA);
  400. #undef INTERFACE
  401. #define INTERFACE IDirectInputJoyConfig
  402. DECLARE_INTERFACE_(IDirectInputJoyConfig, IUnknown)
  403. {
  404. /*** IUnknown methods ***/
  405. STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE;
  406. STDMETHOD_(ULONG,AddRef)(THIS) PURE;
  407. STDMETHOD_(ULONG,Release)(THIS) PURE;
  408. /*** IDirectInputJoyConfig methods ***/
  409. STDMETHOD(Acquire)(THIS) PURE;
  410. STDMETHOD(Unacquire)(THIS) PURE;
  411. STDMETHOD(SetCooperativeLevel)(THIS_ HWND,DWORD) PURE;
  412. STDMETHOD(SendNotify)(THIS) PURE;
  413. STDMETHOD(EnumTypes)(THIS_ LPDIJOYTYPECALLBACK,LPVOID) PURE;
  414. STDMETHOD(GetTypeInfo)(THIS_ LPCWSTR,LPDIJOYTYPEINFO,DWORD) PURE;
  415. STDMETHOD(SetTypeInfo)(THIS_ LPCWSTR,LPCDIJOYTYPEINFO,DWORD) PURE;
  416. STDMETHOD(DeleteType)(THIS_ LPCWSTR) PURE;
  417. STDMETHOD(GetConfig)(THIS_ UINT,LPDIJOYCONFIG,DWORD) PURE;
  418. STDMETHOD(SetConfig)(THIS_ UINT,LPCDIJOYCONFIG,DWORD) PURE;
  419. STDMETHOD(DeleteConfig)(THIS_ UINT) PURE;
  420. STDMETHOD(GetUserValues)(THIS_ LPDIJOYUSERVALUES,DWORD) PURE;
  421. STDMETHOD(SetUserValues)(THIS_ LPCDIJOYUSERVALUES,DWORD) PURE;
  422. STDMETHOD(AddNewHardware)(THIS_ HWND,REFGUID) PURE;
  423. STDMETHOD(OpenTypeKey)(THIS_ LPCWSTR,DWORD,PHKEY) PURE;
  424. STDMETHOD(OpenConfigKey)(THIS_ UINT,DWORD,PHKEY) PURE;
  425. };
  426. typedef struct IDirectInputJoyConfig *LPDIRECTINPUTJOYCONFIG;
  427. #if !defined(__cplusplus) || defined(CINTERFACE)
  428. #define IDirectInputJoyConfig_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
  429. #define IDirectInputJoyConfig_AddRef(p) (p)->lpVtbl->AddRef(p)
  430. #define IDirectInputJoyConfig_Release(p) (p)->lpVtbl->Release(p)
  431. #define IDirectInputJoyConfig_Acquire(p) (p)->lpVtbl->Acquire(p)
  432. #define IDirectInputJoyConfig_Unacquire(p) (p)->lpVtbl->Unacquire(p)
  433. #define IDirectInputJoyConfig_SetCooperativeLevel(p,a,b) (p)->lpVtbl->SetCooperativeLevel(p,a,b)
  434. #define IDirectInputJoyConfig_SendNotify(p) (p)->lpVtbl->SendNotify(p)
  435. #define IDirectInputJoyConfig_EnumTypes(p,a,b) (p)->lpVtbl->EnumTypes(p,a,b)
  436. #define IDirectInputJoyConfig_GetTypeInfo(p,a,b,c) (p)->lpVtbl->GetTypeInfo(p,a,b,c)
  437. #define IDirectInputJoyConfig_SetTypeInfo(p,a,b,c) (p)->lpVtbl->SetTypeInfo(p,a,b,c)
  438. #define IDirectInputJoyConfig_DeleteType(p,a) (p)->lpVtbl->DeleteType(p,a)
  439. #define IDirectInputJoyConfig_GetConfig(p,a,b,c) (p)->lpVtbl->GetConfig(p,a,b,c)
  440. #define IDirectInputJoyConfig_SetConfig(p,a,b,c) (p)->lpVtbl->SetConfig(p,a,b,c)
  441. #define IDirectInputJoyConfig_DeleteConfig(p,a) (p)->lpVtbl->DeleteConfig(p,a)
  442. #define IDirectInputJoyConfig_GetUserValues(p,a,b) (p)->lpVtbl->GetUserValues(p,a,b)
  443. #define IDirectInputJoyConfig_SetUserValues(p,a,b) (p)->lpVtbl->SetUserValues(p,a,b)
  444. #define IDirectInputJoyConfig_AddNewHardware(p,a,b) (p)->lpVtbl->AddNewHardware(p,a,b)
  445. #define IDirectInputJoyConfig_OpenTypeKey(p,a,b,c) (p)->lpVtbl->OpenTypeKey(p,a,b,c)
  446. #define IDirectInputJoyConfig_OpenConfigKey(p,a,b,c) (p)->lpVtbl->OpenConfigKey(p,a,b,c)
  447. #else
  448. #define IDirectInputJoyConfig_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
  449. #define IDirectInputJoyConfig_AddRef(p) (p)->AddRef()
  450. #define IDirectInputJoyConfig_Release(p) (p)->Release()
  451. #define IDirectInputJoyConfig_Acquire(p) (p)->Acquire()
  452. #define IDirectInputJoyConfig_Unacquire(p) (p)->Unacquire()
  453. #define IDirectInputJoyConfig_SetCooperativeLevel(p,a,b) (p)->SetCooperativeLevel(a,b)
  454. #define IDirectInputJoyConfig_SendNotify(p) (p)->SendNotify()
  455. #define IDirectInputJoyConfig_EnumTypes(p,a,b) (p)->EnumTypes(a,b)
  456. #define IDirectInputJoyConfig_GetTypeInfo(p,a,b,c) (p)->GetTypeInfo(a,b,c)
  457. #define IDirectInputJoyConfig_SetTypeInfo(p,a,b,c) (p)->SetTypeInfo(a,b,c)
  458. #define IDirectInputJoyConfig_DeleteType(p,a) (p)->DeleteType(a)
  459. #define IDirectInputJoyConfig_GetConfig(p,a,b,c) (p)->GetConfig(a,b,c)
  460. #define IDirectInputJoyConfig_SetConfig(p,a,b,c) (p)->SetConfig(a,b,c)
  461. #define IDirectInputJoyConfig_DeleteConfig(p,a) (p)->DeleteConfig(a)
  462. #define IDirectInputJoyConfig_GetUserValues(p,a,b) (p)->GetUserValues(a,b)
  463. #define IDirectInputJoyConfig_SetUserValues(p,a,b) (p)->SetUserValues(a,b)
  464. #define IDirectInputJoyConfig_AddNewHardware(p,a,b) (p)->AddNewHardware(a,b)
  465. #define IDirectInputJoyConfig_OpenTypeKey(p,a,b,c) (p)->OpenTypeKey(a,b,c)
  466. #define IDirectInputJoyConfig_OpenConfigKey(p,a,b,c) (p)->OpenConfigKey(a,b,c)
  467. #endif
  468. #endif /* DIJ_RINGZERO */
  469. #if(DIRECTINPUT_VERSION >= 0x0800)
  470. #ifndef DIJ_RINGZERO
  471. #undef INTERFACE
  472. #define INTERFACE IDirectInputJoyConfig8
  473. DECLARE_INTERFACE_(IDirectInputJoyConfig8, IUnknown)
  474. {
  475. /*** IUnknown methods ***/
  476. STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE;
  477. STDMETHOD_(ULONG,AddRef)(THIS) PURE;
  478. STDMETHOD_(ULONG,Release)(THIS) PURE;
  479. /*** IDirectInputJoyConfig8 methods ***/
  480. STDMETHOD(Acquire)(THIS) PURE;
  481. STDMETHOD(Unacquire)(THIS) PURE;
  482. STDMETHOD(SetCooperativeLevel)(THIS_ HWND,DWORD) PURE;
  483. STDMETHOD(SendNotify)(THIS) PURE;
  484. STDMETHOD(EnumTypes)(THIS_ LPDIJOYTYPECALLBACK,LPVOID) PURE;
  485. STDMETHOD(GetTypeInfo)(THIS_ LPCWSTR,LPDIJOYTYPEINFO,DWORD) PURE;
  486. STDMETHOD(SetTypeInfo)(THIS_ LPCWSTR,LPCDIJOYTYPEINFO,DWORD,LPWSTR) PURE;
  487. STDMETHOD(DeleteType)(THIS_ LPCWSTR) PURE;
  488. STDMETHOD(GetConfig)(THIS_ UINT,LPDIJOYCONFIG,DWORD) PURE;
  489. STDMETHOD(SetConfig)(THIS_ UINT,LPCDIJOYCONFIG,DWORD) PURE;
  490. STDMETHOD(DeleteConfig)(THIS_ UINT) PURE;
  491. STDMETHOD(GetUserValues)(THIS_ LPDIJOYUSERVALUES,DWORD) PURE;
  492. STDMETHOD(SetUserValues)(THIS_ LPCDIJOYUSERVALUES,DWORD) PURE;
  493. STDMETHOD(AddNewHardware)(THIS_ HWND,REFGUID) PURE;
  494. STDMETHOD(OpenTypeKey)(THIS_ LPCWSTR,DWORD,PHKEY) PURE;
  495. STDMETHOD(OpenAppStatusKey)(THIS_ PHKEY) PURE;
  496. };
  497. typedef struct IDirectInputJoyConfig8 *LPDIRECTINPUTJOYCONFIG8;
  498. #if !defined(__cplusplus) || defined(CINTERFACE)
  499. #define IDirectInputJoyConfig8_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
  500. #define IDirectInputJoyConfig8_AddRef(p) (p)->lpVtbl->AddRef(p)
  501. #define IDirectInputJoyConfig8_Release(p) (p)->lpVtbl->Release(p)
  502. #define IDirectInputJoyConfig8_Acquire(p) (p)->lpVtbl->Acquire(p)
  503. #define IDirectInputJoyConfig8_Unacquire(p) (p)->lpVtbl->Unacquire(p)
  504. #define IDirectInputJoyConfig8_SetCooperativeLevel(p,a,b) (p)->lpVtbl->SetCooperativeLevel(p,a,b)
  505. #define IDirectInputJoyConfig8_SendNotify(p) (p)->lpVtbl->SendNotify(p)
  506. #define IDirectInputJoyConfig8_EnumTypes(p,a,b) (p)->lpVtbl->EnumTypes(p,a,b)
  507. #define IDirectInputJoyConfig8_GetTypeInfo(p,a,b,c) (p)->lpVtbl->GetTypeInfo(p,a,b,c)
  508. #define IDirectInputJoyConfig8_SetTypeInfo(p,a,b,c,d) (p)->lpVtbl->SetTypeInfo(p,a,b,c,d)
  509. #define IDirectInputJoyConfig8_DeleteType(p,a) (p)->lpVtbl->DeleteType(p,a)
  510. #define IDirectInputJoyConfig8_GetConfig(p,a,b,c) (p)->lpVtbl->GetConfig(p,a,b,c)
  511. #define IDirectInputJoyConfig8_SetConfig(p,a,b,c) (p)->lpVtbl->SetConfig(p,a,b,c)
  512. #define IDirectInputJoyConfig8_DeleteConfig(p,a) (p)->lpVtbl->DeleteConfig(p,a)
  513. #define IDirectInputJoyConfig8_GetUserValues(p,a,b) (p)->lpVtbl->GetUserValues(p,a,b)
  514. #define IDirectInputJoyConfig8_SetUserValues(p,a,b) (p)->lpVtbl->SetUserValues(p,a,b)
  515. #define IDirectInputJoyConfig8_AddNewHardware(p,a,b) (p)->lpVtbl->AddNewHardware(p,a,b)
  516. #define IDirectInputJoyConfig8_OpenTypeKey(p,a,b,c) (p)->lpVtbl->OpenTypeKey(p,a,b,c)
  517. #define IDirectInputJoyConfig8_OpenAppStatusKey(p,a) (p)->lpVtbl->OpenAppStatusKey(p,a)
  518. #else
  519. #define IDirectInputJoyConfig8_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
  520. #define IDirectInputJoyConfig8_AddRef(p) (p)->AddRef()
  521. #define IDirectInputJoyConfig8_Release(p) (p)->Release()
  522. #define IDirectInputJoyConfig8_Acquire(p) (p)->Acquire()
  523. #define IDirectInputJoyConfig8_Unacquire(p) (p)->Unacquire()
  524. #define IDirectInputJoyConfig8_SetCooperativeLevel(p,a,b) (p)->SetCooperativeLevel(a,b)
  525. #define IDirectInputJoyConfig8_SendNotify(p) (p)->SendNotify()
  526. #define IDirectInputJoyConfig8_EnumTypes(p,a,b) (p)->EnumTypes(a,b)
  527. #define IDirectInputJoyConfig8_GetTypeInfo(p,a,b,c) (p)->GetTypeInfo(a,b,c)
  528. #define IDirectInputJoyConfig8_SetTypeInfo(p,a,b,c,d) (p)->SetTypeInfo(a,b,c,d)
  529. #define IDirectInputJoyConfig8_DeleteType(p,a) (p)->DeleteType(a)
  530. #define IDirectInputJoyConfig8_GetConfig(p,a,b,c) (p)->GetConfig(a,b,c)
  531. #define IDirectInputJoyConfig8_SetConfig(p,a,b,c) (p)->SetConfig(a,b,c)
  532. #define IDirectInputJoyConfig8_DeleteConfig(p,a) (p)->DeleteConfig(a)
  533. #define IDirectInputJoyConfig8_GetUserValues(p,a,b) (p)->GetUserValues(a,b)
  534. #define IDirectInputJoyConfig8_SetUserValues(p,a,b) (p)->SetUserValues(a,b)
  535. #define IDirectInputJoyConfig8_AddNewHardware(p,a,b) (p)->AddNewHardware(a,b)
  536. #define IDirectInputJoyConfig8_OpenTypeKey(p,a,b,c) (p)->OpenTypeKey(a,b,c)
  537. #define IDirectInputJoyConfig8_OpenAppStatusKey(p,a) (p)->OpenAppStatusKey(a)
  538. #endif
  539. #endif /* DIJ_RINGZERO */
  540. /****************************************************************************
  541. *
  542. * Notification Messages
  543. *
  544. ****************************************************************************/
  545. /* RegisterWindowMessage with this to get DirectInput notification messages */
  546. #define DIRECTINPUT_NOTIFICATION_MSGSTRINGA "DIRECTINPUT_NOTIFICATION_MSGSTRING"
  547. #define DIRECTINPUT_NOTIFICATION_MSGSTRINGW L"DIRECTINPUT_NOTIFICATION_MSGSTRING"
  548. #ifdef UNICODE
  549. #define DIRECTINPUT_NOTIFICATION_MSGSTRING DIRECTINPUT_NOTIFICATION_MSGSTRINGW
  550. #else
  551. #define DIRECTINPUT_NOTIFICATION_MSGSTRING DIRECTINPUT_NOTIFICATION_MSGSTRINGA
  552. #endif
  553. #define DIMSGWP_NEWAPPSTART 0x00000001
  554. #define DIMSGWP_DX8APPSTART 0x00000002
  555. #define DIMSGWP_DX8MAPPERAPPSTART 0x00000003
  556. #endif /* DIRECTINPUT_VERSION >= 0x0800 */
  557. #define DIAPPIDFLAG_NOTIME 0x00000001
  558. #define DIAPPIDFLAG_NOSIZE 0x00000002
  559. #define DIRECTINPUT_REGSTR_VAL_APPIDFLAGA "AppIdFlag"
  560. #define DIRECTINPUT_REGSTR_KEY_LASTAPPA "MostRecentApplication"
  561. #define DIRECTINPUT_REGSTR_KEY_LASTMAPAPPA "MostRecentMapperApplication"
  562. #define DIRECTINPUT_REGSTR_VAL_VERSIONA "Version"
  563. #define DIRECTINPUT_REGSTR_VAL_NAMEA "Name"
  564. #define DIRECTINPUT_REGSTR_VAL_IDA "Id"
  565. #define DIRECTINPUT_REGSTR_VAL_MAPPERA "UsesMapper"
  566. #define DIRECTINPUT_REGSTR_VAL_LASTSTARTA "MostRecentStart"
  567. #define DIRECTINPUT_REGSTR_VAL_APPIDFLAGW L"AppIdFlag"
  568. #define DIRECTINPUT_REGSTR_KEY_LASTAPPW L"MostRecentApplication"
  569. #define DIRECTINPUT_REGSTR_KEY_LASTMAPAPPW L"MostRecentMapperApplication"
  570. #define DIRECTINPUT_REGSTR_VAL_VERSIONW L"Version"
  571. #define DIRECTINPUT_REGSTR_VAL_NAMEW L"Name"
  572. #define DIRECTINPUT_REGSTR_VAL_IDW L"Id"
  573. #define DIRECTINPUT_REGSTR_VAL_MAPPERW L"UsesMapper"
  574. #define DIRECTINPUT_REGSTR_VAL_LASTSTARTW L"MostRecentStart"
  575. #ifdef UNICODE
  576. #define DIRECTINPUT_REGSTR_VAL_APPIDFLAG DIRECTINPUT_REGSTR_VAL_APPIDFLAGW
  577. #define DIRECTINPUT_REGSTR_KEY_LASTAPP DIRECTINPUT_REGSTR_KEY_LASTAPPW
  578. #define DIRECTINPUT_REGSTR_KEY_LASTMAPAPP DIRECTINPUT_REGSTR_KEY_LASTMAPAPPW
  579. #define DIRECTINPUT_REGSTR_VAL_VERSION DIRECTINPUT_REGSTR_VAL_VERSIONW
  580. #define DIRECTINPUT_REGSTR_VAL_NAME DIRECTINPUT_REGSTR_VAL_NAMEW
  581. #define DIRECTINPUT_REGSTR_VAL_ID DIRECTINPUT_REGSTR_VAL_IDW
  582. #define DIRECTINPUT_REGSTR_VAL_MAPPER DIRECTINPUT_REGSTR_VAL_MAPPERW
  583. #define DIRECTINPUT_REGSTR_VAL_LASTSTART DIRECTINPUT_REGSTR_VAL_LASTSTARTW
  584. #else
  585. #define DIRECTINPUT_REGSTR_VAL_APPIDFLAG DIRECTINPUT_REGSTR_VAL_APPIDFLAGA
  586. #define DIRECTINPUT_REGSTR_KEY_LASTAPP DIRECTINPUT_REGSTR_KEY_LASTAPPA
  587. #define DIRECTINPUT_REGSTR_KEY_LASTMAPAPP DIRECTINPUT_REGSTR_KEY_LASTMAPAPPA
  588. #define DIRECTINPUT_REGSTR_VAL_VERSION DIRECTINPUT_REGSTR_VAL_VERSIONA
  589. #define DIRECTINPUT_REGSTR_VAL_NAME DIRECTINPUT_REGSTR_VAL_NAMEA
  590. #define DIRECTINPUT_REGSTR_VAL_ID DIRECTINPUT_REGSTR_VAL_IDA
  591. #define DIRECTINPUT_REGSTR_VAL_MAPPER DIRECTINPUT_REGSTR_VAL_MAPPERA
  592. #define DIRECTINPUT_REGSTR_VAL_LASTSTART DIRECTINPUT_REGSTR_VAL_LASTSTARTA
  593. #endif
  594. /****************************************************************************
  595. *
  596. * Return Codes
  597. *
  598. ****************************************************************************/
  599. #define DIERR_NOMOREITEMS \
  600. MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_NO_MORE_ITEMS)
  601. /*
  602. * Device driver-specific codes.
  603. */
  604. #define DIERR_DRIVERFIRST 0x80040300L
  605. #define DIERR_DRIVERLAST 0x800403FFL
  606. /*
  607. * Unless the specific driver has been precisely identified, no meaning
  608. * should be attributed to these values other than that the driver
  609. * originated the error. However, to illustrate the types of error that
  610. * may be causing the failure, the PID force feedback driver distributed
  611. * with DirectX 7 could return the following errors:
  612. *
  613. * DIERR_DRIVERFIRST + 1
  614. * The requested usage was not found.
  615. * DIERR_DRIVERFIRST + 2
  616. * The parameter block couldn't be downloaded to the device.
  617. * DIERR_DRIVERFIRST + 3
  618. * PID initialization failed.
  619. * DIERR_DRIVERFIRST + 4
  620. * The provided values couldn't be scaled.
  621. */
  622. /*
  623. * Device installer errors.
  624. */
  625. /*
  626. * Registry entry or DLL for class installer invalid
  627. * or class installer not found.
  628. */
  629. #define DIERR_INVALIDCLASSINSTALLER 0x80040400L
  630. /*
  631. * The user cancelled the install operation.
  632. */
  633. #define DIERR_CANCELLED 0x80040401L
  634. /*
  635. * The INF file for the selected device could not be
  636. * found or is invalid or is damaged.
  637. */
  638. #define DIERR_BADINF 0x80040402L
  639. /****************************************************************************
  640. *
  641. * Map files
  642. *
  643. ****************************************************************************/
  644. /*
  645. * Delete particular data from default map file.
  646. */
  647. #define DIDIFT_DELETE 0x01000000
  648. #ifdef __cplusplus
  649. };
  650. #endif
  651. #endif /* __DINPUTD_INCLUDED__ */