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.

831 lines
25 KiB

  1. /*****************************************************************************
  2. *
  3. * DIDev.h
  4. *
  5. * Copyright (c) 1996-1997 Microsoft Corporation. All Rights Reserved.
  6. *
  7. * Abstract:
  8. *
  9. * Common header file for IDirectInputDevice implementation.
  10. *
  11. * The original didev.c file was getting too big, so the
  12. * stuff that supports IDirectInputEffect has been split out
  13. * into didevef.c. Since both files need to access the
  14. * internal structure of an IDirectInputDevice, we need this
  15. * common header file.
  16. *
  17. *****************************************************************************/
  18. /*****************************************************************************
  19. *
  20. * The sqiffle for this file.
  21. *
  22. *****************************************************************************/
  23. #define sqfl sqflDev
  24. /*****************************************************************************
  25. *
  26. * Declare the interfaces we will be providing.
  27. *
  28. *****************************************************************************/
  29. #define ThisClass CDIDev
  30. #define ThisInterface TFORM(IDirectInputDevice8)
  31. #define ThisInterfaceA IDirectInputDevice8A
  32. #define ThisInterfaceW IDirectInputDevice8W
  33. #define ThisInterfaceT IDirectInputDevice8
  34. Primary_Interface(CDIDev, TFORM(ThisInterfaceT));
  35. Secondary_Interface(CDIDev, SFORM(ThisInterfaceT));
  36. /*****************************************************************************
  37. *
  38. * @doc INTERNAL
  39. *
  40. * @enum DIOPT |
  41. *
  42. * Device data format optimization levels.
  43. *
  44. * @emem dioptNone |
  45. *
  46. * Device data format is not optimized at all. We must read
  47. * the device data into a private buffer and copy each field
  48. * into the application buffer.
  49. *
  50. * @emem dioptMatch |
  51. *
  52. * Application data format matches the device data format
  53. * in the places where the application requests data at all.
  54. * We can read the device data into a private buffer, then
  55. * block copy the data into the application buffer.
  56. *
  57. *
  58. * @emem dioptDirect |
  59. *
  60. * <e DIOPT.dioptMatch>, plus the entire device data
  61. * format fits inside the application format.
  62. * We can read the device data directly into the application
  63. * buffer.
  64. *
  65. * @emem dioptEqual |
  66. *
  67. * <e DIOPT.dioptDirect>, plus the device data format
  68. * and application data formats are completely equal
  69. * (except for fields that the app doesn't explicitly
  70. * ask for).
  71. * We can issue buffered reads directly into the application
  72. * buffer.
  73. *
  74. *****************************************************************************/
  75. typedef enum DIOPT
  76. {
  77. dioptNone = 0,
  78. dioptMatch = 1,
  79. dioptDirect = 2,
  80. dioptEqual = 3,
  81. } DIOPT;
  82. /*****************************************************************************
  83. *
  84. * @doc INTERNAL
  85. *
  86. * @struct CDIDev |
  87. *
  88. * The generic <i IDirectInputDevice> object.
  89. *
  90. * The A and W versions are simply alternate interfaces on the same
  91. * underlying object.
  92. *
  93. * @field IDirectInputDeviceA | ddA |
  94. *
  95. * ANSI DirectInputDevice object (containing vtbl).
  96. *
  97. * @field IDirectInputDeviceW | ddW |
  98. *
  99. * UNICODE DirectInputDevice object (containing vtbl).
  100. *
  101. * @field IDirectInputDeviceCallback * | pdcb |
  102. *
  103. * Callback object which handles the low-level device access.
  104. *
  105. * @field BOOL | fAcquired:1 |
  106. *
  107. * Set if the device has been acquired. Before the device
  108. * can be acquired, the <e CDIDev.pdix> must be set.
  109. *
  110. * @field BOOL | fAcquiredInstance:1 |
  111. *
  112. * Set if the device instance has been acquired by us.
  113. * This lets us know how much needs to be done on the
  114. * unacquire.
  115. *
  116. * @field BOOL | fCritInited:1 |
  117. *
  118. * Set if the critical section has been initialized.
  119. *
  120. * @field BOOL | fCook:1 |
  121. *
  122. * Set if the device requires that data be cooked.
  123. *
  124. * @field BOOL | fPolledDataFormat:1 |
  125. *
  126. * Set if the device's data format requires explicit polling.
  127. *
  128. * @field BOOL | fOnceAcquired:1 |
  129. *
  130. * Set once the device is acquired.
  131. *
  132. * @field BOOL | fOnceForcedUnacquired:1 |
  133. *
  134. * Set once the device is forced unacquired.
  135. *
  136. * @field BOOL | fUnacqiredWhenIconic:1 |
  137. *
  138. * Set once the device is unacquired (in CDIDev_CallWndProc) when the app is minimized.
  139. *
  140. * @field HWND | hwnd |
  141. *
  142. * Window that has requested exclusive access when acquired.
  143. *
  144. * @field DWORD | discl |
  145. *
  146. * Current value of
  147. * <mf IDirectInputDevice8::SetCooperativeLevel> flags.
  148. *
  149. * @field HANDLE | hNotify |
  150. *
  151. * The notification handle that should be set when the
  152. * state of the device changes. Note that this is actually
  153. * a copy of the original handle supplied by the application,
  154. * so the handle should be closed when no longer needed.
  155. *
  156. * @field FARPROC | GetState |
  157. *
  158. * Function that transfers the device data in response
  159. * to <mf IDirectInputDevice8::GetDeviceState>. This field
  160. * is computed when the data format is set.
  161. *
  162. * @field PDIXLAT | pdix |
  163. *
  164. * Pointer to table used for data format translation.
  165. * It is indexed by device object; the dwOfs value is the location
  166. * in the application data format where the data should be stored,
  167. * the uAppData is the application specified data associated with
  168. * the object.
  169. *
  170. * For example, if the object described by <e CDIDev.df.rgodf[3]>
  171. * should be placed at offset 8 in the application data format,
  172. * then <e CDIDev.pdix[3].dwOfs> = 8.
  173. *
  174. *
  175. * @field PING | rgiobj |
  176. *
  177. * The inverse of <e CDIDev.pdix.dwOfs>. Given an offset,
  178. * converts it to the device object index.
  179. *
  180. * For example, if the object described by <e CDIDev.df.rgodf[3]>
  181. * should be placed at offset 8 in the application data format,
  182. * then <e CDIDev.rgiobj[8]> = 3.
  183. * Entries for invalid offsets are -1.
  184. *
  185. * @field DWORD | dwDataSize |
  186. *
  187. * Size of the data, as requested by the application.
  188. *
  189. * @field DIDATAFORMAT | df |
  190. *
  191. * Device data format.
  192. *
  193. * @field DIOPT | diopt |
  194. *
  195. * Device optimization level.
  196. *
  197. * @field int | ibDelta |
  198. *
  199. * If <e CDIDev.diopt> is at least <e DIOPT.dioptMatch>,
  200. * contains the shift necessary in order to align the
  201. * application data format with the device data format.
  202. *
  203. * @field int | ibMin |
  204. *
  205. * If <e CDIDev.diopt> is at least <e DIOPT.dioptMatch>,
  206. * contains the offset of the first field in the device
  207. * format which is valid in both the application and
  208. * device data formats.
  209. *
  210. * @field DWORD | cbMatch |
  211. *
  212. * If <e CDIDev.diopt> is at least <e DIOPT.dioptMatch>,
  213. * contains the number of bytes which matched. This is the
  214. * number of bytes that can be block-copied.
  215. *
  216. * @field PV | pvBuffer |
  217. *
  218. * if <e CDIDev.diopt> is <e DIOPT.dioptMatch> or less,
  219. * then contains a scratch buffer equal in size to the
  220. * device data format which is used when an unoptimized
  221. * data format has been selected.
  222. *
  223. * @field PV | pvLastBuffer |
  224. *
  225. * Last instantaneous device state received. This is used
  226. * to emulate relative axes. Only the axis fields of the
  227. * structure are valid.
  228. *
  229. * @field PVXDINSTANCE | pvi |
  230. *
  231. * Instance handle for talking to the VxD.
  232. *
  233. * @field DWORD | cAxes |
  234. *
  235. * Number of axes on the device. This in turn yields the
  236. * size of the axis offset table.
  237. *
  238. * @field LPDWORD | rgdwAxesOfs |
  239. *
  240. * Axis offset table. This is used during relative axis
  241. * acquisition mode to convert the absolute numbers into
  242. * relative numbers.
  243. *
  244. * @field HRESULT | hresPolled |
  245. *
  246. * <c S_OK> if the device is interrupt-driven.
  247. * <c DI_POLLEDDEVICE> if the device is polled.
  248. *
  249. * @field HRESULT | hresNotAcquired |
  250. *
  251. * <c DIERR_INPUTLOST> if the device was unacquired without
  252. * the application's consent. <c DIERR_NOTACQUIRED> if
  253. * the application should have known better.
  254. *
  255. * @field DWORD | celtBuf |
  256. *
  257. * Size of the device buffer.
  258. *
  259. * @field DWORD | celtBufMax |
  260. *
  261. * The largest buffer size we will permit. There is
  262. * a secret property that lets you increase the value,
  263. * in case an ISV comes up with a good reason for having
  264. * a larger buffer.
  265. *
  266. * @field LPDWORD | rgdwPOV |
  267. *
  268. * An array of DWORDs listing the locations (data offsets)
  269. * of all the optional POVs that were in the app's requested
  270. * data format and which we were unable to satisfy. We
  271. * need this so we can set them to -1 in the device state
  272. * because most apps are lazy and don't check if the object
  273. * actually exists before reading from it. To keep them safe,
  274. * we normally return zeros in nonexistent objects, but for
  275. * POVs, the "safe" value is -1, not zero.
  276. *
  277. * @field DWORD | cdwPOV |
  278. *
  279. * Number of failed optional POVs in the <e CDIDev.rgdwPOV> array.
  280. *
  281. *
  282. * @field LPDIRECTINPUTEFFECTSHEPHERD | pes |
  283. *
  284. * The <i IDirectInputEffectShepherd>
  285. * object which does the
  286. * low-level goo related to the force feedback part of the device.
  287. *
  288. * @field SHEPHANDLE | sh |
  289. *
  290. * The joystick "tag" which is used by dieshep.c
  291. * to determine who owns the joystick.
  292. * The <e SHEPHANDLE.dwEffect> field is permanently
  293. * zero, so that we can pass it to
  294. * <mf IDirectInputEffectShepherd::Escape>
  295. * to perform a device escape.
  296. *
  297. * @field DWORD | dwVersion |
  298. *
  299. * Version number of DirectInput we are emulating.
  300. *
  301. * @field GPA | gpaEff |
  302. *
  303. * Pointer array of (held) <i IDirectInputEffect> objects
  304. * that have been created for this device.
  305. *
  306. * @field PEFFECTMAPINFO | rgemi |
  307. *
  308. * Array of <t EFFECTMAPINFO> structures, one for each
  309. * effect supported by the device.
  310. *
  311. * @field UINT | cemi |
  312. *
  313. * Number of elements in the <e CDIDev.rgemi> array.
  314. *
  315. * @field DWORD | didcFF |
  316. *
  317. * Cached device capability flags related to force-feedback.
  318. *
  319. * @field DIFFDEVICEATTRIBUTES | ffattr |
  320. *
  321. * Contains force feedback device attributes.
  322. *
  323. * @field DWORD | dwGain |
  324. *
  325. * The gain setting for the device.
  326. *
  327. * @field DWORD | dwAutoCenter |
  328. *
  329. * The autocenter setting for the device.
  330. *
  331. * @field BOOL | fNotifiedNotBuffered:1 |
  332. *
  333. * Used only in XDEBUG to remember whether we
  334. * notified the caller that the device isn't buffered.
  335. *
  336. * @field LONG | cCrit |
  337. *
  338. * Number of times the critical section has been taken.
  339. * Used only in XDEBUG to check whether the caller is
  340. * releasing the object while another method is using it.
  341. *
  342. * @field DWORD | thidCrit |
  343. *
  344. * The thread that is currently in the critical section.
  345. * Used only in DEBUG for internal consistency checking.
  346. *
  347. * @field CRITICAL_SECTION | crst |
  348. *
  349. * Object critical section. Must be taken when accessing
  350. * volatile member variables.
  351. *
  352. * @field GUID | guid |
  353. *
  354. * The instance GUID of the device we are.
  355. *
  356. *****************************************************************************/
  357. typedef struct DIXLAT
  358. {
  359. DWORD dwOfs;
  360. UINT_PTR uAppData;
  361. } DIXLAT, *PDIXLAT;
  362. typedef struct CDIDev
  363. {
  364. /* Supported interfaces */
  365. TFORM(IDirectInputDevice) TFORM(dd);
  366. SFORM(IDirectInputDevice) SFORM(dd);
  367. /*
  368. * All interfaces currently have vtbls that are unmodified supersets of
  369. * all previous versions of the interface, so we use the latest interface
  370. * for all versions and do not need to keep multiple interfaces.
  371. */
  372. IDirectInputDeviceCallback *pdcb;
  373. BOOL fAcquired:1;
  374. BOOL fAcquiredInstance:1;
  375. BOOL fCritInited:1;
  376. BOOL fCook:1;
  377. BOOL fPolledDataFormat:1;
  378. BOOL fOnceAcquired:1;
  379. BOOL fOnceForcedUnacquired:1;
  380. #ifdef WINNT
  381. BOOL fUnacquiredWhenIconic:1;
  382. #endif
  383. /* WARNING! EVERYTHING AFTER THIS LINE IS ZERO'd ON A RESET */
  384. HWND hwnd;
  385. DWORD discl;
  386. HANDLE hNotify;
  387. STDMETHOD(GetState)(struct CDIDev *, PV);
  388. STDMETHOD(GetDeviceState)(struct CDIDev *, PV);
  389. PDIXLAT pdix;
  390. PINT rgiobj;
  391. DWORD dwDataSize;
  392. DIDATAFORMAT df;
  393. DIOPT diopt;
  394. int ibDelta;
  395. int ibMin;
  396. DWORD cbMatch;
  397. PV pvBuffer;
  398. PV pvLastBuffer;
  399. PVXDINSTANCE pvi;
  400. PV pvData;
  401. DWORD cAxes;
  402. LPDWORD rgdwAxesOfs;
  403. HRESULT hresPolled;
  404. HRESULT hresNotAcquired;
  405. DWORD celtBuf;
  406. LPDWORD rgdwPOV;
  407. DWORD cdwPOV;
  408. PEFFECTMAPINFO rgemi;
  409. UINT cemi;
  410. DWORD didcFF;
  411. SHEPHANDLE sh;
  412. DIFFDEVICEATTRIBUTES ffattr;
  413. DIDEVCAPS_DX3 dc3;
  414. /* WARNING! EVERYTHING ABOVE THIS LINE IS ZERO'd ON A RESET */
  415. DWORD celtBufMax; /* Must be first field after zero'd region */
  416. LPDIRECTINPUTEFFECTSHEPHERD pes;
  417. DWORD dwVersion;
  418. GPA gpaEff;
  419. DWORD dwGain;
  420. DWORD dwAutoCenter;
  421. RD(BOOL fNotifiedNotBuffered:1;)
  422. LONG cCrit;
  423. DWORD thidCrit;
  424. CRITICAL_SECTION crst;
  425. GUID guid; /* This is also zero'd on a reset */
  426. DIAPPHACKS diHacks;
  427. LPDIRECTINPUTMAPSHEPHERD pMS;
  428. } CDIDev, DD, *PDD;
  429. typedef IDirectInputDeviceA DDA, *PDDA;
  430. typedef IDirectInputDeviceW DDW, *PDDW;
  431. typedef DIDEVICEOBJECTDATA DOD, *PDOD;
  432. typedef LPCDIDEVICEOBJECTDATA PCDOD;
  433. /*****************************************************************************
  434. *
  435. * Methods that live outside didev.c
  436. *
  437. *****************************************************************************/
  438. /*****************************************************************************
  439. *
  440. * IDirectInputDevice8::SetDataFormat
  441. *
  442. *****************************************************************************/
  443. STDMETHODIMP
  444. CDIDev_SetDataFormat(PV pdd, LPCDIDATAFORMAT lpdf _THAT);
  445. #ifdef INCLUDED_BY_DIDEV
  446. #ifdef XDEBUG
  447. CSET_STUBS(SetDataFormat, (PV pdd, LPCDIDATAFORMAT lpdf), (pdd, lpdf THAT_))
  448. #else
  449. #define CDIDev_SetDataFormatA CDIDev_SetDataFormat
  450. #define CDIDev_SetDataFormatW CDIDev_SetDataFormat
  451. #endif
  452. #endif
  453. /*****************************************************************************
  454. *
  455. * IDirectInputDevice8::GetDeviceState
  456. *
  457. *****************************************************************************/
  458. STDMETHODIMP
  459. CDIDev_GetDeviceState(PV pdd, DWORD cbDataSize, LPVOID pvData _THAT);
  460. #ifdef INCLUDED_BY_DIDEV
  461. #ifdef XDEBUG
  462. CSET_STUBS(GetDeviceState, (PV pdd, DWORD cbDataSize, LPVOID pvData),
  463. (pdd, cbDataSize, pvData THAT_))
  464. #else
  465. #define CDIDev_GetDeviceStateA CDIDev_GetDeviceState
  466. #define CDIDev_GetDeviceStateW CDIDev_GetDeviceState
  467. #endif
  468. #endif
  469. /*****************************************************************************
  470. *
  471. * IDirectInputDevice8::GetDeviceData
  472. *
  473. *****************************************************************************/
  474. STDMETHODIMP
  475. CDIDev_GetDeviceData(PV pdd, DWORD cbdod, PDOD rgdod,
  476. LPDWORD pdwInOut, DWORD fl _THAT);
  477. #ifdef INCLUDED_BY_DIDEV
  478. #ifdef XDEBUG
  479. CSET_STUBS(GetDeviceData,
  480. (PV pdd, DWORD cbdod, PDOD rgdod, LPDWORD pdwInOut, DWORD fl),
  481. (pdd, cbdod, rgdod, pdwInOut, fl THAT_))
  482. #else
  483. #define CDIDev_GetDeviceDataA CDIDev_GetDeviceData
  484. #define CDIDev_GetDeviceDataW CDIDev_GetDeviceData
  485. #endif
  486. #endif
  487. /*****************************************************************************
  488. *
  489. * IDirectInputDevice8::CreateEffect
  490. *
  491. *****************************************************************************/
  492. STDMETHODIMP
  493. CDIDev_CreateEffect(PV pdd, REFGUID rguid, LPCDIEFFECT peff,
  494. LPDIRECTINPUTEFFECT *ppdeff, LPUNKNOWN punkOuter _THAT);
  495. #ifdef INCLUDED_BY_DIDEV
  496. #ifdef XDEBUG
  497. CSET_STUBS(CreateEffect, (PV pdd, REFGUID rguid, LPCDIEFFECT peff,
  498. LPDIRECTINPUTEFFECT *ppdeff, LPUNKNOWN punkOuter),
  499. (pdd, rguid, peff, ppdeff, punkOuter THAT_))
  500. #else
  501. #define CDIDev_CreateEffectA CDIDev_CreateEffect
  502. #define CDIDev_CreateEffectW CDIDev_CreateEffect
  503. #endif
  504. #endif
  505. /*****************************************************************************
  506. *
  507. * IDirectInputDevice8::EnumEffects
  508. *
  509. *****************************************************************************/
  510. STDMETHODIMP
  511. CDIDev_EnumEffectsW(PV pdd, LPDIENUMEFFECTSCALLBACKW pecW, PV pvRef, DWORD fl);
  512. STDMETHODIMP
  513. CDIDev_EnumEffectsA(PV pdd, LPDIENUMEFFECTSCALLBACKA pecA, PV pvRef, DWORD fl);
  514. /*****************************************************************************
  515. *
  516. * IDirectInputDevice8::GetEffectInfo
  517. *
  518. *****************************************************************************/
  519. STDMETHODIMP
  520. CDIDev_GetEffectInfoW(PV pddW, LPDIEFFECTINFOW peiW, REFGUID rguid);
  521. STDMETHODIMP
  522. CDIDev_GetEffectInfoA(PV pddA, LPDIEFFECTINFOA peiA, REFGUID rguid);
  523. /*****************************************************************************
  524. *
  525. * IDirectInputDevice8::GetForceFeedbackState
  526. *
  527. *****************************************************************************/
  528. STDMETHODIMP
  529. CDIDev_GetForceFeedbackState(PV pdd, LPDWORD pdwOut _THAT);
  530. #ifdef INCLUDED_BY_DIDEV
  531. #ifdef XDEBUG
  532. CSET_STUBS(GetForceFeedbackState, (PV pdd, LPDWORD pdwOut),
  533. (pdd, pdwOut THAT_))
  534. #else
  535. #define CDIDev_GetForceFeedbackStateA CDIDev_GetForceFeedbackState
  536. #define CDIDev_GetForceFeedbackStateW CDIDev_GetForceFeedbackState
  537. #endif
  538. #endif
  539. /*****************************************************************************
  540. *
  541. * IDirectInputDevice8::SendForceFeedbackCommand
  542. *
  543. *****************************************************************************/
  544. STDMETHODIMP
  545. CDIDev_SendForceFeedbackCommand(PV pdd, DWORD dwCmd _THAT);
  546. #ifdef INCLUDED_BY_DIDEV
  547. #ifdef XDEBUG
  548. CSET_STUBS(SendForceFeedbackCommand, (PV pdd, DWORD dwCmd),
  549. (pdd, dwCmd THAT_))
  550. #else
  551. #define CDIDev_SendForceFeedbackCommandA CDIDev_SendForceFeedbackCommand
  552. #define CDIDev_SendForceFeedbackCommandW CDIDev_SendForceFeedbackCommand
  553. #endif
  554. #endif
  555. /*****************************************************************************
  556. *
  557. * IDirectInputDevice8::EnumCreatedEffects
  558. *
  559. *****************************************************************************/
  560. STDMETHODIMP
  561. CDIDev_EnumCreatedEffectObjects(PV pdd,
  562. LPDIENUMCREATEDEFFECTOBJECTSCALLBACK pec,
  563. LPVOID pvRef, DWORD dwFlags _THAT);
  564. #ifdef INCLUDED_BY_DIDEV
  565. #ifdef XDEBUG
  566. CSET_STUBS(EnumCreatedEffectObjects, (PV pdd,
  567. LPDIENUMCREATEDEFFECTOBJECTSCALLBACK pec,
  568. LPVOID pvRef, DWORD dwFlags),
  569. (pdd, pec, pvRef, dwFlags THAT_))
  570. #else
  571. #define CDIDev_EnumCreatedEffectObjectsA CDIDev_EnumCreatedEffectObjects
  572. #define CDIDev_EnumCreatedEffectObjectsW CDIDev_EnumCreatedEffectObjects
  573. #endif
  574. #endif
  575. /*****************************************************************************
  576. *
  577. * IDirectInputDevice8::Escape
  578. *
  579. *****************************************************************************/
  580. STDMETHODIMP
  581. CDIDev_Escape(PV pdd, LPDIEFFESCAPE pesc _THAT);
  582. #ifdef INCLUDED_BY_DIDEV
  583. #ifdef XDEBUG
  584. CSET_STUBS(Escape, (PV pdd, LPDIEFFESCAPE pesc), (pdd, pesc THAT_))
  585. #else
  586. #define CDIDev_EscapeA CDIDev_Escape
  587. #define CDIDev_EscapeW CDIDev_Escape
  588. #endif
  589. #endif
  590. /*****************************************************************************
  591. *
  592. * IDirectInputDevice8::Poll
  593. *
  594. *****************************************************************************/
  595. STDMETHODIMP
  596. CDIDev_Poll(PV pdd _THAT);
  597. #ifdef INCLUDED_BY_DIDEV
  598. #ifdef XDEBUG
  599. CSET_STUBS(Poll, (PV pdd), (pdd THAT_))
  600. #else
  601. #define CDIDev_PollA CDIDev_Poll
  602. #define CDIDev_PollW CDIDev_Poll
  603. #endif
  604. #endif
  605. /*****************************************************************************
  606. *
  607. * IDirectInputDevice8::SendDeviceData
  608. *
  609. *****************************************************************************/
  610. STDMETHODIMP
  611. CDIDev_SendDeviceData(PV pdd, DWORD cbdod, LPCDIDEVICEOBJECTDATA rgdod,
  612. LPDWORD pdwInOut, DWORD fl _THAT);
  613. #ifdef INCLUDED_BY_DIDEV
  614. #ifdef XDEBUG
  615. CSET_STUBS(SendDeviceData,
  616. (PV pdd, DWORD cbdod, LPCDIDEVICEOBJECTDATA rgdod, LPDWORD pdwInOut, DWORD fl),
  617. (pdd, cbdod, rgdod, pdwInOut, fl THAT_))
  618. #else
  619. #define CDIDev_SendDeviceDataA CDIDev_SendDeviceData
  620. #define CDIDev_SendDeviceDataW CDIDev_SendDeviceData
  621. #endif
  622. #endif
  623. /*****************************************************************************
  624. *
  625. * IDirectInputDevice8::CDIDev_BuildActionMap
  626. *
  627. *****************************************************************************/
  628. STDMETHODIMP
  629. CDIDev_BuildActionMapW( PV pdd, LPDIACTIONFORMATW pAFW, LPCWSTR wszName, DWORD fl);
  630. STDMETHODIMP
  631. CDIDev_BuildActionMapA( PV pdd, LPDIACTIONFORMATA pAFA, LPCSTR szName, DWORD fl);
  632. /*****************************************************************************
  633. *
  634. * IDirectInputDevice8::CDIDev_SetActionMap
  635. *
  636. *****************************************************************************/
  637. STDMETHODIMP
  638. CDIDev_SetActionMapW( PV pdd, LPDIACTIONFORMATW pAFW, LPCWSTR wszName, DWORD fl);
  639. STDMETHODIMP
  640. CDIDev_SetActionMapA( PV pdd, LPDIACTIONFORMATA pAFA, LPCSTR szName, DWORD fl);
  641. /*****************************************************************************
  642. *
  643. * IDirectInputDevice8::CDIDev_GetImageInfo
  644. *
  645. *****************************************************************************/
  646. STDMETHODIMP
  647. CDIDev_GetImageInfoW( PV pdd, LPDIDEVICEIMAGEINFOHEADERW piih);
  648. STDMETHODIMP
  649. CDIDev_GetImageInfoA( PV pdd, LPDIDEVICEIMAGEINFOHEADERA piih);
  650. /*****************************************************************************
  651. *
  652. * Methods in didev.c needed in supporting files
  653. *
  654. *****************************************************************************/
  655. /*****************************************************************************
  656. *
  657. * IDirectInputDevice8::GetProperty
  658. *
  659. *****************************************************************************/
  660. STDMETHODIMP
  661. CDIDev_GetProperty(PV pdd, REFGUID rguid, LPDIPROPHEADER pdiph _THAT);
  662. #ifdef XDEBUG
  663. STDMETHODIMP
  664. CDIDev_GetPropertyA(PV pdd, REFGUID rguid, LPDIPROPHEADER pdiph);
  665. STDMETHODIMP
  666. CDIDev_GetPropertyW(PV pdd, REFGUID rguid, LPDIPROPHEADER pdiph);
  667. #else
  668. #define CDIDev_GetPropertyA CDIDev_GetProperty
  669. #define CDIDev_GetPropertyW CDIDev_GetProperty
  670. #endif
  671. /*****************************************************************************
  672. *
  673. * More internal worker functions.
  674. *
  675. * IsConsists is used for assertion checking.
  676. *
  677. * Finalize calls Unacquire to clean up in the case where the
  678. * caller forgot.
  679. *
  680. * Similarly, Reset needs to reset the GetDeviceState pointer.
  681. *
  682. * SetDataFormat needs to set the axis mode property.
  683. *
  684. * CDIDev_InitFF is used by CDIDev_Initialize to initialize
  685. * the force-feedback portion of the device.
  686. *
  687. *****************************************************************************/
  688. #ifdef DEBUG
  689. BOOL INTERNAL CDIDev_IsConsistent(PDD this);
  690. #endif
  691. STDMETHODIMP CDIDev_InternalUnacquire(PV pdd);
  692. STDMETHODIMP CDIDev_GetAbsDeviceState(PDD this, LPVOID pvData);
  693. STDMETHODIMP CDIDev_GetRelDeviceState(PDD this, LPVOID pvData);
  694. STDMETHODIMP
  695. CDIDev_RealSetProperty(PDD this, REFGUID rguid, LPCDIPROPHEADER pdiph);
  696. STDMETHODIMP CDIDev_FFAcquire(PDD this);
  697. STDMETHODIMP CDIDev_InitFF(PDD this);
  698. STDMETHODIMP CDIDev_GetLoad(PDD this, LPDWORD pdw);
  699. STDMETHODIMP CDIDev_RefreshGain(PDD this);
  700. HRESULT INTERNAL CDIDev_CreateEffectDriver(PDD this);