Source code of Windows XP (NT5)
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.

2003 lines
72 KiB

  1. sinclude(`dimkhdr.m4')dnl This file must be preprocessed by the m4 preprocessor.
  2. /****************************************************************************
  3. *
  4. * Copyright (C) 1996 Microsoft Corporation. All Rights Reserved.;public_dx3
  5. * Copyright (C) 1996-1998 Microsoft Corporation. All Rights Reserved.;public_dx5
  6. * Copyright (C) 1996-1998 Microsoft Corporation. All Rights Reserved.;public_dx5b2
  7. * Copyright (C) 1995-1999 Microsoft Corporation. All Rights Reserved.;public_dx6
  8. * Copyright (C) 1995-1999 Microsoft Corporation. All Rights Reserved.;public_dx7
  9. * Copyright (C) 1995-2000 Microsoft Corporation. All Rights Reserved.;public_dx8
  10. *
  11. * File: dinputd.h
  12. * Content: DirectInput include file for device driver implementors
  13. begindoc
  14. * History:
  15. * Date By Reason
  16. * ==== == ======
  17. * 1996.06.17 raymondc Disk too empty
  18. * 1998.01.06 omsharma DX5B2 version
  19. * 1999.01.16 marcand DX7 version (1999.02.09) -> DX6.2 -> DX6.1a
  20. enddoc
  21. *
  22. ****************************************************************************/
  23. #ifndef __DINPUTD_INCLUDED__
  24. #define __DINPUTD_INCLUDED__
  25. #ifndef DIRECTINPUT_VERSION ;public_500
  26. #define DIRECTINPUT_VERSION 0x0300;public_dx3
  27. #pragma message(__FILE__ ": DIRECTINPUT_VERSION undefined. Defaulting to version 0x0300") ;public_dx3
  28. #define DIRECTINPUT_VERSION 0x0500;public_dx5
  29. #pragma message(__FILE__ ": DIRECTINPUT_VERSION undefined. Defaulting to version 0x0500") ;public_dx5
  30. #define DIRECTINPUT_VERSION 0x0600;public_dx6
  31. #pragma message(__FILE__ ": DIRECTINPUT_VERSION undefined. Defaulting to version 0x0600") ;public_dx6
  32. #define DIRECTINPUT_VERSION 0x0700;public_dx7
  33. #pragma message(__FILE__ ": DIRECTINPUT_VERSION undefined. Defaulting to version 0x0700") ;public_dx7
  34. #define DIRECTINPUT_VERSION 0x0800;public_800
  35. #pragma message(__FILE__ ": DIRECTINPUT_VERSION undefined. Defaulting to version 0x0800") ;public_800
  36. #endif ;public_500
  37. #ifdef __cplusplus
  38. extern "C" {
  39. #endif
  40. /****************************************************************************
  41. *
  42. * Interfaces
  43. *
  44. ****************************************************************************/
  45. #ifndef DIJ_RINGZERO
  46. DEFINE_GUID(IID_IDirectInputDeviceCallback, 0x1DE12AA0,0xC9F5,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);;Internal
  47. DEFINE_GUID(IID_IDirectInputEffectShepherd, 0x1DE12AA1,0xC9F5,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);;Internal
  48. DEFINE_GUID(IID_IDirectInputMapShepherd, 0x6a3e3144,0x3eee,0x4aa5,0x95,0x87,0xe1,0x0a,0x21,0xfe,0xc7,0x71);;internal
  49. DEFINE_GUID(IID_IDirectInputEffectDriver, 0x02538130,0x898F,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
  50. DEFINE_GUID(IID_IDirectInputJoyConfig, 0x1DE12AB1,0xC9F5,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
  51. DEFINE_GUID(IID_IDirectInputPIDDriver, 0xEEC6993A,0xB3FD,0x11D2,0xA9,0x16,0x00,0xC0,0x4F,0xB9,0x86,0x38);
  52. DEFINE_GUID(IID_IDirectInputJoyConfig8, 0xeb0d7dfa,0x1990,0x4f27,0xb4,0xd6,0xed,0xf2,0xee,0xc4,0xa4,0x4c);
  53. ;begin_internal_800
  54. DEFINE_GUID(IID_IDIActionFramework, 0xf4279160,0x608f,0x11d3,0x8f,0xb2,0x0, 0xc0,0x4f,0x8e,0xc6,0x27);
  55. DEFINE_GUID(CLSID_CDirectInputActionFramework, 0x9f34af20,0x6095,0x11d3,0x8f,0xb2,0x0, 0xc0,0x4f,0x8e,0xc6,0x27);
  56. ;end_internal_800
  57. #endif /* DIJ_RINGZERO */
  58. /****************************************************************************
  59. *
  60. * IDirectInputEffectDriver
  61. *
  62. ****************************************************************************/
  63. begindoc
  64. /****************************************************************************
  65. *
  66. * @doc DDK
  67. *
  68. * @struct DIOBJECTATTRIBUTES |
  69. *
  70. * The <t DIOBJECTATTRIBUTES> structure describes the
  71. * information contained in the "Attributes" value of
  72. * the registry key for each "object" on a device.
  73. * device.
  74. *
  75. * If the "Attributes" value is absent, then default
  76. * attributes are used.
  77. *
  78. * @field DWORD | dwFlags |
  79. *
  80. * Zero or more <c DIDOI_*> flags.
  81. *
  82. *
  83. * @field WORD | wUsagePage |
  84. *
  85. * The HID usage page to associate with the object.
  86. *
  87. * @field WORD | wUsage |
  88. *
  89. * The HID usage to associate with the object.
  90. *
  91. * @devnote NOTE - this is in a different order from that in <t DIMAKEUSAGEDWORD>
  92. *
  93. ****************************************************************************/
  94. enddoc
  95. typedef struct DIOBJECTATTRIBUTES {
  96. DWORD dwFlags;
  97. WORD wUsagePage;
  98. WORD wUsage;
  99. } DIOBJECTATTRIBUTES, *LPDIOBJECTATTRIBUTES;
  100. typedef const DIOBJECTATTRIBUTES *LPCDIOBJECTATTRIBUTES;
  101. begindoc
  102. /****************************************************************************
  103. *
  104. * @doc DDK
  105. *
  106. * @struct DIFFOBJECTATTRIBUTES |
  107. *
  108. * The <t DIFFOBJECTATTRIBUTES> structure describes the
  109. * information contained in the "FFAttributes" value of
  110. * the registry key for each "object" on a force feedback
  111. * device.
  112. *
  113. * If the "FFAttributes" value is absent, then the
  114. * object is assumed not to support force feedback.
  115. *
  116. * @field DWORD | dwFFMaxForce |
  117. *
  118. * Specifies the magnitude of the maximum force that can
  119. * be created by the actuator associated with this object.
  120. * Force is
  121. * expressed in Newtons and measured in relation to where
  122. * the hand would be during normal operation of the device.
  123. *
  124. * If this value is zero, the object is assumed not to
  125. * support force feedback.
  126. *
  127. * @field DWORD | dwFFForceResolution |
  128. *
  129. * Specifies the force resolution of the actuator
  130. * associated with this object.
  131. * The returned value represents
  132. * the number of gradations, or subdivisions, of the
  133. * maximum force that can be expressed by the force feedback
  134. * system from 0 (no force) to maximum force.
  135. *
  136. ****************************************************************************/
  137. enddoc
  138. typedef struct DIFFOBJECTATTRIBUTES {
  139. DWORD dwFFMaxForce;
  140. DWORD dwFFForceResolution;
  141. } DIFFOBJECTATTRIBUTES, *LPDIFFOBJECTATTRIBUTES;
  142. typedef const DIFFOBJECTATTRIBUTES *LPCDIFFOBJECTATTRIBUTES;
  143. begindoc
  144. /****************************************************************************
  145. *
  146. * @doc DDK
  147. *
  148. * @struct DIOBJECTCALIBRATION |
  149. *
  150. * The <t DIOBJECTCALIBRATION> structure describes the
  151. * information contained in the "Calibration" value of
  152. * the registry key for each axis on a device.
  153. *
  154. * If the "Calibration" value is absent, then the
  155. * calibration information is taken from the joystick
  156. * <t JOYREGHWVALUES> configuration structure.
  157. *
  158. * Only HID joysticks will have a "Calibration" value.
  159. *
  160. * @field LONG | lMin |
  161. *
  162. * Specifies the logical value for the axis minimum position.
  163. *
  164. * @field LONG | lCenter |
  165. *
  166. * Specifies the logical value for the axis center position.
  167. *
  168. * @field LONG | lMax |
  169. *
  170. * Specifies the logical value for the axis maximum position.
  171. *
  172. ****************************************************************************/
  173. enddoc
  174. typedef struct DIOBJECTCALIBRATION {
  175. LONG lMin;
  176. LONG lCenter;
  177. LONG lMax;
  178. } DIOBJECTCALIBRATION, *LPDIOBJECTCALIBRATION;
  179. typedef const DIOBJECTCALIBRATION *LPCDIOBJECTCALIBRATION;
  180. begindoc
  181. /****************************************************************************
  182. *
  183. * @doc DDK
  184. *
  185. * @struct DIPOVCALIBRATION |
  186. *
  187. * The <t DIPOVCALIBRATION> structure describes the
  188. * information contained in the "Calibration" value of
  189. * the registry key for each POV on a device.
  190. *
  191. * If the "Calibration" value is absent, then the
  192. * calibration information is taken from the joystick
  193. * <t JOYREGHWVALUES> configuration structure.
  194. *
  195. * Only HID joysticks will have a "Calibration" value.
  196. *
  197. * @field LONG | lMin[5] |
  198. *
  199. * Specifies the logical value for the POV minimum positions.
  200. *
  201. * @field LONG | lMax[5] |
  202. *
  203. * Specifies the logical value for the POV maximum positions.
  204. *
  205. ****************************************************************************/
  206. enddoc
  207. typedef struct DIPOVCALIBRATION {
  208. LONG lMin[5];
  209. LONG lMax[5];
  210. } DIPOVCALIBRATION, *LPDIPOVCALIBRATION;
  211. typedef const DIPOVCALIBRATION *LPCDIPOVCALIBRATION;
  212. begindoc
  213. /****************************************************************************
  214. *
  215. * @doc DDK
  216. *
  217. * @struct DIEFFECTATTRIBUTES |
  218. *
  219. * The <t DIEFFECTATTRIBUTES> structure describes the
  220. * information contained in the "Attributes" value of
  221. * the registry key for each effect supported by
  222. * a force feedback device.
  223. *
  224. * @field DWORD | dwEffectId |
  225. *
  226. * Arbitrary 32-bit value passed to the driver to
  227. * identify the effect.
  228. *
  229. * The driver will receive this parameters as the
  230. * <p dwEffectId> parameter to the
  231. * <mf IDirectInputEffectDriver::DownloadEffect>
  232. * function.
  233. *
  234. * @field DWORD | dwEffType |
  235. *
  236. * Zero or more <c DIEFT_*> values describing the effect.
  237. *
  238. * See "DirectInput Effect Format Types" for a description
  239. * of how the flags should be interpreted.
  240. *
  241. * @field DWORD | dwStaticParams |
  242. *
  243. * Zero or more <c DIEP_*> values describing the
  244. * parameters supported by the effect. For example,
  245. * if <c DIEP_ENVELOPE> is set, then the effect
  246. * supports an envelope.
  247. *
  248. * All effects should support at least
  249. * <c DIEP_DURATION>,
  250. * <c DIEP_AXES>, and
  251. * <c DIEP_TYPESPECIFICPARAMS>.
  252. *
  253. * It is not an error for an application to attempt to use
  254. * effect parameters which are not supported by the device.
  255. * The unsupported parameters are merely ignored.
  256. *
  257. * @field DWORD | dwDynamicParams |
  258. *
  259. * Zero or more <c DIEP_*> values describing the
  260. * parameters of the effect which can be modified
  261. * while the effect is playing.
  262. *
  263. * If an application attempts to change a parameter
  264. * while the effect is playing, and the driver does not
  265. * support modifying that effect dynamically, then
  266. * the driver shall return <c DIERR_EFFECTPLAYING>.
  267. *
  268. * @field DWORD | dwCoords |
  269. *
  270. * One or more coordinate system flags
  271. * (<c DIEFF_CARTESIAN>,
  272. * <c DIEFF_POLAR>,
  273. * <c DIEFF_SPHERICAL>)
  274. * indicating which coordinate systems are supported
  275. * by the effect. At least one coordinate system
  276. * must be supported.
  277. *
  278. * If an application attempts to set a direction in
  279. * an unsupported coordinate system, DirectInput will
  280. * automatically convert it to a coordinate system
  281. * which the device does support.
  282. *
  283. ****************************************************************************/
  284. enddoc
  285. typedef struct DIEFFECTATTRIBUTES {
  286. DWORD dwEffectId;
  287. DWORD dwEffType;
  288. DWORD dwStaticParams;
  289. DWORD dwDynamicParams;
  290. DWORD dwCoords;
  291. } DIEFFECTATTRIBUTES, *LPDIEFFECTATTRIBUTES;
  292. typedef const DIEFFECTATTRIBUTES *LPCDIEFFECTATTRIBUTES;
  293. begindoc
  294. /****************************************************************************
  295. *
  296. * @doc DDK
  297. *
  298. * @struct DIFFDEVICEATTRIBUTES |
  299. *
  300. * The <t DIFFDEVICEATTRIBUTES> structure describes the
  301. * information contained in the "Attributes" value of
  302. * the OEMForceFeedback registry key.
  303. *
  304. * @field DWORD | dwFlags |
  305. *
  306. * To be specified later. Must be zero for now.
  307. *
  308. * ISSUE-2001/03/29-timgill Need to complete documentation
  309. * see Marcus's document.
  310. *
  311. * @field DWORD | dwFFSamplePeriod |
  312. *
  313. * The minimum time between playback of
  314. * force commands, in microseconds.
  315. *
  316. * @field DWORD | dwFFMinTimeResolution |
  317. *
  318. * The minimum amount of time, in microseconds,
  319. * that the device can resolve. The device rounds
  320. * any times to the nearest supported increment.
  321. * For example, if the value of
  322. * <e DIDEVCAPS.dwFFMinTimeResolution> is 1000,
  323. * then the device would round any times to
  324. * the nearest millisecond.
  325. *
  326. ****************************************************************************/
  327. enddoc
  328. typedef struct DIFFDEVICEATTRIBUTES {
  329. DWORD dwFlags;
  330. DWORD dwFFSamplePeriod;
  331. DWORD dwFFMinTimeResolution;
  332. } DIFFDEVICEATTRIBUTES, *LPDIFFDEVICEATTRIBUTES;
  333. typedef const DIFFDEVICEATTRIBUTES *LPCDIFFDEVICEATTRIBUTES;
  334. begindoc
  335. /****************************************************************************
  336. *
  337. * @doc DDK
  338. *
  339. * @struct DIDRIVERVERSIONS |
  340. *
  341. * The <t DIDRIVERVERSIONS> structure is used
  342. * by the DirectInput effect driver to report
  343. * version information back to DirectInput.
  344. *
  345. * The semantics of the version numbers is
  346. * left to the discretion of the device driver.
  347. * The only requirement is that later versions
  348. * have numerically greater version numbers than
  349. * earlier versions.
  350. *
  351. * @field DWORD | dwSize |
  352. *
  353. * The size of the structure.
  354. *
  355. * @field DWORD | dwFirmwareRevision |
  356. *
  357. * Specifies the firmware revision of the device.
  358. *
  359. * @field DWORD | dwHardwareRevision |
  360. *
  361. * Specifies the hardware revision of the device.
  362. *
  363. * @field DWORD | dwFFDriverVersion |
  364. *
  365. * Specifies the version number of the force feedback
  366. * device driver.
  367. *
  368. ****************************************************************************/
  369. enddoc
  370. typedef struct DIDRIVERVERSIONS {
  371. DWORD dwSize;
  372. DWORD dwFirmwareRevision;
  373. DWORD dwHardwareRevision;
  374. DWORD dwFFDriverVersion;
  375. } DIDRIVERVERSIONS, *LPDIDRIVERVERSIONS;
  376. typedef const DIDRIVERVERSIONS *LPCDIDRIVERVERSIONS;
  377. begindoc
  378. /****************************************************************************
  379. *
  380. * @doc DDK
  381. *
  382. * @struct DIDEVICESTATE |
  383. *
  384. * The <t DIDEVICESTATE> structure returns information
  385. * about the state of a force feedback device.
  386. *
  387. * @field DWORD | dwSize |
  388. *
  389. * The size of the structure.
  390. *
  391. * @field DWORD | dwState |
  392. *
  393. * Zero or more of the <c DIGFFS_*> values indicating
  394. * various aspects of the device state.
  395. *
  396. * @field DWORD | dwLoad |
  397. *
  398. * A value indicating the percentage of device
  399. * memory in use. A load of zero indicates that the
  400. * device memory is completely available. A load of
  401. * one hundred indicates that the device is full.
  402. *
  403. ****************************************************************************/
  404. enddoc
  405. typedef struct DIDEVICESTATE {
  406. DWORD dwSize;
  407. DWORD dwState;
  408. DWORD dwLoad;
  409. } DIDEVICESTATE, *LPDIDEVICESTATE;
  410. #define DEV_STS_EFFECT_RUNNING DIEGES_PLAYING
  411. #ifndef DIJ_RINGZERO
  412. begindoc
  413. /****************************************************************************
  414. *
  415. * @doc DDK
  416. *
  417. * @struct DIHIDFFINITINFO |
  418. *
  419. * The <t DIHIDFFINITINFO> structure is used by DirectInput
  420. * to provide information to a HID force feedback driver
  421. * about the device it is being asked to control.
  422. *
  423. * @field DWORD | dwSize |
  424. *
  425. * The size of the structure.
  426. *
  427. * @field LPWSTR | pwszDeviceInterface |
  428. *
  429. * Pointer to a null-terminated UNICODE string which
  430. * identifies the device interface for the device.
  431. * The driver can pass the device interface to
  432. * the <f CreateFile> function to obtain access to the
  433. * device.
  434. *
  435. ****************************************************************************/
  436. enddoc
  437. typedef struct DIHIDFFINITINFO {
  438. DWORD dwSize;
  439. LPWSTR pwszDeviceInterface;
  440. GUID GuidInstance;
  441. } DIHIDFFINITINFO, *LPDIHIDFFINITINFO;
  442. begin_interface(IDirectInputEffectDriver)
  443. begin_methods()
  444. declare_method(DeviceID,DWORD,DWORD,DWORD,DWORD,LPVOID)
  445. declare_method(GetVersions,LPDIDRIVERVERSIONS)
  446. declare_method(Escape,DWORD,DWORD,LPDIEFFESCAPE)
  447. declare_method(SetGain,DWORD,DWORD)
  448. declare_method(SendForceFeedbackCommand,DWORD,DWORD)
  449. declare_method(GetForceFeedbackState,DWORD,LPDIDEVICESTATE)
  450. declare_method(DownloadEffect,DWORD,DWORD,LPDWORD,LPCDIEFFECT,DWORD)
  451. declare_method(DestroyEffect,DWORD,DWORD)
  452. declare_method(StartEffect,DWORD,DWORD,DWORD,DWORD)
  453. declare_method(StopEffect,DWORD,DWORD)
  454. declare_method(GetEffectStatus,DWORD,DWORD,LPDWORD)
  455. end_methods()
  456. end_interface()
  457. ;begin_internal
  458. /****************************************************************************
  459. *
  460. * IDirectInputEffectShepherd
  461. *
  462. * Special wrapper class which gates access to DirectInput
  463. * effect drivers.
  464. *
  465. ****************************************************************************/
  466. /****************************************************************************
  467. *
  468. * @doc INTERNAL
  469. *
  470. * @struct SHEPHANDLE |
  471. *
  472. * Information that shepherds an effect handle.
  473. *
  474. * @field DWORD | dwEffect |
  475. *
  476. * The effect handle itself, possibly invalid if the device
  477. * has since been reset.
  478. *
  479. * If the value is zero, then the effect has not
  480. * been downloaded.
  481. *
  482. * @field DWORD | dwTag |
  483. *
  484. * Reset counter tag for the effect. If this value is different
  485. * from the tag stored in shared memory, then it means that
  486. * the device has been reset in the interim and no longer
  487. * belongs to the caller.
  488. *
  489. ****************************************************************************/
  490. typedef struct SHEPHANDLE {
  491. DWORD dwEffect;
  492. DWORD dwTag;
  493. } SHEPHANDLE, *PSHEPHANDLE;
  494. begin_interface(IDirectInputEffectShepherd)
  495. begin_methods()
  496. declare_method(DeviceID,DWORD,DWORD,LPVOID)
  497. declare_method(GetVersions,LPDIDRIVERVERSIONS)
  498. declare_method(Escape,PSHEPHANDLE,LPDIEFFESCAPE)
  499. declare_method(DeviceEscape,PSHEPHANDLE,LPDIEFFESCAPE)
  500. declare_method(SetGain,PSHEPHANDLE,DWORD)
  501. declare_method(SendForceFeedbackCommand,PSHEPHANDLE,DWORD)
  502. declare_method(GetForceFeedbackState,PSHEPHANDLE,LPDIDEVICESTATE)
  503. declare_method(DownloadEffect,DWORD,PSHEPHANDLE,LPCDIEFFECT,DWORD)
  504. declare_method(DestroyEffect,PSHEPHANDLE)
  505. declare_method(StartEffect,PSHEPHANDLE,DWORD,DWORD)
  506. declare_method(StopEffect,PSHEPHANDLE)
  507. declare_method(GetEffectStatus,PSHEPHANDLE,LPDWORD)
  508. declare_method(SetGlobalGain,DWORD)
  509. end_methods()
  510. end_interface()
  511. /****************************************************************************
  512. *
  513. * IDirectInputMapShepherd
  514. *
  515. * Special wrapper class which gates access to DirectInput mapper.
  516. *
  517. ****************************************************************************/
  518. ;begin_if_(DIRECTINPUT_VERSION)_800
  519. begin_interface(IDirectInputMapShepherd)
  520. begin_methods()
  521. declare_method(GetActionMap,REFGUID,LPCWSTR,LPDIACTIONFORMATW,LPCWSTR,LPFILETIME,DWORD)
  522. declare_method(SaveActionMap,REFGUID,LPCWSTR,LPDIACTIONFORMATW,LPCWSTR,DWORD)
  523. declare_method(GetImageInfo,REFGUID,LPCWSTR,LPDIDEVICEIMAGEINFOHEADERW)
  524. end_methods()
  525. end_interface()
  526. ;end
  527. /****************************************************************************
  528. *
  529. * @doc INTERNAL
  530. *
  531. * @struct DIPROPINFO |
  532. *
  533. * Information used to describe an object being accessed.
  534. *
  535. * @field const GUID * | pguid |
  536. *
  537. * The property being accessed (if applicable).
  538. *
  539. * @field UINT | iobj |
  540. *
  541. * Zero-based index to object (or 0xFFFFFFFF if accessing the
  542. * device).
  543. *
  544. * @field DWORD | dwDevType |
  545. *
  546. * Device type information (or 0 if accessing the device).
  547. *
  548. ****************************************************************************/
  549. typedef struct DIPROPINFO {
  550. const GUID *pguid;
  551. UINT iobj;
  552. DWORD dwDevType;
  553. } DIPROPINFO, *LPDIPROPINFO;
  554. typedef const DIPROPINFO *LPCDIPROPINFO;
  555. begindoc
  556. /****************************************************************************
  557. *
  558. * @doc INTERNAL
  559. *
  560. * @topic Device offsets and cooked data |
  561. *
  562. * An unfortunate consequence of cooked data is that
  563. * there is no easy to way to communicate to the
  564. * <c DIDM_COOKDEVICEDATA> callback exactly what object
  565. * needs to be cooked because the dwType for the object
  566. * is not part of the <t DIDEVICEOBJECTDATA> structure.
  567. *
  568. * So we cheat.
  569. *
  570. * We stash the type and instance bits of the
  571. * dwType into the high word of the
  572. * <e DIDEVICEOBJECTDATA.dwOfs>.
  573. *
  574. * ISSUE-2001/03/29-timgill This cheat is not HID-friendly.
  575. * Need to use an auxiliary translation table. But good enough
  576. * for DX5 beta 1.
  577. *
  578. * @func DWORD | DICOOK_IDFROMDFOFS |
  579. *
  580. * Given a data format offset, extract the object id,
  581. * which consists of the type and the instance.
  582. *
  583. *
  584. * @parm DWORD | dwFakeOfs |
  585. *
  586. * Fake data format offset which came from
  587. * <e DIDEVICEOBJECTDATA.dwOfs>.
  588. *
  589. * @func DWORD | DICOOK_OFSFROMDFOFS |
  590. *
  591. * Given a fake data format offset, extract the actual
  592. * client data format offset.
  593. *
  594. * @parm DWORD | dwFakeOfs |
  595. *
  596. * Fake data format offset which came from
  597. * <e DIDEVICEOBJECTDATA.dwOfs>.
  598. *
  599. * @func DWORD | DICOOK_DFOFSFROMOFSID |
  600. *
  601. * Given a client data format offset and an object id,
  602. * return a fake data format offset.
  603. *
  604. * @parm DWORD | dwOfs |
  605. *
  606. * Client data format offset.
  607. *
  608. * @parm DWORD | dwType |
  609. *
  610. * Device object type descriptor.
  611. *
  612. ****************************************************************************/
  613. enddoc
  614. #define DICOOK_DFOFSFROMOFSID(dwOfs, dwType) MAKELONG(dwOfs, dwType)
  615. #define DICOOK_IDFROMDFOFS(dwFakeOfs) HIWORD(dwFakeOfs)
  616. #define DICOOK_OFSFROMDFOFS(dwFakeOfs) LOWORD(dwFakeOfs)
  617. /****************************************************************************
  618. *
  619. * IDirectInputDeviceCallback
  620. *
  621. * IDirectInputDevice uses it to communicate with the
  622. * component that is responsible for collecting data from
  623. * the appropriate hardware device.
  624. *
  625. * E.g., mouse, keyboard, joystick, HID.
  626. *
  627. * Methods should return E_NOTIMPL for anything not understood.
  628. *
  629. ****************************************************************************/
  630. ;begin_if_(DIRECTINPUT_VERSION)_800
  631. begin_interface(IDirectInputDeviceCallback)
  632. begin_methods()
  633. declare_method(GetInstance,LPVOID *)
  634. declare_method(GetVersions,LPDIDRIVERVERSIONS)
  635. declare_method(GetDataFormat,LPDIDATAFORMAT *)
  636. declare_method(GetObjectInfo,LPCDIPROPINFO,LPDIDEVICEOBJECTINSTANCEW)
  637. declare_method(GetCapabilities,LPDIDEVCAPS)
  638. declare_method(Acquire)
  639. declare_method(Unacquire)
  640. declare_method(GetDeviceState,LPVOID)
  641. declare_method(GetDeviceInfo,LPDIDEVICEINSTANCEW)
  642. declare_method(GetProperty,LPCDIPROPINFO,LPDIPROPHEADER)
  643. declare_method(SetProperty,LPCDIPROPINFO,LPCDIPROPHEADER)
  644. declare_method(SetEventNotification,HANDLE)
  645. declare_method(SetCooperativeLevel,HWND,DWORD)
  646. declare_method(RunControlPanel,HWND,DWORD)
  647. declare_method(CookDeviceData,DWORD,LPDIDEVICEOBJECTDATA)
  648. declare_method(CreateEffect,LPDIRECTINPUTEFFECTSHEPHERD *)
  649. declare_method(GetFFConfigKey,DWORD,PHKEY)
  650. declare_method(SendDeviceData, DWORD,LPCDIDEVICEOBJECTDATA,LPDWORD,DWORD)
  651. declare_method(Poll)
  652. declare_method_(DWORD,GetUsage, int)
  653. declare_method(MapUsage, DWORD, PINT)
  654. declare_method(SetDIData, DWORD, LPVOID)
  655. declare_method(BuildDefaultActionMap, LPDIACTIONFORMATW, DWORD, REFGUID)
  656. end_methods()
  657. end_interface()
  658. #else
  659. begin_interface(IDirectInputDeviceCallback)
  660. begin_methods()
  661. declare_method(GetInstance,LPVOID *)
  662. declare_method(GetVersions,LPDIDRIVERVERSIONS)
  663. declare_method(GetDataFormat,LPDIDATAFORMAT *)
  664. declare_method(GetObjectInfo,LPCDIPROPINFO,LPDIDEVICEOBJECTINSTANCEW)
  665. declare_method(GetCapabilities,LPDIDEVCAPS)
  666. declare_method(Acquire)
  667. declare_method(Unacquire)
  668. declare_method(GetDeviceState,LPVOID)
  669. declare_method(GetDeviceInfo,LPDIDEVICEINSTANCEW)
  670. declare_method(GetProperty,LPCDIPROPINFO,LPDIPROPHEADER)
  671. declare_method(SetProperty,LPCDIPROPINFO,LPCDIPROPHEADER)
  672. declare_method(SetEventNotification,HANDLE)
  673. declare_method(SetCooperativeLevel,HWND,DWORD)
  674. declare_method(RunControlPanel,HWND,DWORD)
  675. declare_method(CookDeviceData,UINT,LPDIDEVICEOBJECTDATA)
  676. declare_method(CreateEffect,LPDIRECTINPUTEFFECTSHEPHERD *)
  677. declare_method(GetFFConfigKey,DWORD,PHKEY)
  678. declare_method(SendDeviceData, LPCDIDEVICEOBJECTDATA, LPDWORD, DWORD)
  679. declare_method(Poll)
  680. declare_method_(DWORD,GetUsage, int)
  681. declare_method(MapUsage, DWORD, PINT)
  682. declare_method(SetDIData, DWORD, LPVOID)
  683. end_methods()
  684. end_interface()
  685. ;end
  686. /****************************************************************************
  687. *
  688. * Emulation flags
  689. *
  690. * These bits can be put into the Emulation flag in the registry
  691. * key REGSTR_PATH_DINPUT as the DWORD value of REGSTR_VAL_EMULATION.
  692. *
  693. * Warning! If you use more than fifteen bits of emulation, then
  694. * you also have to mess with DIGETEMFL() and DIMAKEEMFL() in
  695. * dinputv.h.
  696. *
  697. ****************************************************************************/
  698. #define DIEMFL_MOUSE 0x00000001 /* Force mouse emulation */
  699. #define DIEMFL_KBD 0x00000002 /* Force keyboard emulation */
  700. #define DIEMFL_JOYSTICK 0x00000004 /* Force joystick emulation */
  701. #define DIEMFL_KBD2 0x00000008 /* Force keyboard emulation 2 */
  702. #define DIEMFL_MOUSE2 0x00000010 /* Force mouse emulation 2 */
  703. /****************************************************************************
  704. *
  705. * IDirectInputActionFramework
  706. * Framework interface for configuring devices
  707. *
  708. ****************************************************************************/
  709. ;begin_if_(DIRECTINPUT_VERSION)_800
  710. begin_interface(IDirectInputActionFramework)
  711. begin_methods()
  712. declare_method(ConfigureDevices, LPDICONFIGUREDEVICESCALLBACK, LPDICONFIGUREDEVICESPARAMS%, DWORD, LPVOID)
  713. end_methods()
  714. end_interface()
  715. ;end
  716. ;end_internal
  717. #endif /* DIJ_RINGZERO */
  718. /****************************************************************************
  719. *
  720. * IDirectInputJoyConfig
  721. *
  722. ****************************************************************************/
  723. /****************************************************************************
  724. *
  725. * Definitions copied from the DDK
  726. *
  727. ****************************************************************************/
  728. #ifndef JOY_HW_NONE
  729. /* pre-defined joystick types */
  730. #define JOY_HW_NONE 0
  731. #define JOY_HW_CUSTOM 1
  732. #define JOY_HW_2A_2B_GENERIC 2
  733. #define JOY_HW_2A_4B_GENERIC 3
  734. #define JOY_HW_2B_GAMEPAD 4
  735. #define JOY_HW_2B_FLIGHTYOKE 5
  736. #define JOY_HW_2B_FLIGHTYOKETHROTTLE 6
  737. #define JOY_HW_3A_2B_GENERIC 7
  738. #define JOY_HW_3A_4B_GENERIC 8
  739. #define JOY_HW_4B_GAMEPAD 9
  740. #define JOY_HW_4B_FLIGHTYOKE 10
  741. #define JOY_HW_4B_FLIGHTYOKETHROTTLE 11
  742. #define JOY_HW_TWO_2A_2B_WITH_Y 12
  743. #define JOY_HW_LASTENTRY 13
  744. ;begin_internal
  745. #define JOY_HW_PREDEFMIN JOY_HW_2A_2B_GENERIC
  746. #ifdef WINNT
  747. #define JOY_HW_PREDEFMAX JOY_HW_LASTENTRY
  748. #else
  749. #define JOY_HW_PREDEFMAX (JOY_HW_LASTENTRY-1)
  750. #endif
  751. ;end_internal
  752. /* calibration flags */
  753. #define JOY_ISCAL_XY 0x00000001l /* XY are calibrated */
  754. #define JOY_ISCAL_Z 0x00000002l /* Z is calibrated */
  755. #define JOY_ISCAL_R 0x00000004l /* R is calibrated */
  756. #define JOY_ISCAL_U 0x00000008l /* U is calibrated */
  757. #define JOY_ISCAL_V 0x00000010l /* V is calibrated */
  758. #define JOY_ISCAL_POV 0x00000020l /* POV is calibrated */
  759. /* point of view constants */
  760. #define JOY_POV_NUMDIRS 4
  761. #define JOY_POVVAL_FORWARD 0
  762. #define JOY_POVVAL_BACKWARD 1
  763. #define JOY_POVVAL_LEFT 2
  764. #define JOY_POVVAL_RIGHT 3
  765. /* Specific settings for joystick hardware */
  766. #define JOY_HWS_HASZ 0x00000001l /* has Z info? */
  767. #define JOY_HWS_HASPOV 0x00000002l /* point of view hat present */
  768. #define JOY_HWS_POVISBUTTONCOMBOS 0x00000004l /* pov done through combo of buttons */
  769. #define JOY_HWS_POVISPOLL 0x00000008l /* pov done through polling */
  770. #define JOY_HWS_ISYOKE 0x00000010l /* joystick is a flight yoke */
  771. #define JOY_HWS_ISGAMEPAD 0x00000020l /* joystick is a game pad */
  772. #define JOY_HWS_ISCARCTRL 0x00000040l /* joystick is a car controller */
  773. /* X defaults to J1 X axis */
  774. #define JOY_HWS_XISJ1Y 0x00000080l /* X is on J1 Y axis */
  775. #define JOY_HWS_XISJ2X 0x00000100l /* X is on J2 X axis */
  776. #define JOY_HWS_XISJ2Y 0x00000200l /* X is on J2 Y axis */
  777. /* Y defaults to J1 Y axis */
  778. #define JOY_HWS_YISJ1X 0x00000400l /* Y is on J1 X axis */
  779. #define JOY_HWS_YISJ2X 0x00000800l /* Y is on J2 X axis */
  780. #define JOY_HWS_YISJ2Y 0x00001000l /* Y is on J2 Y axis */
  781. /* Z defaults to J2 Y axis */
  782. #define JOY_HWS_ZISJ1X 0x00002000l /* Z is on J1 X axis */
  783. #define JOY_HWS_ZISJ1Y 0x00004000l /* Z is on J1 Y axis */
  784. #define JOY_HWS_ZISJ2X 0x00008000l /* Z is on J2 X axis */
  785. /* POV defaults to J2 Y axis, if it is not button based */
  786. #define JOY_HWS_POVISJ1X 0x00010000l /* pov done through J1 X axis */
  787. #define JOY_HWS_POVISJ1Y 0x00020000l /* pov done through J1 Y axis */
  788. #define JOY_HWS_POVISJ2X 0x00040000l /* pov done through J2 X axis */
  789. /* R defaults to J2 X axis */
  790. #define JOY_HWS_HASR 0x00080000l /* has R (4th axis) info */
  791. #define JOY_HWS_RISJ1X 0x00100000l /* R done through J1 X axis */
  792. #define JOY_HWS_RISJ1Y 0x00200000l /* R done through J1 Y axis */
  793. #define JOY_HWS_RISJ2Y 0x00400000l /* R done through J2 X axis */
  794. /* U & V for future hardware */
  795. #define JOY_HWS_HASU 0x00800000l /* has U (5th axis) info */
  796. #define JOY_HWS_HASV 0x01000000l /* has V (6th axis) info */
  797. /* Usage settings */
  798. #define JOY_US_HASRUDDER 0x00000001l /* joystick configured with rudder */
  799. #define JOY_US_PRESENT 0x00000002l /* is joystick actually present? */
  800. #define JOY_US_ISOEM 0x00000004l /* joystick is an OEM defined type */
  801. /* reserved for future use -> as link to next possible dword */
  802. #define JOY_US_RESERVED 0x80000000l /* reserved */
  803. begindoc
  804. /****************************************************************************
  805. *
  806. * @doc DDK
  807. *
  808. * Flags set in <mf DIJOYTYPEINFO::dwFlags1>.
  809. *
  810. * @define JOYTYPE_ZEROGAMEENUMOEMDATA | 0x00000001 |
  811. *
  812. * Zero the data passed to the gameport enumerator rather than
  813. * passing the default information.
  814. *
  815. * @define JOYTYPE_NOAUTODETECTGAMEPORT | 0x00000002 |
  816. *
  817. * Device does not support Autodetect gameport
  818. *
  819. * @define JOYTYPE_NOHIDDIRECT | 0x00000004 |
  820. *
  821. * This device should be read using the legacy method for this device
  822. * rather than directly through HID.
  823. *
  824. * @define JOYTYPE_ANALOGCOMPAT | 0x00000008 |
  825. *
  826. * This device needs the analog compatible ID to be exposed in
  827. * addition to the HW ID specified for the device.
  828. *
  829. * @define DIJOYTYPE_DEFAULTPROPSHEET | 0x80000000 |
  830. *
  831. * Override the OEM provided control panel property sheet page.
  832. * In some rare cases, the user may choose to use the default property
  833. * sheet page to calibrate / test a device.
  834. *
  835. ****************************************************************************/
  836. enddoc
  837. ;begin_public_5B2
  838. /* Settings for TypeInfo Flags1 */
  839. #define JOYTYPE_ZEROGAMEENUMOEMDATA 0x00000001l /* Zero GameEnum's OEM data field */
  840. #define JOYTYPE_NOAUTODETECTGAMEPORT 0x00000002l /* Device does not support Autodetect gameport*/
  841. #define JOYTYPE_NOHIDDIRECT 0x00000004l /* Do not use HID directly for this device */
  842. #define JOYTYPE_ANALOGCOMPAT 0x00000008l /* Expose the analog compatible ID */
  843. #define JOYTYPE_DEFAULTPROPSHEET 0x80000000l /* CPL overrides custom property sheet */
  844. #define JOYTYPE_FLAGS1_SETVALID 0x80000000l ;internal
  845. #define JOYTYPE_FLAGS1_GETVALID 0x8000000Fl ;internal
  846. ;end_public_5B2
  847. begindoc
  848. /****************************************************************************
  849. *
  850. * @doc DDK
  851. *
  852. * Flags set in <mf DIJOYTYPEINFO::dwFlags2>.
  853. *
  854. * @parm DWORD | dwFlags2 |
  855. *
  856. * Contains flags used to modify the default classification and
  857. * behavior of devices of this type.
  858. *
  859. * A type override may be retrieved from this value using
  860. * <f GET_DIDEVICE_TYPE> and a subtype override by using
  861. * <f GET_DIDEVICE_SUBTYPE>.
  862. * In addition four pairs of bits allow the sub-devices of a
  863. * compound device to be selectively hidden or revealed.
  864. * In each pair, it is an error for both bits to be set but if
  865. * neither bit is set, the default behavior will be used.
  866. *
  867. * @xref <f GET_DIDEVICE_TYPE>,
  868. * <f GET_DIDEVICE_SUBTYPE>.
  869. *
  870. * @define JOYTYPE_DEVICEHIDE | 0x00010000 |
  871. *
  872. * Do not enumerate unclassified devices related to this type
  873. * unless the <c DIEDFL_INCLUDEHIDDEN> flag is passed to device
  874. * enumeration.
  875. *
  876. * @define JOYTYPE_MOUSEHIDE | 0x00020000 |
  877. *
  878. * Do not enumerate mouse devices related to this type unless
  879. * the <c DIEDFL_INCLUDEHIDDEN> flag is passed to device enumeration.
  880. *
  881. * @define JOYTYPE_KEYBHIDE | 0x000400000 |
  882. *
  883. * Do not enumerate keyboard devices related to this type unless
  884. * the <c DIEDFL_INCLUDEHIDDEN> flag is passed to device enumeration.
  885. *
  886. * @define JOYTYPE_GAMEHIDE | 0x00080000 |
  887. *
  888. * Do not enumerate game devices related to this type unless the
  889. * <c DIEDFL_INCLUDEHIDDEN> flag is passed to device enumeration.
  890. *
  891. * @define JOYTYPE_HIDEACTIVE | 0x00100000 |
  892. *
  893. * Set to indicate that the <c JOYTYPE_*HIDE> flags should be acted
  894. * upon.
  895. *
  896. * @define JOYTYPE_INFOMASK | 0x00E00000 |
  897. *
  898. * Mask for bits used to modify type specific behaviors.
  899. *
  900. * @define JOYTYPE_INFODEFAULT | 0x00000000 |
  901. *
  902. * Value to indicate that default logic should be used for axis
  903. * selection.
  904. *
  905. * @define JOYTYPE_INFOYYPEDALS | 0x00200000 |
  906. *
  907. * Value for a DI8DEVTYPE_DRIVING device to indicate that the axis
  908. * reported through WinMM as the Y axis should be represented as a
  909. * combined accelerate/brake value.
  910. *
  911. * @define JOYTYPE_INFOZYPEDALS | 0x00400000 |
  912. *
  913. * Value for a DI8DEVTYPE_DRIVING device to indicate that the axes
  914. * reported through WinMM as Z and Y should be represented as the
  915. * accelerate and brake pedal values.
  916. *
  917. * @define JOYTYPE_INFOYRPEDALS | 0x00600000 |
  918. *
  919. * Value for a DI8DEVTYPE_DRIVING device to indicate that the axes
  920. * reported through WinMM as Y and R should be represented as the
  921. * accelerate and brake pedal values.
  922. *
  923. * @define JOYTYPE_INFOZRPEDALS | 0x00800000 |
  924. *
  925. * Value for a DI8DEVTYPE_DRIVING device to indicate that the axes
  926. * reported through WinMM as Z and R should be represented as the
  927. * accelerate and brake pedal values.
  928. *
  929. * @define JOYTYPE_INFOZISSLIDER | 0x00200000 |
  930. *
  931. * Value for a game controller other than DI8DEVTYPE_DRIVING device
  932. * to indicate that the axis reported through HID as a Z axis should
  933. * be represented as a slider value. Other axes that can reported
  934. * as a Z axis in DirectInput 5 (such as sliders and throttles) are
  935. * always reported as sliders in DirectInput 8.
  936. *
  937. * @define JOYTYPE_INFOZISZ | 0x00400000 |
  938. *
  939. * Value for a game controller other than DI8DEVTYPE_DRIVING device
  940. * to indicate that the axis reported through WinMM as a Z axis
  941. * should be represented as a Z axis.
  942. *
  943. * @define JOYTYPE_ENABLEINPUTREPORT | 0x01000000 |
  944. *
  945. * DINPUT will call GetInputReport() during HID acquisition to obtain
  946. * the initial device state.
  947. *
  948. ****************************************************************************/
  949. enddoc
  950. ;begin_public_dx8
  951. /* Settings for TypeInfo Flags2 */
  952. #define JOYTYPE_DEVICEHIDE 0x00010000l /* Hide unclassified devices */
  953. #define JOYTYPE_MOUSEHIDE 0x00020000l /* Hide mice */
  954. #define JOYTYPE_KEYBHIDE 0x00040000l /* Hide keyboards */
  955. #define JOYTYPE_GAMEHIDE 0x00080000l /* Hide game controllers */
  956. #define JOYTYPE_HIDEACTIVE 0x00100000l /* Hide flags are active */
  957. #define JOYTYPE_INFOMASK 0x00E00000l /* Mask for type specific info */
  958. #define JOYTYPE_INFODEFAULT 0x00000000l /* Use default axis mappings */
  959. #define JOYTYPE_INFOYYPEDALS 0x00200000l /* Use Y as a combined pedals axis */
  960. #define JOYTYPE_INFOZYPEDALS 0x00400000l /* Use Z for accelerate, Y for brake */
  961. #define JOYTYPE_INFOYRPEDALS 0x00600000l /* Use Y for accelerate, R for brake */
  962. #define JOYTYPE_INFOZRPEDALS 0x00800000l /* Use Z for accelerate, R for brake */
  963. #define JOYTYPE_INFOZISSLIDER 0x00200000l /* Use Z as a slider */
  964. #define JOYTYPE_INFOZISZ 0x00400000l /* Use Z as Z axis */
  965. #define JOYTYPE_ENABLEINPUTREPORT 0x01000000l /* Enable initial input reports */
  966. #define JOYTYPE_FLAGS2_SETVALID 0x01FFFFFFl ;internal
  967. #define JOYTYPE_FLAGS2_GETVALID 0x01FFFFFFl ;internal
  968. ;end_public_dx8
  969. /* struct for storing x,y, z, and rudder values */
  970. typedef struct joypos_tag {
  971. DWORD dwX;
  972. DWORD dwY;
  973. DWORD dwZ;
  974. DWORD dwR;
  975. DWORD dwU;
  976. DWORD dwV;
  977. } JOYPOS, FAR *LPJOYPOS;
  978. ;begin_internal
  979. #define iJoyPosAxisX 0 /* The order in which */
  980. #define iJoyPosAxisY 1 /* axes appear */
  981. #define iJoyPosAxisZ 2 /* in a JOYPOS */
  982. #define iJoyPosAxisR 3
  983. #define iJoyPosAxisU 4
  984. #define iJoyPosAxisV 5
  985. #define cJoyPosAxisMax 6
  986. #define cJoyPosButtonMax 32
  987. ;end_internal
  988. /* struct for storing ranges */
  989. typedef struct joyrange_tag {
  990. JOYPOS jpMin;
  991. JOYPOS jpMax;
  992. JOYPOS jpCenter;
  993. } JOYRANGE,FAR *LPJOYRANGE;
  994. /*
  995. * dwTimeout - value at which to timeout joystick polling
  996. * jrvRanges - range of values app wants returned for axes
  997. * jpDeadZone - area around center to be considered
  998. * as "dead". specified as a percentage
  999. * (0-100). Only X & Y handled by system driver
  1000. */
  1001. typedef struct joyreguservalues_tag {
  1002. DWORD dwTimeOut;
  1003. JOYRANGE jrvRanges;
  1004. JOYPOS jpDeadZone;
  1005. } JOYREGUSERVALUES, FAR *LPJOYREGUSERVALUES;
  1006. typedef struct joyreghwsettings_tag {
  1007. DWORD dwFlags;
  1008. DWORD dwNumButtons;
  1009. } JOYREGHWSETTINGS, FAR *LPJOYHWSETTINGS;
  1010. /* range of values returned by the hardware (filled in by calibration) */
  1011. /*
  1012. * jrvHardware - values returned by hardware
  1013. * dwPOVValues - POV values returned by hardware
  1014. * dwCalFlags - what has been calibrated
  1015. */
  1016. typedef struct joyreghwvalues_tag {
  1017. JOYRANGE jrvHardware;
  1018. DWORD dwPOVValues[JOY_POV_NUMDIRS];
  1019. DWORD dwCalFlags;
  1020. } JOYREGHWVALUES, FAR *LPJOYREGHWVALUES;
  1021. /* hardware configuration */
  1022. /*
  1023. * hws - hardware settings
  1024. * dwUsageSettings - usage settings
  1025. * hwv - values returned by hardware
  1026. * dwType - type of joystick
  1027. * dwReserved - reserved for OEM drivers
  1028. */
  1029. typedef struct joyreghwconfig_tag {
  1030. JOYREGHWSETTINGS hws;
  1031. DWORD dwUsageSettings;
  1032. JOYREGHWVALUES hwv;
  1033. DWORD dwType;
  1034. DWORD dwReserved;
  1035. } JOYREGHWCONFIG, FAR *LPJOYREGHWCONFIG;
  1036. /* joystick calibration info structure */
  1037. typedef struct joycalibrate_tag {
  1038. UINT wXbase;
  1039. UINT wXdelta;
  1040. UINT wYbase;
  1041. UINT wYdelta;
  1042. UINT wZbase;
  1043. UINT wZdelta;
  1044. } JOYCALIBRATE;
  1045. typedef JOYCALIBRATE FAR *LPJOYCALIBRATE;
  1046. #endif
  1047. #ifndef DIJ_RINGZERO
  1048. #define MAX_JOYSTRING 256
  1049. typedef BOOL (FAR PASCAL * LPDIJOYTYPECALLBACK)(LPCWSTR, LPVOID);
  1050. #ifndef MAX_JOYSTICKOEMVXDNAME
  1051. #define MAX_JOYSTICKOEMVXDNAME 260
  1052. #endif
  1053. begindoc
  1054. /****************************************************************************
  1055. *
  1056. * @doc DDK
  1057. *
  1058. * @define DITC_REGHWSETTINGS | 0x00000001 |
  1059. *
  1060. * Parameter to <mf IDirectInputJoyConfig::GetTypeInfo>
  1061. * and <mf IDirectInputJoyConfig::SetTypeInfo>
  1062. * indicating that the registry hardware settings for
  1063. * the joystick are valid or are being requested.
  1064. *
  1065. * @define DITC_CLSIDCONFIG | 0x00000002 |
  1066. *
  1067. * Parameter to
  1068. * <mf IDirectInputJoyConfig::GetTypeInfo> or
  1069. * <mf IDirectInputJoyConfig::SetTypeInfo> indicating
  1070. * that the joystick configuration <t CLSID>
  1071. * is valid or is being requested. If the value is
  1072. * all-zeros, then there is no custom configuration
  1073. * for this joystick type.
  1074. *
  1075. * @define DITC_DISPLAYNAME | 0x00000004 |
  1076. *
  1077. * Parameter to
  1078. * <mf IDirectInputJoyConfig::GetTypeInfo> or
  1079. * <mf IDirectInputJoyConfig::SetTypeInfo> indicating
  1080. * that the display name for the joystick type
  1081. * is valid or is being requested.
  1082. *
  1083. * @define DITC_CALLOUT | 0x00000008 |
  1084. *
  1085. * Parameter to
  1086. * <mf IDirectInputJoyConfig::GetTypeInfo> or
  1087. * <mf IDirectInputJoyConfig::SetTypeInfo> indicating
  1088. * that the callout for the joystick type
  1089. * is valid or is being requested.
  1090. *
  1091. * @define DITC_HARDWAREID | 0x00000010 |
  1092. * Parameter to
  1093. * <mf IDirectInputJoyConfig::GetTypeInfo> or
  1094. * <mf IDirectInputJoyConfig::SetTypeInfo> indicating
  1095. * that the Hardware ID for the joystick type
  1096. * is valid or is being requested.
  1097. * This field is new for DX6.1a
  1098. *
  1099. * @define DITC_FLAGS1 | 0x00000020 |
  1100. * Parameter to
  1101. * <mf IDirectInputJoyConfig::GetTypeInfo> or
  1102. * <mf IDirectInputJoyConfig::SetTypeInfo> indicating
  1103. * that the dwFlags1 field for the joystick type
  1104. * is valid or is being requested.
  1105. * This field is new for DX6.1a
  1106. *
  1107. * @define DITC_FLAGS2 | 0x00000040 |
  1108. * Parameter to
  1109. * <mf IDirectInputJoyConfig::GetTypeInfo> or
  1110. * <mf IDirectInputJoyConfig::SetTypeInfo> indicating
  1111. * that the dwFlags2 field for the joystick type
  1112. * is valid or is being requested.
  1113. * This field is new for DX8
  1114. *
  1115. * @define DITC_MAPFILE | 0x00000080 |
  1116. * Parameter to
  1117. * <mf IDirectInputJoyConfig::GetTypeInfo> or
  1118. * <mf IDirectInputJoyConfig::SetTypeInfo> indicating
  1119. * that the dwFlags2 field for the joystick type
  1120. * is valid or is being requested.
  1121. * This field is new for DX8
  1122. *
  1123. * @doc INTERNAL
  1124. *
  1125. * @define DITC_VOLATILEREGKEY | 0x80000000 |
  1126. *
  1127. * Internal flag to
  1128. * <mf IDirectInputJoyConfig::SetTypeInfo>
  1129. * indicating that a volatile registry key
  1130. * should be used to store Config information
  1131. * for this type.
  1132. *
  1133. ****************************************************************************/
  1134. enddoc
  1135. #define DITC_REGHWSETTINGS 0x00000001
  1136. #define DITC_CLSIDCONFIG 0x00000002
  1137. #define DITC_DISPLAYNAME 0x00000004
  1138. #define DITC_CALLOUT 0x00000008
  1139. #define DITC_HARDWAREID 0x00000010;public_5B2
  1140. #define DITC_FLAGS1 0x00000020;public_5B2
  1141. #define DITC_FLAGS2 0x00000040;public_800
  1142. #define DITC_MAPFILE 0x00000080;public_800
  1143. #define DITC_INREGISTRY 0x0000000F;internal_dx5
  1144. #define DITC_GETVALID 0x0000000F;internal_dx5
  1145. #define DITC_SETVALID 0x0000000F;internal_dx5
  1146. #define DITC_VOLATILEREGKEY 0x80000000;internal
  1147. #define DITC_INREGISTRY_DX5 0x0000000F;internal
  1148. #define DITC_GETVALID_DX5 0x0000000F;internal
  1149. #define DITC_SETVALID_DX5 0x0000000F;internal
  1150. #define DITC_INREGISTRY_DX6 0x0000003F;internal_800
  1151. #define DITC_GETVALID_DX6 0x0000003F;internal_800
  1152. #define DITC_SETVALID_DX6 0x0000003F;internal_800
  1153. #define DITC_INREGISTRY 0x0000003F;internal_dx7
  1154. #define DITC_GETVALID 0x0000003F;internal_dx7
  1155. #define DITC_SETVALID 0x0000003F;internal_dx7
  1156. #define DITC_INREGISTRY 0x000000FF;internal_800
  1157. #define DITC_GETVALID 0x000000FF;internal_800
  1158. #define DITC_SETVALID 0x000000FF;internal_800
  1159. begindoc
  1160. /****************************************************************************
  1161. *
  1162. * @doc DDK
  1163. *
  1164. * @struct DIJOYTYPEINFO |
  1165. *
  1166. * The <t DIJOYTYPEINFO> structure contains
  1167. * information about a joystick type.
  1168. *
  1169. * A "joystick type" describes how DirectInput should
  1170. * communicate with the device and how it should report
  1171. * device data. For example, "A Frobozz Industries
  1172. * SuperStick 5X is a three-axis, five-button joystick
  1173. * with the third axis reported as the first bit on
  1174. * the second pot."
  1175. *
  1176. * DirectInput comes with the following predefined joystick
  1177. * types, all with axes in their default locations.
  1178. *
  1179. * Two-axis, two-button joystick
  1180. *
  1181. * Two-axis, four-button joystick
  1182. *
  1183. * Two-button gamepad
  1184. *
  1185. * Two-button flight yoke
  1186. *
  1187. * Two-button flight yoke with throttle
  1188. *
  1189. * Three-axis, two-button joystick
  1190. *
  1191. * Three-axis, four-button joystick
  1192. *
  1193. * Four-button gamepad
  1194. *
  1195. * Four-button flight yoke
  1196. *
  1197. * Four-button flight yoke with throttle
  1198. *
  1199. * If the joystick type has the
  1200. * <c JOY_HWS_ISGAMEPORTDRIVER> flag set in
  1201. * the <e JOYHWSETTINGS.dwFlags> field of
  1202. * the <t JOYHWSETTINGS> structure, then
  1203. * the <e DIJOYTYPEINFO.wszCallout> field of
  1204. * the <t DIJOYTYPEINFO> structure contains the
  1205. * name of a driver which can be used as a global driver.
  1206. * The joystick type should be shown on the list of
  1207. * global drivers and not shown on the list of
  1208. * assignable joystick types.
  1209. *
  1210. * @field DWORD | dwSize |
  1211. *
  1212. * Specifies the size, in bytes, of the structure.
  1213. * This field "must" be initialized by the application
  1214. * before calling any DirectInput method.
  1215. *
  1216. * @field JOYREGHWSETTINGS | hws |
  1217. *
  1218. * Joystick hardware settings, as documented in the
  1219. * mmddk.h header file.
  1220. *
  1221. * @field CLSID | clsidConfig |
  1222. *
  1223. * <t CLSID> for the joystick type configuration object.
  1224. * Pass this <t CLSID> to <f CoCreateInstance> to create
  1225. * a configuration object.
  1226. *
  1227. * This field is all-zero if the type does not have
  1228. * custom configuration.
  1229. *
  1230. * @field WCHAR | wszDisplayName[MAX_JOYSTRING] |
  1231. *
  1232. * The display name for the joystick type. The display name
  1233. * is the name that should be used to display the name of
  1234. * the joystick type to the end-user.
  1235. *
  1236. * @field WCHAR | wszCallout[MAX_JOYSTICKOEMVXDNAME] |
  1237. *
  1238. * The device that is responsible for handling polling
  1239. * for devices of this type. This is a null string if the global
  1240. * polling callout is to be used.
  1241. *
  1242. ;begin_if_(DIRECTINPUT_VERSION)_5B2
  1243. * @field WCHAR | wszHardwareId[MAX_JOYSTRING] |
  1244. * The hardware ID for the joystick type. The hardware ID is used
  1245. * by Plug and Play on WINNT50 to find the drivers for the joystick.
  1246. * This field is new for DX6.1a
  1247. *
  1248. * @field DWORD | dwFlags1 |
  1249. * Additional flags pertinent to device type.
  1250. *
  1251. * @field DWORD | dwFlags2 |
  1252. * Additional flags used to override the way a device is handled.
  1253. *
  1254. * @field WCHAR | wszMapFile[MAX_JOYSTRING] |
  1255. *
  1256. * Full path and file name of the IHV supplied semantic map file.
  1257. ;end
  1258. *
  1259. *
  1260. ****************************************************************************/
  1261. enddoc
  1262. ;begin_public_5B2
  1263. /* This structure is defined for DirectX 5.0 compatibility */
  1264. typedef struct DIJOYTYPEINFO_DX5 {
  1265. DWORD dwSize;
  1266. JOYREGHWSETTINGS hws;
  1267. CLSID clsidConfig;
  1268. WCHAR wszDisplayName[MAX_JOYSTRING];
  1269. WCHAR wszCallout[MAX_JOYSTICKOEMVXDNAME];
  1270. } DIJOYTYPEINFO_DX5, *LPDIJOYTYPEINFO_DX5;
  1271. typedef const DIJOYTYPEINFO_DX5 *LPCDIJOYTYPEINFO_DX5;
  1272. ;end_public_5B2
  1273. ;begin_public_800
  1274. /* This structure is defined for DirectX 6.1 compatibility */
  1275. typedef struct DIJOYTYPEINFO_DX6 {
  1276. DWORD dwSize;
  1277. JOYREGHWSETTINGS hws;
  1278. CLSID clsidConfig;
  1279. WCHAR wszDisplayName[MAX_JOYSTRING];
  1280. WCHAR wszCallout[MAX_JOYSTICKOEMVXDNAME];
  1281. WCHAR wszHardwareId[MAX_JOYSTRING];
  1282. DWORD dwFlags1;
  1283. } DIJOYTYPEINFO_DX6, *LPDIJOYTYPEINFO_DX6;
  1284. typedef const DIJOYTYPEINFO_DX6 *LPCDIJOYTYPEINFO_DX6;
  1285. ;end_public_800
  1286. typedef struct DIJOYTYPEINFO {
  1287. DWORD dwSize;
  1288. JOYREGHWSETTINGS hws;
  1289. CLSID clsidConfig;
  1290. WCHAR wszDisplayName[MAX_JOYSTRING];
  1291. WCHAR wszCallout[MAX_JOYSTICKOEMVXDNAME];
  1292. ;begin_if_(DIRECTINPUT_VERSION)_5B2
  1293. WCHAR wszHardwareId[MAX_JOYSTRING];
  1294. DWORD dwFlags1;
  1295. ;begin_if_(DIRECTINPUT_VERSION)_800
  1296. DWORD dwFlags2;
  1297. WCHAR wszMapFile[MAX_JOYSTRING];
  1298. ;end
  1299. ;end
  1300. } DIJOYTYPEINFO, *LPDIJOYTYPEINFO;
  1301. typedef const DIJOYTYPEINFO *LPCDIJOYTYPEINFO;
  1302. ;begin_internal_5B2
  1303. /*
  1304. * Name for the 8.0 structure, in places where we specifically care.
  1305. */
  1306. typedef DIJOYTYPEINFO DIJOYTYPEINFO_DX8;
  1307. typedef LPDIJOYTYPEINFO *LPDIJOYTYPEINFO_DX8;
  1308. BOOL static __inline
  1309. IsValidSizeDIJOYTYPEINFO(DWORD cb)
  1310. {
  1311. return cb == sizeof(DIJOYTYPEINFO_DX8) ||
  1312. cb == sizeof(DIJOYTYPEINFO_DX6) ||
  1313. cb == sizeof(DIJOYTYPEINFO_DX5);
  1314. }
  1315. ;end_internal
  1316. begindoc
  1317. /****************************************************************************
  1318. *
  1319. * @doc DDK
  1320. *
  1321. * @define DIJC_GUIDINSTANCE | 0x00000001 |
  1322. *
  1323. * Parameter to
  1324. * <mf IDirectInputJoyConfig::GetConfig> indicating
  1325. * that the instance <t GUID> for the joystick
  1326. * is being requested. An application can pass the
  1327. * instance <t GUID> to <mf IDirectInput::CreateDevice>
  1328. * to obtain an <i IDirectInputDevice> interface to
  1329. * the joystick.
  1330. *
  1331. *
  1332. * @define DIJC_REGHWCONFIGTYPE | 0x00000002 |
  1333. *
  1334. * Parameter to
  1335. * <mf IDirectInputJoyConfig::GetConfig> or
  1336. * <mf IDirectInputJoyConfig::SetConfig> indicating
  1337. * that the hardware configuration for the joystick
  1338. * (<e DIJOYCONFIG.hwc>)
  1339. * and the joystick type name (<e DIJOYCONFIG.wszType>)
  1340. * are valid or are being requested.
  1341. *
  1342. * Note that the hardware configuration and type
  1343. * name cannot be set separately.
  1344. *
  1345. * @define DIJC_GAIN | 0x00000004 |
  1346. *
  1347. * Parameter to
  1348. * <mf IDirectInputJoyConfig::GetConfig> or
  1349. * <mf IDirectInputJoyConfig::SetConfig> indicating
  1350. * that the force feedback gain for the joystick
  1351. * is valid or is being requested.
  1352. *
  1353. * @define DIJC_CALLOUT | 0x00000008 |
  1354. *
  1355. * Parameter to
  1356. * <mf IDirectInputJoyConfig::GetConfig> or
  1357. * <mf IDirectInputJoyConfig::SetConfig> indicating
  1358. * that the joystick polling callout
  1359. * is valid or is being requested.
  1360. *
  1361. ;begin_public_5B2
  1362. * @define DIJC_GAMEPORT | 0x00000010 |
  1363. * Parameter to
  1364. * <mf IDirectInputJoyConfig::GetConfig> or
  1365. * <mf IDirectInputJoyConfig::SetConfig> indicating
  1366. * the gameport Emulator to use for the joystick.
  1367. ;end_public_5B2
  1368. *
  1369. * @doc INTERNAL
  1370. *
  1371. * @define DIJC_UPDATEALIAS | 0x80000000 |
  1372. *
  1373. * Internal flag to
  1374. * <mf IDirectInputJoyConfig::SetConfig>
  1375. * indicating that we should also update alias
  1376. * device calibrations. The value in the calibration
  1377. * structure consists of VJOYD-style calibration information.
  1378. * It needs to be converted to DirectInput-style calibration
  1379. * information if the recipient wishes it to be such.
  1380. *
  1381. ****************************************************************************/
  1382. enddoc
  1383. #define DIJC_GUIDINSTANCE 0x00000001
  1384. #define DIJC_REGHWCONFIGTYPE 0x00000002
  1385. #define DIJC_GAIN 0x00000004
  1386. #define DIJC_CALLOUT 0x00000008
  1387. #define DIJC_WDMGAMEPORT 0x00000010;public_5b2
  1388. #define DIJC_UPDATEALIAS 0x80000000;internal
  1389. #define DIJC_INREGISTRY 0x0000000E;internal_dx5
  1390. #define DIJC_GETVALID 0x0000000F;internal_dx5
  1391. #define DIJC_SETVALID 0x0000000E;internal_dx5
  1392. #define DIJC_INREGISTRY_DX5 0x0000000E;internal_5b2
  1393. #define DIJC_GETVALID_DX5 0x0000000F;internal_5b2
  1394. #define DIJC_SETVALID_DX5 0x0000000E;internal_5b2
  1395. #define DIJC_INREGISTRY 0x0000001E;internal_5b2
  1396. #define DIJC_GETVALID 0x0000001F;internal_5b2
  1397. #define DIJC_SETVALID 0x0000001F;internal_5b2
  1398. #define DIJC_INTERNALSETVALID 0x8000001F;internal_5b2
  1399. begindoc
  1400. /****************************************************************************
  1401. *
  1402. * @doc DDK
  1403. *
  1404. * @struct DIJOYCONFIG |
  1405. *
  1406. * The <t DIJOYCONFIG> structure contains information
  1407. * about a joystick's configuration.
  1408. *
  1409. * @field DWORD | dwSize |
  1410. *
  1411. * Specifies the size, in bytes, of the structure.
  1412. * This field "must" be initialized by the application
  1413. * before calling any DirectInput method.
  1414. *
  1415. * @field GUID | guidInstance |
  1416. *
  1417. * The instance guid for the joystick.
  1418. *
  1419. * @field JOYREGHWCONFIG | hwc |
  1420. *
  1421. * Joystick hardware configuration, as documented in the
  1422. * mmddk.h header file.
  1423. *
  1424. * @field DWORD | dwGain |
  1425. *
  1426. * Global gain setting. This value is applied to all
  1427. * force feedback effects as a "master volume control".
  1428. *
  1429. * @field WCHAR | wszType[MAX_JOYSTRING] |
  1430. *
  1431. * The joystick type for the joystick.
  1432. * It must be one of the values enumerated by
  1433. * <mf IDirectInputJoyConfig::EnumTypes>.
  1434. *
  1435. * @field WCHAR | wszCallout[MAX_JOYSTRING] |
  1436. *
  1437. * The callout driver for the joystick.
  1438. *
  1439. ;begin_if_(DIRECTINPUT_VERSION)_5B2
  1440. * @field GUID | guidGameport |
  1441. *
  1442. * A GUID that identifies the Gameport being used for this joystick.
  1443. * Available gameports can be found by enumurating with the
  1444. * <mf IDirectInputJoyConfig::GetTypeInfo> interface and studying devices which
  1445. * have the flags JOY_HWS_ISGAMEPORTBUS set in <mf DIJOYTYPEINFO::hws->dwFlags> field.
  1446. *
  1447. * Alternatively, you can set this GUID to GUID_GAMEENUM_BUS_ENUMERATOR. This will
  1448. * expose the device on all unused gameports. Devices that report a "not connected"
  1449. * status will be subsequently removed.
  1450. ;end
  1451. *
  1452. *
  1453. ****************************************************************************/
  1454. enddoc
  1455. ;begin_public_5B2
  1456. /* This structure is defined for DirectX 5.0 compatibility */
  1457. typedef struct DIJOYCONFIG_DX5 {
  1458. DWORD dwSize;
  1459. GUID guidInstance;
  1460. JOYREGHWCONFIG hwc;
  1461. DWORD dwGain;
  1462. WCHAR wszType[MAX_JOYSTRING];
  1463. WCHAR wszCallout[MAX_JOYSTRING];
  1464. } DIJOYCONFIG_DX5, *LPDIJOYCONFIG_DX5;
  1465. typedef const DIJOYCONFIG_DX5 *LPCDIJOYCONFIG_DX5;
  1466. ;end_public_5B2
  1467. typedef struct DIJOYCONFIG {
  1468. DWORD dwSize;
  1469. GUID guidInstance;
  1470. JOYREGHWCONFIG hwc;
  1471. DWORD dwGain;
  1472. WCHAR wszType[MAX_JOYSTRING];
  1473. WCHAR wszCallout[MAX_JOYSTRING];
  1474. ;begin_if_(DIRECTINPUT_VERSION)_5B2
  1475. GUID guidGameport;
  1476. ;end
  1477. } DIJOYCONFIG, *LPDIJOYCONFIG;
  1478. typedef const DIJOYCONFIG *LPCDIJOYCONFIG;
  1479. ;begin_internal_5B2
  1480. /*
  1481. * Name for the 6.? structure, in places where we specifically care.
  1482. */
  1483. typedef DIJOYCONFIG DIJOYCONFIG_DX6;
  1484. typedef DIJOYCONFIG *LPDIJOYCONFIG_DX6;
  1485. BOOL static __inline
  1486. IsValidSizeDIJOYCONFIG(DWORD cb)
  1487. {
  1488. return cb == sizeof(DIJOYCONFIG_DX6) ||
  1489. cb == sizeof(DIJOYCONFIG_DX5);
  1490. }
  1491. ;end_internal_5B2
  1492. begindoc
  1493. /****************************************************************************
  1494. *
  1495. * @doc DDK
  1496. *
  1497. * @define DIJU_USERVALUES | 0x00000001 |
  1498. *
  1499. * Parameter to
  1500. * <mf IDirectInputJoyConfig::GetUserValues> or
  1501. * <mf IDirectInputJoyConfig::SetUserValues> indicating
  1502. * that the user configuration settings
  1503. * (<e DIJOYUSERVALUES.ruv>)
  1504. * is valid or is being requested.
  1505. *
  1506. * @define DIJU_GLOBALDRIVER | 0x00000002 |
  1507. *
  1508. * Parameter to
  1509. * <mf IDirectInputJoyConfig::GetUserValues> or
  1510. * <mf IDirectInputJoyConfig::SetUserValues> indicating
  1511. * that the global port driver
  1512. * (<e DIJOYUSERVALUES.wszGlobalDriver>)
  1513. * is valid or is being requested.
  1514. *
  1515. * A list of valid global drivers can be obtained by
  1516. * enumerating the list of joystick types.
  1517. * If the joystick type has the
  1518. * <c JOY_HWS_ISGAMEPORTDRIVER> flag set in
  1519. * the <e JOYHWSETTINGS.dwFlags> field of
  1520. * the <t JOYHWSETTINGS> structure, then
  1521. * the <e DIJOYTYPEINFO.wszCallout> field of
  1522. * the <t DIJOYTYPEINFO> structure contains the
  1523. * name of a driver which can be used as a global driver.
  1524. *
  1525. * @define DIJU_GAMEPORTEMULATOR | 0x00000004 |
  1526. *
  1527. * Parameter to
  1528. * <mf IDirectInputJoyConfig::GetUserValues> or
  1529. * <mf IDirectInputJoyConfig::SetUserValues> indicating
  1530. * that the gameport emulator driver
  1531. * (<e DIJOYUSERVALUES.wszGameportEmulator>).
  1532. * is valid or is being requested.
  1533. *
  1534. * A list of valid gameport emulators can be obtained by
  1535. * enumerating the list of joystick types.
  1536. * If the joystick type has the
  1537. * <c JOY_HWS_ISGAMEPORTEMULATOR> flag set in
  1538. * the <e JOYHWSETTINGS.dwFlags> field of
  1539. * the <t JOYHWSETTINGS> structure, then
  1540. * the <e DIJOYTYPEINFO.wszCallout> field of
  1541. * the <t DIJOYTYPEINFO> structure contains the
  1542. * name of a driver which can be used as a
  1543. * gameport emulator.
  1544. *
  1545. *
  1546. ****************************************************************************/
  1547. enddoc
  1548. #define DIJU_USERVALUES 0x00000001
  1549. #define DIJU_GLOBALDRIVER 0x00000002
  1550. #define DIJU_GAMEPORTEMULATOR 0x00000004
  1551. #define DIJU_INDRIVERREGISTRY 0x00000006;internal
  1552. #define DIJU_GETVALID 0x00000007;internal
  1553. #define DIJU_SETVALID 0x80000007;internal
  1554. begindoc
  1555. /****************************************************************************
  1556. *
  1557. * @doc DDK
  1558. *
  1559. * @struct DIJOYUSERVALUES |
  1560. *
  1561. * The <t DIJOYUSERVALUES> structure contains information
  1562. * about the user's joystick settings.
  1563. *
  1564. * @field DWORD | dwSize |
  1565. *
  1566. * Specifies the size, in bytes, of the structure.
  1567. * This field "must" be initialized by the application
  1568. * before calling any DirectInput method.
  1569. *
  1570. * @field JOYREGUSERVALUES | ruv |
  1571. *
  1572. * Joystick user configuration, as documented in the
  1573. * mmddk.h header file.
  1574. *
  1575. * In addition to the fields documented in the mmddk.h
  1576. * header file, the heretofore unused
  1577. * jrvRanges.jpCenter field
  1578. * contains the user saturation levels for each axis.
  1579. *
  1580. * A control panel application sets the dead zone and
  1581. * saturation values based on the values set by the
  1582. * end-user during calibration or fine-tuning.
  1583. * "Dead zone" can be interpreted as "sensitivity in the
  1584. * center" and "Saturation" can be interpreted as
  1585. * "sensitive along the edges".
  1586. *
  1587. * @field WCHAR | wszGlobalDriver[MAX_JOYSTRING] |
  1588. *
  1589. * The global port driver.
  1590. *
  1591. * @field WCHAR | wszGameportEmulator[MAX_JOYSTRING] |
  1592. *
  1593. * The gameport emulator.
  1594. *
  1595. ****************************************************************************/
  1596. enddoc
  1597. typedef struct DIJOYUSERVALUES {
  1598. DWORD dwSize;
  1599. JOYREGUSERVALUES ruv;
  1600. WCHAR wszGlobalDriver[MAX_JOYSTRING];
  1601. WCHAR wszGameportEmulator[MAX_JOYSTRING];
  1602. } DIJOYUSERVALUES, *LPDIJOYUSERVALUES;
  1603. typedef const DIJOYUSERVALUES *LPCDIJOYUSERVALUES;
  1604. DEFINE_GUID(GUID_KeyboardClass, 0x4D36E96B,0xE325,0x11CE,0xBF,0xC1,0x08,0x00,0x2B,0xE1,0x03,0x18);
  1605. DEFINE_GUID(GUID_MediaClass, 0x4D36E96C,0xE325,0x11CE,0xBF,0xC1,0x08,0x00,0x2B,0xE1,0x03,0x18);
  1606. DEFINE_GUID(GUID_MouseClass, 0x4D36E96F,0xE325,0x11CE,0xBF,0xC1,0x08,0x00,0x2B,0xE1,0x03,0x18);
  1607. DEFINE_GUID(GUID_HIDClass, 0x745A17A0,0x74D3,0x11D0,0xB6,0xFE,0x00,0xA0,0xC9,0x0F,0x57,0xDA);
  1608. begin_interface(IDirectInputJoyConfig)
  1609. begin_methods()
  1610. declare_method(Acquire)
  1611. declare_method(Unacquire)
  1612. declare_method(SetCooperativeLevel, HWND, DWORD)
  1613. declare_method(SendNotify)
  1614. declare_method(EnumTypes, LPDIJOYTYPECALLBACK, LPVOID)
  1615. declare_method(GetTypeInfo, LPCWSTR, LPDIJOYTYPEINFO, DWORD)
  1616. declare_method(SetTypeInfo, LPCWSTR, LPCDIJOYTYPEINFO, DWORD)
  1617. declare_method(DeleteType, LPCWSTR)
  1618. declare_method(GetConfig, UINT, LPDIJOYCONFIG, DWORD)
  1619. declare_method(SetConfig, UINT, LPCDIJOYCONFIG, DWORD)
  1620. declare_method(DeleteConfig, UINT)
  1621. declare_method(GetUserValues, LPDIJOYUSERVALUES, DWORD)
  1622. declare_method(SetUserValues, LPCDIJOYUSERVALUES, DWORD)
  1623. declare_method(AddNewHardware, HWND, REFGUID)
  1624. declare_method(OpenTypeKey, LPCWSTR, DWORD, PHKEY)
  1625. declare_method(OpenConfigKey, UINT, DWORD, PHKEY)
  1626. end_methods()
  1627. end_interface()
  1628. #endif /* DIJ_RINGZERO */
  1629. ;begin_if_(DIRECTINPUT_VERSION)_800
  1630. #ifndef DIJ_RINGZERO
  1631. begin_interface(IDirectInputJoyConfig8)
  1632. begin_methods()
  1633. declare_method(Acquire)
  1634. declare_method(Unacquire)
  1635. declare_method(SetCooperativeLevel, HWND, DWORD)
  1636. declare_method(SendNotify)
  1637. declare_method(EnumTypes, LPDIJOYTYPECALLBACK, LPVOID)
  1638. declare_method(GetTypeInfo, LPCWSTR, LPDIJOYTYPEINFO, DWORD)
  1639. declare_method(SetTypeInfo, LPCWSTR, LPCDIJOYTYPEINFO, DWORD, LPWSTR)
  1640. declare_method(DeleteType, LPCWSTR)
  1641. declare_method(GetConfig, UINT, LPDIJOYCONFIG, DWORD)
  1642. declare_method(SetConfig, UINT, LPCDIJOYCONFIG, DWORD)
  1643. declare_method(DeleteConfig, UINT)
  1644. declare_method(GetUserValues, LPDIJOYUSERVALUES, DWORD)
  1645. declare_method(SetUserValues, LPCDIJOYUSERVALUES, DWORD)
  1646. declare_method(AddNewHardware, HWND, REFGUID)
  1647. declare_method(OpenTypeKey, LPCWSTR, DWORD, PHKEY)
  1648. declare_method(OpenAppStatusKey, PHKEY)
  1649. end_methods()
  1650. end_interface()
  1651. #endif /* DIJ_RINGZERO */
  1652. /****************************************************************************
  1653. *
  1654. * Notification Messages
  1655. *
  1656. ****************************************************************************/
  1657. /* RegisterWindowMessage with this to get DirectInput notification messages */
  1658. #define DIRECTINPUT_NOTIFICATION_MSGSTRINGA "DIRECTINPUT_NOTIFICATION_MSGSTRING"
  1659. #define DIRECTINPUT_NOTIFICATION_MSGSTRINGW L"DIRECTINPUT_NOTIFICATION_MSGSTRING"
  1660. #ifdef UNICODE
  1661. #define DIRECTINPUT_NOTIFICATION_MSGSTRING DIRECTINPUT_NOTIFICATION_MSGSTRINGW
  1662. #else
  1663. #define DIRECTINPUT_NOTIFICATION_MSGSTRING DIRECTINPUT_NOTIFICATION_MSGSTRINGA
  1664. #endif
  1665. begindoc
  1666. /****************************************************************************
  1667. *
  1668. * @doc DDK
  1669. *
  1670. * @define DIMSGWP_NEWAPPSTART | 0x00000001 |
  1671. *
  1672. * <e MSG.wParam> value of message sent to notify applications that
  1673. * a DirectInput has been initialized by an application that has not
  1674. * been used by the current user before.
  1675. *
  1676. * @define DIMSGWP_APPSTART | 0x00000002 |
  1677. *
  1678. * <e MSG.wParam> value of message sent to notify applications that
  1679. * a DirectInput has been initialized by an application that did not
  1680. * use mapper functions on any previous run by the current user.
  1681. *
  1682. * @define DIMSGWP_MAPPERAPPSTART | 0x00000004 |
  1683. *
  1684. * <e MSG.wParam> value of message sent to notify applications that
  1685. * a DirectInput has been initialized by an application that uses
  1686. * semantic mapper functions.
  1687. *
  1688. ****************************************************************************/
  1689. enddoc
  1690. #define DIMSGWP_NEWAPPSTART 0x00000001
  1691. #define DIMSGWP_DX8APPSTART 0x00000002
  1692. #define DIMSGWP_DX8MAPPERAPPSTART 0x00000003
  1693. ;end
  1694. begindoc
  1695. /****************************************************************************
  1696. *
  1697. * @doc DDK
  1698. *
  1699. * @define DIRECTINPUT_REGSTR_VAL_APPIDFLAG | "AppIdFlag" |
  1700. *
  1701. * Registry value under the key opened by
  1702. * <mf IDirectInputJoyConfig::OpenAppStatusKey> containing
  1703. * information about how the AppID (appliction ID) can be composed.
  1704. * By default, AppID is composed by application name, time, and size.
  1705. * AppIDFlag = DIAPPIDFLAG_NOTIME :
  1706. * composed by appliction name and size
  1707. * AppIDFlag = DIAPPIDFLAG_NOSIZE :
  1708. * composed by appliction name and time
  1709. * AppIDFlag = DIAPPIDFLAG_NOTIME | DIAPPIDFLAG_NOSIZE :
  1710. * composed only by appliction name
  1711. *
  1712. * @define DIRECTINPUT_REGSTR_KEY_LASTAPP | "MostRecentApplication" |
  1713. *
  1714. * Registry key under the key opened by
  1715. * <mf IDirectInputJoyConfig::OpenAppStatusKey> containing
  1716. * information about the most recent application to run without
  1717. * using a mapper function.
  1718. *
  1719. * @define DIRECTINPUT_REGSTR_KEY_LASTMAPAPP | "MostRecentMapperApplication" |
  1720. *
  1721. * Registry key under the key opened by
  1722. * <mf IDirectInputJoyConfig::OpenAppStatusKey> containing
  1723. * information about the most recent mapper application to run.
  1724. *
  1725. * @define DIRECTINPUT_REGSTR_VAL_VERSION | "Version" |
  1726. *
  1727. * Registry value under one of the subkeys of the key opened by
  1728. * <mf IDirectInputJoyConfig::OpenAppStatusKey>. The REG_BINARY
  1729. * value is the DWORD DIRECTINPUT_VERSION passed by the application
  1730. * to initialize DirectInput.
  1731. *
  1732. * @define DIRECTINPUT_REGSTR_VAL_NAME | "Name" |
  1733. *
  1734. * Registry value under one of the subkeys of the key opened by
  1735. * <mf IDirectInputJoyConfig::OpenAppStatusKey>. The REG_SZ value
  1736. * is the application filename in upper case.
  1737. *
  1738. * @define DIRECTINPUT_REGSTR_VAL_ID | "Id" |
  1739. *
  1740. * Registry value under either <c DIRECTINPUT_REGSTR_KEY_LASTMAPAPP>
  1741. * or <c DIRECTINPUT_REGSTR_KEY_LASTAPP> subkeys of the key opened by
  1742. * <mf IDirectInputJoyConfig::OpenAppStatusKey>. The REG_SZ value
  1743. * is the application id value. For DirectX 8 applications, this is
  1744. * also the key name of a sibling key specific to this application.
  1745. *
  1746. * @define DIRECTINPUT_REGSTR_VAL_MAPPER | "UsesMapper" |
  1747. *
  1748. * Registry value under one of DirectX 8 application subkeys of the
  1749. * key opened by <mf IDirectInputJoyConfig::OpenAppStatusKey>. The
  1750. * REG_BINARY value a DWORD with value 0 if the application has not
  1751. * used mapper functionality or 1 if it has.
  1752. *
  1753. * @define DIRECTINPUT_REGSTR_VAL_LASTSTART | "MostRecentStart" |
  1754. *
  1755. * Registry value under either <c DIRECTINPUT_REGSTR_KEY_LASTMAPAPP>
  1756. * or <c DIRECTINPUT_REGSTR_KEY_LASTAPP> subkeys of the key opened by
  1757. * <mf IDirectInputJoyConfig::OpenAppStatusKey>. The REG_BINARY
  1758. * value is a <t FILETIME> of the time the key contents were written.
  1759. *
  1760. ****************************************************************************/
  1761. enddoc
  1762. #define DIAPPIDFLAG_NOTIME 0x00000001
  1763. #define DIAPPIDFLAG_NOSIZE 0x00000002
  1764. #define DIRECTINPUT_REGSTR_VAL_APPIDFLAGA "AppIdFlag"
  1765. #define DIRECTINPUT_REGSTR_KEY_LASTAPPA "MostRecentApplication"
  1766. #define DIRECTINPUT_REGSTR_KEY_LASTMAPAPPA "MostRecentMapperApplication"
  1767. #define DIRECTINPUT_REGSTR_VAL_VERSIONA "Version"
  1768. #define DIRECTINPUT_REGSTR_VAL_NAMEA "Name"
  1769. #define DIRECTINPUT_REGSTR_VAL_IDA "Id"
  1770. #define DIRECTINPUT_REGSTR_VAL_MAPPERA "UsesMapper"
  1771. #define DIRECTINPUT_REGSTR_VAL_LASTSTARTA "MostRecentStart"
  1772. #define DIRECTINPUT_REGSTR_VAL_APPIDFLAGW L"AppIdFlag"
  1773. #define DIRECTINPUT_REGSTR_KEY_LASTAPPW L"MostRecentApplication"
  1774. #define DIRECTINPUT_REGSTR_KEY_LASTMAPAPPW L"MostRecentMapperApplication"
  1775. #define DIRECTINPUT_REGSTR_VAL_VERSIONW L"Version"
  1776. #define DIRECTINPUT_REGSTR_VAL_NAMEW L"Name"
  1777. #define DIRECTINPUT_REGSTR_VAL_IDW L"Id"
  1778. #define DIRECTINPUT_REGSTR_VAL_MAPPERW L"UsesMapper"
  1779. #define DIRECTINPUT_REGSTR_VAL_LASTSTARTW L"MostRecentStart"
  1780. #ifdef UNICODE
  1781. #define DIRECTINPUT_REGSTR_VAL_APPIDFLAG DIRECTINPUT_REGSTR_VAL_APPIDFLAGW
  1782. #define DIRECTINPUT_REGSTR_KEY_LASTAPP DIRECTINPUT_REGSTR_KEY_LASTAPPW
  1783. #define DIRECTINPUT_REGSTR_KEY_LASTMAPAPP DIRECTINPUT_REGSTR_KEY_LASTMAPAPPW
  1784. #define DIRECTINPUT_REGSTR_VAL_VERSION DIRECTINPUT_REGSTR_VAL_VERSIONW
  1785. #define DIRECTINPUT_REGSTR_VAL_NAME DIRECTINPUT_REGSTR_VAL_NAMEW
  1786. #define DIRECTINPUT_REGSTR_VAL_ID DIRECTINPUT_REGSTR_VAL_IDW
  1787. #define DIRECTINPUT_REGSTR_VAL_MAPPER DIRECTINPUT_REGSTR_VAL_MAPPERW
  1788. #define DIRECTINPUT_REGSTR_VAL_LASTSTART DIRECTINPUT_REGSTR_VAL_LASTSTARTW
  1789. #else
  1790. #define DIRECTINPUT_REGSTR_VAL_APPIDFLAG DIRECTINPUT_REGSTR_VAL_APPIDFLAGA
  1791. #define DIRECTINPUT_REGSTR_KEY_LASTAPP DIRECTINPUT_REGSTR_KEY_LASTAPPA
  1792. #define DIRECTINPUT_REGSTR_KEY_LASTMAPAPP DIRECTINPUT_REGSTR_KEY_LASTMAPAPPA
  1793. #define DIRECTINPUT_REGSTR_VAL_VERSION DIRECTINPUT_REGSTR_VAL_VERSIONA
  1794. #define DIRECTINPUT_REGSTR_VAL_NAME DIRECTINPUT_REGSTR_VAL_NAMEA
  1795. #define DIRECTINPUT_REGSTR_VAL_ID DIRECTINPUT_REGSTR_VAL_IDA
  1796. #define DIRECTINPUT_REGSTR_VAL_MAPPER DIRECTINPUT_REGSTR_VAL_MAPPERA
  1797. #define DIRECTINPUT_REGSTR_VAL_LASTSTART DIRECTINPUT_REGSTR_VAL_LASTSTARTA
  1798. #endif
  1799. ;begin_internal_dx7
  1800. /*
  1801. * Because the registry strings are new to DX8, we need to duplicate them
  1802. * for internal use in the DX8 version of DI7. (Yuck)
  1803. */
  1804. #define DIRECTINPUT_REGSTR_KEY_LASTAPP TEXT("MostRecentApplication")
  1805. #define DIRECTINPUT_REGSTR_KEY_LASTMAPAPP TEXT("MostRecentMapperApplication")
  1806. #define DIRECTINPUT_REGSTR_VAL_VERSION TEXT("Version")
  1807. #define DIRECTINPUT_REGSTR_VAL_NAME TEXT("Name")
  1808. #define DIRECTINPUT_REGSTR_VAL_ID TEXT("Id")
  1809. #define DIRECTINPUT_REGSTR_VAL_MAPPER TEXT("UsesMapper")
  1810. #define DIRECTINPUT_REGSTR_VAL_LASTSTART TEXT("MostRecentStart")
  1811. ;end_internal_dx7
  1812. /****************************************************************************
  1813. *
  1814. * Return Codes
  1815. *
  1816. ****************************************************************************/
  1817. #define DIERR_NOMOREITEMS \
  1818. MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_NO_MORE_ITEMS)
  1819. /*
  1820. * Device driver-specific codes.
  1821. */
  1822. #define DIERR_DRIVERFIRST 0x80040300L
  1823. #define DIERR_DRIVERLAST 0x800403FFL
  1824. /*
  1825. * Unless the specific driver has been precisely identified, no meaning
  1826. * should be attributed to these values other than that the driver
  1827. * originated the error. However, to illustrate the types of error that
  1828. * may be causing the failure, the PID force feedback driver distributed
  1829. * with DirectX 7 could return the following errors:
  1830. *
  1831. * DIERR_DRIVERFIRST + 1
  1832. * The requested usage was not found.
  1833. * DIERR_DRIVERFIRST + 2
  1834. * The parameter block couldn't be downloaded to the device.
  1835. * DIERR_DRIVERFIRST + 3
  1836. * PID initialization failed.
  1837. * DIERR_DRIVERFIRST + 4
  1838. * The provided values couldn't be scaled.
  1839. */
  1840. /*
  1841. * Device installer errors.
  1842. */
  1843. /*
  1844. * Registry entry or DLL for class installer invalid
  1845. * or class installer not found.
  1846. */
  1847. #define DIERR_INVALIDCLASSINSTALLER 0x80040400L
  1848. /*
  1849. * The user cancelled the install operation.
  1850. */
  1851. #define DIERR_CANCELLED 0x80040401L
  1852. /*
  1853. * The INF file for the selected device could not be
  1854. * found or is invalid or is damaged.
  1855. */
  1856. #define DIERR_BADINF 0x80040402L
  1857. begindoc
  1858. /****************************************************************************
  1859. *
  1860. * @doc DDK
  1861. *
  1862. * @define DIDIFT_DELETE | 0x01000000 |
  1863. *
  1864. * Flag in <e DIDEVICEIMAGEINFO.dwFlags> used by vendor
  1865. * to delete particular image data from default map file.
  1866. *
  1867. ****************************************************************************/
  1868. enddoc
  1869. /****************************************************************************
  1870. *
  1871. * Map files
  1872. *
  1873. ****************************************************************************/
  1874. /*
  1875. * Delete particular data from default map file.
  1876. */
  1877. #define DIDIFT_DELETE 0x01000000
  1878. #ifdef __cplusplus
  1879. };
  1880. #endif
  1881. #endif /* __DINPUTD_INCLUDED__ */
  1882. 
  1883.