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.

515 lines
25 KiB

  1. DEFINE_GUID(IID_IDirectInputDeviceCallback, 0x1DE12AA0,0xC9F5,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
  2. DEFINE_GUID(IID_IDirectInputEffectShepherd, 0x1DE12AA1,0xC9F5,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
  3. DEFINE_GUID(IID_IDirectInputMapShepherd, 0x6a3e3144,0x3eee,0x4aa5,0x95,0x87,0xe1,0x0a,0x21,0xfe,0xc7,0x71);
  4. DEFINE_GUID(IID_IDIActionFramework, 0xf4279160,0x608f,0x11d3,0x8f,0xb2,0x0, 0xc0,0x4f,0x8e,0xc6,0x27);
  5. DEFINE_GUID(CLSID_CDirectInputActionFramework, 0x9f34af20,0x6095,0x11d3,0x8f,0xb2,0x0, 0xc0,0x4f,0x8e,0xc6,0x27);
  6. /****************************************************************************
  7. *
  8. * IDirectInputEffectShepherd
  9. *
  10. * Special wrapper class which gates access to DirectInput
  11. * effect drivers.
  12. *
  13. ****************************************************************************/
  14. /****************************************************************************
  15. *
  16. * @doc INTERNAL
  17. *
  18. * @struct SHEPHANDLE |
  19. *
  20. * Information that shepherds an effect handle.
  21. *
  22. * @field DWORD | dwEffect |
  23. *
  24. * The effect handle itself, possibly invalid if the device
  25. * has since been reset.
  26. *
  27. * If the value is zero, then the effect has not
  28. * been downloaded.
  29. *
  30. * @field DWORD | dwTag |
  31. *
  32. * Reset counter tag for the effect. If this value is different
  33. * from the tag stored in shared memory, then it means that
  34. * the device has been reset in the interim and no longer
  35. * belongs to the caller.
  36. *
  37. ****************************************************************************/
  38. typedef struct SHEPHANDLE {
  39. DWORD dwEffect;
  40. DWORD dwTag;
  41. } SHEPHANDLE, *PSHEPHANDLE;
  42. #undef INTERFACE
  43. #define INTERFACE IDirectInputEffectShepherd
  44. DECLARE_INTERFACE_(IDirectInputEffectShepherd, IUnknown)
  45. {
  46. /*** IUnknown methods ***/
  47. STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE;
  48. STDMETHOD_(ULONG,AddRef)(THIS) PURE;
  49. STDMETHOD_(ULONG,Release)(THIS) PURE;
  50. /*** IDirectInputEffectShepherd methods ***/
  51. STDMETHOD(DeviceID)(THIS_ DWORD,DWORD,LPVOID) PURE;
  52. STDMETHOD(GetVersions)(THIS_ LPDIDRIVERVERSIONS) PURE;
  53. STDMETHOD(Escape)(THIS_ PSHEPHANDLE,LPDIEFFESCAPE) PURE;
  54. STDMETHOD(DeviceEscape)(THIS_ PSHEPHANDLE,LPDIEFFESCAPE) PURE;
  55. STDMETHOD(SetGain)(THIS_ PSHEPHANDLE,DWORD) PURE;
  56. STDMETHOD(SendForceFeedbackCommand)(THIS_ PSHEPHANDLE,DWORD) PURE;
  57. STDMETHOD(GetForceFeedbackState)(THIS_ PSHEPHANDLE,LPDIDEVICESTATE) PURE;
  58. STDMETHOD(DownloadEffect)(THIS_ DWORD,PSHEPHANDLE,LPCDIEFFECT,DWORD) PURE;
  59. STDMETHOD(DestroyEffect)(THIS_ PSHEPHANDLE) PURE;
  60. STDMETHOD(StartEffect)(THIS_ PSHEPHANDLE,DWORD,DWORD) PURE;
  61. STDMETHOD(StopEffect)(THIS_ PSHEPHANDLE) PURE;
  62. STDMETHOD(GetEffectStatus)(THIS_ PSHEPHANDLE,LPDWORD) PURE;
  63. STDMETHOD(SetGlobalGain)(THIS_ DWORD) PURE;
  64. };
  65. typedef struct IDirectInputEffectShepherd *LPDIRECTINPUTEFFECTSHEPHERD;
  66. #if !defined(__cplusplus) || defined(CINTERFACE)
  67. #define IDirectInputEffectShepherd_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
  68. #define IDirectInputEffectShepherd_AddRef(p) (p)->lpVtbl->AddRef(p)
  69. #define IDirectInputEffectShepherd_Release(p) (p)->lpVtbl->Release(p)
  70. #define IDirectInputEffectShepherd_DeviceID(p,a,b,c) (p)->lpVtbl->DeviceID(p,a,b,c)
  71. #define IDirectInputEffectShepherd_GetVersions(p,a) (p)->lpVtbl->GetVersions(p,a)
  72. #define IDirectInputEffectShepherd_Escape(p,a,b) (p)->lpVtbl->Escape(p,a,b)
  73. #define IDirectInputEffectShepherd_DeviceEscape(p,a,b) (p)->lpVtbl->DeviceEscape(p,a,b)
  74. #define IDirectInputEffectShepherd_SetGain(p,a,b) (p)->lpVtbl->SetGain(p,a,b)
  75. #define IDirectInputEffectShepherd_SendForceFeedbackCommand(p,a,b) (p)->lpVtbl->SendForceFeedbackCommand(p,a,b)
  76. #define IDirectInputEffectShepherd_GetForceFeedbackState(p,a,b) (p)->lpVtbl->GetForceFeedbackState(p,a,b)
  77. #define IDirectInputEffectShepherd_DownloadEffect(p,a,b,c,d) (p)->lpVtbl->DownloadEffect(p,a,b,c,d)
  78. #define IDirectInputEffectShepherd_DestroyEffect(p,a) (p)->lpVtbl->DestroyEffect(p,a)
  79. #define IDirectInputEffectShepherd_StartEffect(p,a,b,c) (p)->lpVtbl->StartEffect(p,a,b,c)
  80. #define IDirectInputEffectShepherd_StopEffect(p,a) (p)->lpVtbl->StopEffect(p,a)
  81. #define IDirectInputEffectShepherd_GetEffectStatus(p,a,b) (p)->lpVtbl->GetEffectStatus(p,a,b)
  82. #define IDirectInputEffectShepherd_SetGlobalGain(p,a) (p)->lpVtbl->SetGlobalGain(p,a)
  83. #else
  84. #define IDirectInputEffectShepherd_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
  85. #define IDirectInputEffectShepherd_AddRef(p) (p)->AddRef()
  86. #define IDirectInputEffectShepherd_Release(p) (p)->Release()
  87. #define IDirectInputEffectShepherd_DeviceID(p,a,b,c) (p)->DeviceID(a,b,c)
  88. #define IDirectInputEffectShepherd_GetVersions(p,a) (p)->GetVersions(a)
  89. #define IDirectInputEffectShepherd_Escape(p,a,b) (p)->Escape(a,b)
  90. #define IDirectInputEffectShepherd_DeviceEscape(p,a,b) (p)->DeviceEscape(a,b)
  91. #define IDirectInputEffectShepherd_SetGain(p,a,b) (p)->SetGain(a,b)
  92. #define IDirectInputEffectShepherd_SendForceFeedbackCommand(p,a,b) (p)->SendForceFeedbackCommand(a,b)
  93. #define IDirectInputEffectShepherd_GetForceFeedbackState(p,a,b) (p)->GetForceFeedbackState(a,b)
  94. #define IDirectInputEffectShepherd_DownloadEffect(p,a,b,c,d) (p)->DownloadEffect(a,b,c,d)
  95. #define IDirectInputEffectShepherd_DestroyEffect(p,a) (p)->DestroyEffect(a)
  96. #define IDirectInputEffectShepherd_StartEffect(p,a,b,c) (p)->StartEffect(a,b,c)
  97. #define IDirectInputEffectShepherd_StopEffect(p,a) (p)->StopEffect(a)
  98. #define IDirectInputEffectShepherd_GetEffectStatus(p,a,b) (p)->GetEffectStatus(a,b)
  99. #define IDirectInputEffectShepherd_SetGlobalGain(p,a) (p)->SetGlobalGain(a)
  100. #endif
  101. /****************************************************************************
  102. *
  103. * IDirectInputMapShepherd
  104. *
  105. * Special wrapper class which gates access to DirectInput mapper.
  106. *
  107. ****************************************************************************/
  108. #if(DIRECTINPUT_VERSION >= 0x0800)
  109. #undef INTERFACE
  110. #define INTERFACE IDirectInputMapShepherd
  111. DECLARE_INTERFACE_(IDirectInputMapShepherd, IUnknown)
  112. {
  113. /*** IUnknown methods ***/
  114. STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE;
  115. STDMETHOD_(ULONG,AddRef)(THIS) PURE;
  116. STDMETHOD_(ULONG,Release)(THIS) PURE;
  117. /*** IDirectInputMapShepherd methods ***/
  118. STDMETHOD(GetActionMap)(THIS_ REFGUID,LPCWSTR,LPDIACTIONFORMATW,LPCWSTR,LPFILETIME,DWORD) PURE;
  119. STDMETHOD(SaveActionMap)(THIS_ REFGUID,LPCWSTR,LPDIACTIONFORMATW,LPCWSTR,DWORD) PURE;
  120. STDMETHOD(GetImageInfo)(THIS_ REFGUID,LPCWSTR,LPDIDEVICEIMAGEINFOHEADERW) PURE;
  121. };
  122. typedef struct IDirectInputMapShepherd *LPDIRECTINPUTMAPSHEPHERD;
  123. #if !defined(__cplusplus) || defined(CINTERFACE)
  124. #define IDirectInputMapShepherd_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
  125. #define IDirectInputMapShepherd_AddRef(p) (p)->lpVtbl->AddRef(p)
  126. #define IDirectInputMapShepherd_Release(p) (p)->lpVtbl->Release(p)
  127. #define IDirectInputMapShepherd_GetActionMap(p,a,b,c,d,e,f) (p)->lpVtbl->GetActionMap(p,a,b,c,d,e,f)
  128. #define IDirectInputMapShepherd_SaveActionMap(p,a,b,c,d,e) (p)->lpVtbl->SaveActionMap(p,a,b,c,d,e)
  129. #define IDirectInputMapShepherd_GetImageInfo(p,a,b,c) (p)->lpVtbl->GetImageInfo(p,a,b,c)
  130. #else
  131. #define IDirectInputMapShepherd_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
  132. #define IDirectInputMapShepherd_AddRef(p) (p)->AddRef()
  133. #define IDirectInputMapShepherd_Release(p) (p)->Release()
  134. #define IDirectInputMapShepherd_GetActionMap(p,a,b,c,d,e,f) (p)->GetActionMap(a,b,c,d,e,f)
  135. #define IDirectInputMapShepherd_SaveActionMap(p,a,b,c,d,e) (p)->SaveActionMap(a,b,c,d,e)
  136. #define IDirectInputMapShepherd_GetImageInfo(p,a,b,c) (p)->GetImageInfo(a,b,c)
  137. #endif
  138. #endif /* DIRECTINPUT_VERSION >= 0x0800 */
  139. /****************************************************************************
  140. *
  141. * @doc INTERNAL
  142. *
  143. * @struct DIPROPINFO |
  144. *
  145. * Information used to describe an object being accessed.
  146. *
  147. * @field const GUID * | pguid |
  148. *
  149. * The property being accessed (if applicable).
  150. *
  151. * @field UINT | iobj |
  152. *
  153. * Zero-based index to object (or 0xFFFFFFFF if accessing the
  154. * device).
  155. *
  156. * @field DWORD | dwDevType |
  157. *
  158. * Device type information (or 0 if accessing the device).
  159. *
  160. ****************************************************************************/
  161. typedef struct DIPROPINFO {
  162. const GUID *pguid;
  163. UINT iobj;
  164. DWORD dwDevType;
  165. } DIPROPINFO, *LPDIPROPINFO;
  166. typedef const DIPROPINFO *LPCDIPROPINFO;
  167. #define DICOOK_DFOFSFROMOFSID(dwOfs, dwType) MAKELONG(dwOfs, dwType)
  168. #define DICOOK_IDFROMDFOFS(dwFakeOfs) HIWORD(dwFakeOfs)
  169. #define DICOOK_OFSFROMDFOFS(dwFakeOfs) LOWORD(dwFakeOfs)
  170. /****************************************************************************
  171. *
  172. * IDirectInputDeviceCallback
  173. *
  174. * IDirectInputDevice uses it to communicate with the
  175. * component that is responsible for collecting data from
  176. * the appropriate hardware device.
  177. *
  178. * E.g., mouse, keyboard, joystick, HID.
  179. *
  180. * Methods should return E_NOTIMPL for anything not understood.
  181. *
  182. ****************************************************************************/
  183. #if(DIRECTINPUT_VERSION >= 0x0800)
  184. #undef INTERFACE
  185. #define INTERFACE IDirectInputDeviceCallback
  186. DECLARE_INTERFACE_(IDirectInputDeviceCallback, IUnknown)
  187. {
  188. /*** IUnknown methods ***/
  189. STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE;
  190. STDMETHOD_(ULONG,AddRef)(THIS) PURE;
  191. STDMETHOD_(ULONG,Release)(THIS) PURE;
  192. /*** IDirectInputDeviceCallback methods ***/
  193. STDMETHOD(GetInstance)(THIS_ LPVOID *) PURE;
  194. STDMETHOD(GetVersions)(THIS_ LPDIDRIVERVERSIONS) PURE;
  195. STDMETHOD(GetDataFormat)(THIS_ LPDIDATAFORMAT *) PURE;
  196. STDMETHOD(GetObjectInfo)(THIS_ LPCDIPROPINFO,LPDIDEVICEOBJECTINSTANCEW) PURE;
  197. STDMETHOD(GetCapabilities)(THIS_ LPDIDEVCAPS) PURE;
  198. STDMETHOD(Acquire)(THIS) PURE;
  199. STDMETHOD(Unacquire)(THIS) PURE;
  200. STDMETHOD(GetDeviceState)(THIS_ LPVOID) PURE;
  201. STDMETHOD(GetDeviceInfo)(THIS_ LPDIDEVICEINSTANCEW) PURE;
  202. STDMETHOD(GetProperty)(THIS_ LPCDIPROPINFO,LPDIPROPHEADER) PURE;
  203. STDMETHOD(SetProperty)(THIS_ LPCDIPROPINFO,LPCDIPROPHEADER) PURE;
  204. STDMETHOD(SetEventNotification)(THIS_ HANDLE) PURE;
  205. STDMETHOD(SetCooperativeLevel)(THIS_ HWND,DWORD) PURE;
  206. STDMETHOD(RunControlPanel)(THIS_ HWND,DWORD) PURE;
  207. STDMETHOD(CookDeviceData)(THIS_ DWORD,LPDIDEVICEOBJECTDATA) PURE;
  208. STDMETHOD(CreateEffect)(THIS_ LPDIRECTINPUTEFFECTSHEPHERD *) PURE;
  209. STDMETHOD(GetFFConfigKey)(THIS_ DWORD,PHKEY) PURE;
  210. STDMETHOD(SendDeviceData)(THIS_ DWORD,LPCDIDEVICEOBJECTDATA,LPDWORD,DWORD) PURE;
  211. STDMETHOD(Poll)(THIS) PURE;
  212. STDMETHOD_(DWORD,GetUsage)(THIS_ int) PURE;
  213. STDMETHOD(MapUsage)(THIS_ DWORD,PINT) PURE;
  214. STDMETHOD(SetDIData)(THIS_ DWORD,LPVOID) PURE;
  215. STDMETHOD(BuildDefaultActionMap)(THIS_ LPDIACTIONFORMATW,DWORD,REFGUID) PURE;
  216. };
  217. typedef struct IDirectInputDeviceCallback *LPDIRECTINPUTDEVICECALLBACK;
  218. #if !defined(__cplusplus) || defined(CINTERFACE)
  219. #define IDirectInputDeviceCallback_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
  220. #define IDirectInputDeviceCallback_AddRef(p) (p)->lpVtbl->AddRef(p)
  221. #define IDirectInputDeviceCallback_Release(p) (p)->lpVtbl->Release(p)
  222. #define IDirectInputDeviceCallback_GetInstance(p,a) (p)->lpVtbl->GetInstance(p,a)
  223. #define IDirectInputDeviceCallback_GetVersions(p,a) (p)->lpVtbl->GetVersions(p,a)
  224. #define IDirectInputDeviceCallback_GetDataFormat(p,a) (p)->lpVtbl->GetDataFormat(p,a)
  225. #define IDirectInputDeviceCallback_GetObjectInfo(p,a,b) (p)->lpVtbl->GetObjectInfo(p,a,b)
  226. #define IDirectInputDeviceCallback_GetCapabilities(p,a) (p)->lpVtbl->GetCapabilities(p,a)
  227. #define IDirectInputDeviceCallback_Acquire(p) (p)->lpVtbl->Acquire(p)
  228. #define IDirectInputDeviceCallback_Unacquire(p) (p)->lpVtbl->Unacquire(p)
  229. #define IDirectInputDeviceCallback_GetDeviceState(p,a) (p)->lpVtbl->GetDeviceState(p,a)
  230. #define IDirectInputDeviceCallback_GetDeviceInfo(p,a) (p)->lpVtbl->GetDeviceInfo(p,a)
  231. #define IDirectInputDeviceCallback_GetProperty(p,a,b) (p)->lpVtbl->GetProperty(p,a,b)
  232. #define IDirectInputDeviceCallback_SetProperty(p,a,b) (p)->lpVtbl->SetProperty(p,a,b)
  233. #define IDirectInputDeviceCallback_SetEventNotification(p,a) (p)->lpVtbl->SetEventNotification(p,a)
  234. #define IDirectInputDeviceCallback_SetCooperativeLevel(p,a,b) (p)->lpVtbl->SetCooperativeLevel(p,a,b)
  235. #define IDirectInputDeviceCallback_RunControlPanel(p,a,b) (p)->lpVtbl->RunControlPanel(p,a,b)
  236. #define IDirectInputDeviceCallback_CookDeviceData(p,a,b) (p)->lpVtbl->CookDeviceData(p,a,b)
  237. #define IDirectInputDeviceCallback_CreateEffect(p,a) (p)->lpVtbl->CreateEffect(p,a)
  238. #define IDirectInputDeviceCallback_GetFFConfigKey(p,a,b) (p)->lpVtbl->GetFFConfigKey(p,a,b)
  239. #define IDirectInputDeviceCallback_SendDeviceData(p,a,b,c,d) (p)->lpVtbl->SendDeviceData(p,a,b,c,d)
  240. #define IDirectInputDeviceCallback_Poll(p) (p)->lpVtbl->Poll(p)
  241. #define IDirectInputDeviceCallback_GetUsage(p,a) (p)->lpVtbl->GetUsage(p,a)
  242. #define IDirectInputDeviceCallback_MapUsage(p,a,b) (p)->lpVtbl->MapUsage(p,a,b)
  243. #define IDirectInputDeviceCallback_SetDIData(p,a,b) (p)->lpVtbl->SetDIData(p,a,b)
  244. #define IDirectInputDeviceCallback_BuildDefaultActionMap(p,a,b,c) (p)->lpVtbl->BuildDefaultActionMap(p,a,b,c)
  245. #else
  246. #define IDirectInputDeviceCallback_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
  247. #define IDirectInputDeviceCallback_AddRef(p) (p)->AddRef()
  248. #define IDirectInputDeviceCallback_Release(p) (p)->Release()
  249. #define IDirectInputDeviceCallback_GetInstance(p,a) (p)->GetInstance(a)
  250. #define IDirectInputDeviceCallback_GetVersions(p,a) (p)->GetVersions(a)
  251. #define IDirectInputDeviceCallback_GetDataFormat(p,a) (p)->GetDataFormat(a)
  252. #define IDirectInputDeviceCallback_GetObjectInfo(p,a,b) (p)->GetObjectInfo(a,b)
  253. #define IDirectInputDeviceCallback_GetCapabilities(p,a) (p)->GetCapabilities(a)
  254. #define IDirectInputDeviceCallback_Acquire(p) (p)->Acquire()
  255. #define IDirectInputDeviceCallback_Unacquire(p) (p)->Unacquire()
  256. #define IDirectInputDeviceCallback_GetDeviceState(p,a) (p)->GetDeviceState(a)
  257. #define IDirectInputDeviceCallback_GetDeviceInfo(p,a) (p)->GetDeviceInfo(a)
  258. #define IDirectInputDeviceCallback_GetProperty(p,a,b) (p)->GetProperty(a,b)
  259. #define IDirectInputDeviceCallback_SetProperty(p,a,b) (p)->SetProperty(a,b)
  260. #define IDirectInputDeviceCallback_SetEventNotification(p,a) (p)->SetEventNotification(a)
  261. #define IDirectInputDeviceCallback_SetCooperativeLevel(p,a,b) (p)->SetCooperativeLevel(a,b)
  262. #define IDirectInputDeviceCallback_RunControlPanel(p,a,b) (p)->RunControlPanel(a,b)
  263. #define IDirectInputDeviceCallback_CookDeviceData(p,a,b) (p)->CookDeviceData(a,b)
  264. #define IDirectInputDeviceCallback_CreateEffect(p,a) (p)->CreateEffect(a)
  265. #define IDirectInputDeviceCallback_GetFFConfigKey(p,a,b) (p)->GetFFConfigKey(a,b)
  266. #define IDirectInputDeviceCallback_SendDeviceData(p,a,b,c,d) (p)->SendDeviceData(a,b,c,d)
  267. #define IDirectInputDeviceCallback_Poll(p) (p)->Poll()
  268. #define IDirectInputDeviceCallback_GetUsage(p,a) (p)->GetUsage(a)
  269. #define IDirectInputDeviceCallback_MapUsage(p,a,b) (p)->MapUsage(a,b)
  270. #define IDirectInputDeviceCallback_SetDIData(p,a,b) (p)->SetDIData(a,b)
  271. #define IDirectInputDeviceCallback_BuildDefaultActionMap(p,a,b,c) (p)->BuildDefaultActionMap(a,b,c)
  272. #endif
  273. #else
  274. #undef INTERFACE
  275. #define INTERFACE IDirectInputDeviceCallback
  276. DECLARE_INTERFACE_(IDirectInputDeviceCallback, IUnknown)
  277. {
  278. /*** IUnknown methods ***/
  279. STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE;
  280. STDMETHOD_(ULONG,AddRef)(THIS) PURE;
  281. STDMETHOD_(ULONG,Release)(THIS) PURE;
  282. /*** IDirectInputDeviceCallback methods ***/
  283. STDMETHOD(GetInstance)(THIS_ LPVOID *) PURE;
  284. STDMETHOD(GetVersions)(THIS_ LPDIDRIVERVERSIONS) PURE;
  285. STDMETHOD(GetDataFormat)(THIS_ LPDIDATAFORMAT *) PURE;
  286. STDMETHOD(GetObjectInfo)(THIS_ LPCDIPROPINFO,LPDIDEVICEOBJECTINSTANCEW) PURE;
  287. STDMETHOD(GetCapabilities)(THIS_ LPDIDEVCAPS) PURE;
  288. STDMETHOD(Acquire)(THIS) PURE;
  289. STDMETHOD(Unacquire)(THIS) PURE;
  290. STDMETHOD(GetDeviceState)(THIS_ LPVOID) PURE;
  291. STDMETHOD(GetDeviceInfo)(THIS_ LPDIDEVICEINSTANCEW) PURE;
  292. STDMETHOD(GetProperty)(THIS_ LPCDIPROPINFO,LPDIPROPHEADER) PURE;
  293. STDMETHOD(SetProperty)(THIS_ LPCDIPROPINFO,LPCDIPROPHEADER) PURE;
  294. STDMETHOD(SetEventNotification)(THIS_ HANDLE) PURE;
  295. STDMETHOD(SetCooperativeLevel)(THIS_ HWND,DWORD) PURE;
  296. STDMETHOD(RunControlPanel)(THIS_ HWND,DWORD) PURE;
  297. STDMETHOD(CookDeviceData)(THIS_ UINT,LPDIDEVICEOBJECTDATA) PURE;
  298. STDMETHOD(CreateEffect)(THIS_ LPDIRECTINPUTEFFECTSHEPHERD *) PURE;
  299. STDMETHOD(GetFFConfigKey)(THIS_ DWORD,PHKEY) PURE;
  300. STDMETHOD(SendDeviceData)(THIS_ LPCDIDEVICEOBJECTDATA,LPDWORD,DWORD) PURE;
  301. STDMETHOD(Poll)(THIS) PURE;
  302. STDMETHOD_(DWORD,GetUsage)(THIS_ int) PURE;
  303. STDMETHOD(MapUsage)(THIS_ DWORD,PINT) PURE;
  304. STDMETHOD(SetDIData)(THIS_ DWORD,LPVOID) PURE;
  305. };
  306. typedef struct IDirectInputDeviceCallback *LPDIRECTINPUTDEVICECALLBACK;
  307. #if !defined(__cplusplus) || defined(CINTERFACE)
  308. #define IDirectInputDeviceCallback_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
  309. #define IDirectInputDeviceCallback_AddRef(p) (p)->lpVtbl->AddRef(p)
  310. #define IDirectInputDeviceCallback_Release(p) (p)->lpVtbl->Release(p)
  311. #define IDirectInputDeviceCallback_GetInstance(p,a) (p)->lpVtbl->GetInstance(p,a)
  312. #define IDirectInputDeviceCallback_GetVersions(p,a) (p)->lpVtbl->GetVersions(p,a)
  313. #define IDirectInputDeviceCallback_GetDataFormat(p,a) (p)->lpVtbl->GetDataFormat(p,a)
  314. #define IDirectInputDeviceCallback_GetObjectInfo(p,a,b) (p)->lpVtbl->GetObjectInfo(p,a,b)
  315. #define IDirectInputDeviceCallback_GetCapabilities(p,a) (p)->lpVtbl->GetCapabilities(p,a)
  316. #define IDirectInputDeviceCallback_Acquire(p) (p)->lpVtbl->Acquire(p)
  317. #define IDirectInputDeviceCallback_Unacquire(p) (p)->lpVtbl->Unacquire(p)
  318. #define IDirectInputDeviceCallback_GetDeviceState(p,a) (p)->lpVtbl->GetDeviceState(p,a)
  319. #define IDirectInputDeviceCallback_GetDeviceInfo(p,a) (p)->lpVtbl->GetDeviceInfo(p,a)
  320. #define IDirectInputDeviceCallback_GetProperty(p,a,b) (p)->lpVtbl->GetProperty(p,a,b)
  321. #define IDirectInputDeviceCallback_SetProperty(p,a,b) (p)->lpVtbl->SetProperty(p,a,b)
  322. #define IDirectInputDeviceCallback_SetEventNotification(p,a) (p)->lpVtbl->SetEventNotification(p,a)
  323. #define IDirectInputDeviceCallback_SetCooperativeLevel(p,a,b) (p)->lpVtbl->SetCooperativeLevel(p,a,b)
  324. #define IDirectInputDeviceCallback_RunControlPanel(p,a,b) (p)->lpVtbl->RunControlPanel(p,a,b)
  325. #define IDirectInputDeviceCallback_CookDeviceData(p,a,b) (p)->lpVtbl->CookDeviceData(p,a,b)
  326. #define IDirectInputDeviceCallback_CreateEffect(p,a) (p)->lpVtbl->CreateEffect(p,a)
  327. #define IDirectInputDeviceCallback_GetFFConfigKey(p,a,b) (p)->lpVtbl->GetFFConfigKey(p,a,b)
  328. #define IDirectInputDeviceCallback_SendDeviceData(p,a,b,c) (p)->lpVtbl->SendDeviceData(p,a,b,c)
  329. #define IDirectInputDeviceCallback_Poll(p) (p)->lpVtbl->Poll(p)
  330. #define IDirectInputDeviceCallback_GetUsage(p,a) (p)->lpVtbl->GetUsage(p,a)
  331. #define IDirectInputDeviceCallback_MapUsage(p,a,b) (p)->lpVtbl->MapUsage(p,a,b)
  332. #define IDirectInputDeviceCallback_SetDIData(p,a,b) (p)->lpVtbl->SetDIData(p,a,b)
  333. #else
  334. #define IDirectInputDeviceCallback_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
  335. #define IDirectInputDeviceCallback_AddRef(p) (p)->AddRef()
  336. #define IDirectInputDeviceCallback_Release(p) (p)->Release()
  337. #define IDirectInputDeviceCallback_GetInstance(p,a) (p)->GetInstance(a)
  338. #define IDirectInputDeviceCallback_GetVersions(p,a) (p)->GetVersions(a)
  339. #define IDirectInputDeviceCallback_GetDataFormat(p,a) (p)->GetDataFormat(a)
  340. #define IDirectInputDeviceCallback_GetObjectInfo(p,a,b) (p)->GetObjectInfo(a,b)
  341. #define IDirectInputDeviceCallback_GetCapabilities(p,a) (p)->GetCapabilities(a)
  342. #define IDirectInputDeviceCallback_Acquire(p) (p)->Acquire()
  343. #define IDirectInputDeviceCallback_Unacquire(p) (p)->Unacquire()
  344. #define IDirectInputDeviceCallback_GetDeviceState(p,a) (p)->GetDeviceState(a)
  345. #define IDirectInputDeviceCallback_GetDeviceInfo(p,a) (p)->GetDeviceInfo(a)
  346. #define IDirectInputDeviceCallback_GetProperty(p,a,b) (p)->GetProperty(a,b)
  347. #define IDirectInputDeviceCallback_SetProperty(p,a,b) (p)->SetProperty(a,b)
  348. #define IDirectInputDeviceCallback_SetEventNotification(p,a) (p)->SetEventNotification(a)
  349. #define IDirectInputDeviceCallback_SetCooperativeLevel(p,a,b) (p)->SetCooperativeLevel(a,b)
  350. #define IDirectInputDeviceCallback_RunControlPanel(p,a,b) (p)->RunControlPanel(a,b)
  351. #define IDirectInputDeviceCallback_CookDeviceData(p,a,b) (p)->CookDeviceData(a,b)
  352. #define IDirectInputDeviceCallback_CreateEffect(p,a) (p)->CreateEffect(a)
  353. #define IDirectInputDeviceCallback_GetFFConfigKey(p,a,b) (p)->GetFFConfigKey(a,b)
  354. #define IDirectInputDeviceCallback_SendDeviceData(p,a,b,c) (p)->SendDeviceData(a,b,c)
  355. #define IDirectInputDeviceCallback_Poll(p) (p)->Poll()
  356. #define IDirectInputDeviceCallback_GetUsage(p,a) (p)->GetUsage(a)
  357. #define IDirectInputDeviceCallback_MapUsage(p,a,b) (p)->MapUsage(a,b)
  358. #define IDirectInputDeviceCallback_SetDIData(p,a,b) (p)->SetDIData(a,b)
  359. #endif
  360. #endif /* DIRECTINPUT_VERSION >= 0x0800 */
  361. /****************************************************************************
  362. *
  363. * Emulation flags
  364. *
  365. * These bits can be put into the Emulation flag in the registry
  366. * key REGSTR_PATH_DINPUT as the DWORD value of REGSTR_VAL_EMULATION.
  367. *
  368. * Warning! If you use more than fifteen bits of emulation, then
  369. * you also have to mess with DIGETEMFL() and DIMAKEEMFL() in
  370. * dinputv.h.
  371. *
  372. ****************************************************************************/
  373. #define DIEMFL_MOUSE 0x00000001 /* Force mouse emulation */
  374. #define DIEMFL_KBD 0x00000002 /* Force keyboard emulation */
  375. #define DIEMFL_JOYSTICK 0x00000004 /* Force joystick emulation */
  376. #define DIEMFL_KBD2 0x00000008 /* Force keyboard emulation 2 */
  377. #define DIEMFL_MOUSE2 0x00000010 /* Force mouse emulation 2 */
  378. /****************************************************************************
  379. *
  380. * IDirectInputActionFramework
  381. * Framework interface for configuring devices
  382. *
  383. ****************************************************************************/
  384. #if(DIRECTINPUT_VERSION >= 0x0800)
  385. #undef INTERFACE
  386. #define INTERFACE IDirectInputActionFramework
  387. DECLARE_INTERFACE_(IDirectInputActionFramework, IUnknown)
  388. {
  389. /*** IUnknown methods ***/
  390. STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE;
  391. STDMETHOD_(ULONG,AddRef)(THIS) PURE;
  392. STDMETHOD_(ULONG,Release)(THIS) PURE;
  393. /*** IDirectInputActionFramework methods ***/
  394. STDMETHOD(ConfigureDevices)(THIS_ LPDICONFIGUREDEVICESCALLBACK,LPDICONFIGUREDEVICESPARAMSW,DWORD,LPVOID) PURE;
  395. };
  396. typedef struct IDirectInputActionFramework *LPDIRECTINPUTACTIONFRAMEWORK;
  397. #if !defined(__cplusplus) || defined(CINTERFACE)
  398. #define IDirectInputActionFramework_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
  399. #define IDirectInputActionFramework_AddRef(p) (p)->lpVtbl->AddRef(p)
  400. #define IDirectInputActionFramework_Release(p) (p)->lpVtbl->Release(p)
  401. #define IDirectInputActionFramework_ConfigureDevices(p,a,b,c,d) (p)->lpVtbl->ConfigureDevices(p,a,b,c,d)
  402. #else
  403. #define IDirectInputActionFramework_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
  404. #define IDirectInputActionFramework_AddRef(p) (p)->AddRef()
  405. #define IDirectInputActionFramework_Release(p) (p)->Release()
  406. #define IDirectInputActionFramework_ConfigureDevices(p,a,b,c,d) (p)->ConfigureDevices(a,b,c,d)
  407. #endif
  408. #endif /* DIRECTINPUT_VERSION >= 0x0800 */
  409. #define JOY_HW_PREDEFMIN JOY_HW_2A_2B_GENERIC
  410. #ifdef WINNT
  411. #define JOY_HW_PREDEFMAX JOY_HW_LASTENTRY
  412. #else
  413. #define JOY_HW_PREDEFMAX (JOY_HW_LASTENTRY-1)
  414. #endif
  415. #define JOYTYPE_FLAGS1_SETVALID 0x80000000l
  416. #define JOYTYPE_FLAGS1_GETVALID 0x8000000Fl
  417. #define JOYTYPE_FLAGS2_SETVALID 0x01FFFFFFl
  418. #define JOYTYPE_FLAGS2_GETVALID 0x01FFFFFFl
  419. #define iJoyPosAxisX 0 /* The order in which */
  420. #define iJoyPosAxisY 1 /* axes appear */
  421. #define iJoyPosAxisZ 2 /* in a JOYPOS */
  422. #define iJoyPosAxisR 3
  423. #define iJoyPosAxisU 4
  424. #define iJoyPosAxisV 5
  425. #define cJoyPosAxisMax 6
  426. #define cJoyPosButtonMax 32
  427. #define DITC_VOLATILEREGKEY 0x80000000
  428. #define DITC_INREGISTRY_DX5 0x0000000F
  429. #define DITC_GETVALID_DX5 0x0000000F
  430. #define DITC_SETVALID_DX5 0x0000000F
  431. #define DITC_INREGISTRY_DX6 0x0000003F
  432. #define DITC_GETVALID_DX6 0x0000003F
  433. #define DITC_SETVALID_DX6 0x0000003F
  434. #define DITC_INREGISTRY 0x000000FF
  435. #define DITC_GETVALID 0x000000FF
  436. #define DITC_SETVALID 0x000000FF
  437. /*
  438. * Name for the 8.0 structure, in places where we specifically care.
  439. */
  440. typedef DIJOYTYPEINFO DIJOYTYPEINFO_DX8;
  441. typedef LPDIJOYTYPEINFO *LPDIJOYTYPEINFO_DX8;
  442. BOOL static __inline
  443. IsValidSizeDIJOYTYPEINFO(DWORD cb)
  444. {
  445. return cb == sizeof(DIJOYTYPEINFO_DX8) ||
  446. cb == sizeof(DIJOYTYPEINFO_DX6) ||
  447. cb == sizeof(DIJOYTYPEINFO_DX5);
  448. }
  449. #define DIJC_UPDATEALIAS 0x80000000
  450. #define DIJC_INREGISTRY_DX5 0x0000000E
  451. #define DIJC_GETVALID_DX5 0x0000000F
  452. #define DIJC_SETVALID_DX5 0x0000000E
  453. #define DIJC_INREGISTRY 0x0000001E
  454. #define DIJC_GETVALID 0x0000001F
  455. #define DIJC_SETVALID 0x0000001F
  456. #define DIJC_INTERNALSETVALID 0x8000001F
  457. /*
  458. * Name for the 6.? structure, in places where we specifically care.
  459. */
  460. typedef DIJOYCONFIG DIJOYCONFIG_DX6;
  461. typedef DIJOYCONFIG *LPDIJOYCONFIG_DX6;
  462. BOOL static __inline
  463. IsValidSizeDIJOYCONFIG(DWORD cb)
  464. {
  465. return cb == sizeof(DIJOYCONFIG_DX6) ||
  466. cb == sizeof(DIJOYCONFIG_DX5);
  467. }
  468. #define DIJU_INDRIVERREGISTRY 0x00000006
  469. #define DIJU_GETVALID 0x00000007
  470. #define DIJU_SETVALID 0x80000007