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.

389 lines
14 KiB

  1. ;***************************************************************************
  2. ; THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
  3. ; KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
  4. ; IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
  5. ; PURPOSE.
  6. ; Copyright (c) 1994 - 1998 Microsoft Corporation. All Rights Reserved.
  7. ; File: vjoyd.h
  8. ; Content: include file for describing VJoyD mini-driver communications
  9. ;*************************************************************************
  10. ifndef WCHAR
  11. endif
  12. ifndef UNICODE_STRING
  13. UNICODE_STRING STRUC
  14. us_Length DB SIZE WORD DUP (?)
  15. us_MaximumLength DB SIZE WORD DUP (?)
  16. us_Buffer DD ?
  17. UNICODE_STRING ENDS
  18. endif
  19. INCLUDE vjoydapi.INC
  20. Begin_Service_Table VJOYD
  21. ; * Win95 Gold services
  22. ;
  23. VJOYD_Service VJOYD_Register_Device_Driver, LOCAL
  24. VJOYD_Service VJOYD_GetPosEx_Service, LOCAL
  25. ; * DInput services (for internal use only)
  26. ;
  27. VJOYD_Service VJOYD_GetInitParams_Service, LOCAL
  28. VJOYD_Service VJOYD_Poll_Service, LOCAL
  29. VJOYD_Service VJOYD_Escape_Service, LOCAL
  30. VJOYD_Service VJOYD_CtrlMsg_Service, LOCAL
  31. VJOYD_Service VJOYD_SetGain_Service, LOCAL
  32. VJOYD_Service VJOYD_SendFFCommand_Service, LOCAL
  33. VJOYD_Service VJOYD_GetFFState_Service, LOCAL
  34. VJOYD_Service VJOYD_DownloadEffect_Service, LOCAL
  35. VJOYD_Service VJOYD_DestroyEffect_Service, LOCAL
  36. VJOYD_Service VJOYD_StartEffect_Service, LOCAL
  37. VJOYD_Service VJOYD_StopEffect_Service, LOCAL
  38. VJOYD_Service VJOYD_GetEffectStatus_Service, LOCAL
  39. ; * Interrupt polling
  40. ; * Mini-drivers should call this if they are interrupt driven at the
  41. ; * time they are notified of a change.
  42. ;
  43. VJOYD_Service VJOYD_DeviceUpdateNotify_Service, LOCAL
  44. ; * Screen saver (internal only)
  45. ;
  46. VJOYD_Service VJOYD_JoystickActivity_Service, LOCAL
  47. ; * Registry access
  48. ;
  49. VJOYD_Service VJOYD_OpenTypeKey_Service, LOCAL
  50. VJOYD_Service VJOYD_OpenConfigKey_Service, LOCAL
  51. ; * Gameport provider (not fully supported)
  52. ;
  53. VJOYD_Service VJOYD_NewGameportDevNode, LOCAL
  54. ; * Config Changed
  55. ;
  56. VJOYD_Service VJOYD_ConfigChanged_Service, LOCAL
  57. End_Service_Table VJOYD
  58. VJOYD_Init_Order EQU <UNDEFINED_INIT_ORDER>
  59. MAX_MSJSTICK EQU (16)
  60. S_OK EQU 00000000H
  61. S_FALSE EQU 00000001H
  62. E_FAIL EQU 80004005H
  63. E_INVALIDARG EQU 80000003H
  64. VJ_OK EQU S_OK ; A complete success
  65. VJ_FALSE EQU S_FALSE ; A success but not without some difficulties
  66. VJ_DEFAULT EQU VJ_FALSE ; Mini-driver does not understand
  67. VJ_INCOMPLETE EQU VJ_FALSE ; Some requested poll data was not returned
  68. VJERR_FAIL EQU E_FAIL
  69. VJERR_NEED_DEVNODE EQU VJERR_FAIL ; Need more resources
  70. VJERR_BAD_DEVNODE EQU VJERR_FAIL ; Last resources were insufficient
  71. VJERR_INVALIDPARAM EQU E_INVALIDARG
  72. VJERR_FAIL_HID EQU 80070052H ; The device is HID, so fail VJoyD polls: MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_DUP_NAME)
  73. VJERR_FAIL_OOM EQU <E_OUTOFMEMORY> ; An out of memory condition cause a failure
  74. VJERR_FAIL_DRVLOAD EQU VJERR_FAIL ; mini driver failed to load, internal error
  75. VJERR_FAIL_POWER EQU VJERR_FAIL ; the power state of the device caused a failure
  76. ; Driver Config flags
  77. ; Interface attributes (result is combination of OEM flag and VJOYD)
  78. VJDF_UNIT_ID EQU 00000001H ; unit id is valid
  79. VJDF_ISHID EQU 00000002H ; This is a HID device, so refuse polls
  80. VJDF_SENDSNOTIFY EQU 00000004H ; Driver calls VJOYD_DeviceUpdateNotify_Service
  81. VJDF_NEWIF EQU 00000080H ; use new interface (will be set by VJOYD on registration if new i/f used)
  82. VJDF_USAGES EQU 00000010H ; usages are valid
  83. VJDF_GENERICNAME EQU 00000020H ; The lpszOEMName string is generic name, not a whole string
  84. ; Interface requirements
  85. VJDF_NONVOLATILE EQU 00000100H ; This value should not be deleted on boot
  86. ; Devnode requirement flags
  87. VJDF_NODEVNODE EQU 00010000H ; does not get its resources via CFG_MGR
  88. VJDF_ISANALOGPORTDRIVER EQU 00020000H ; it plugs into a standard gameport
  89. VJDF_NOCHAINING EQU 00040000H ; one devnode per device
  90. MAX_JOYSTICKOEMVXDNAME EQU 260 ; max oem vxd name length (including NULL)
  91. POV_MIN EQU 0
  92. POV_MAX EQU 1
  93. ;***************************************************************************
  94. ; @doc DDK |
  95. ; @struct JOYHWCAPS |
  96. ; The <t JOYHWCAPS> structure is defined only because previous versions of
  97. ; this file defined it. There is no reason this should be needed.
  98. ;**************************************************************************
  99. JOYHWCAPS STRUC
  100. dwMaxButtons DD ?
  101. dwMaxAxes DD ?
  102. dwNumAxes DD ?
  103. szOEMVxD DB MAX_JOYSTICKOEMVXDNAME DUP (?)
  104. JOYHWCAPS ENDS
  105. ;***************************************************************************
  106. ; @doc DDK |
  107. ; @struct JOYPOLLDATA |
  108. ; The <t JOYPOLLDATA> structure is used to collect sensor data
  109. ; from a DX5 mini-driver.
  110. ; @field DWORD | dwX |
  111. ; The X axis value.
  112. ; @field DWORD | dwY |
  113. ; The X axis value.
  114. ; @field DWORD | dwZ |
  115. ; The X axis value.
  116. ; @field DWORD | dwR |
  117. ; The X axis value.
  118. ; @field DWORD | dwU |
  119. ; The X axis value.
  120. ; @field DWORD | dwV |
  121. ; The X axis value.
  122. ; @field DWORD | dwPOV0 |
  123. ; The first point of view value.
  124. ; @field DWORD | dwPOV1 |
  125. ; The second point of view value.
  126. ; @field DWORD | dwPOV2 |
  127. ; The third point of view value.
  128. ; @field DWORD | dwPOV3 |
  129. ; The fourth point of view value.
  130. ; @field DWORD | dwBTN0 |
  131. ; The first DWORD of button bits. (Buttons 1 to 32 )
  132. ; @field DWORD | dwBTN1 |
  133. ; The second DWORD of button bits. (Buttons 33 to 64 )
  134. ; @field DWORD | dwBTN2 |
  135. ; The third DWORD of button bits. (Buttons 65 to 96 )
  136. ; @field DWORD | dwBTN3 |
  137. ; The fourth DWORD of button bits. (Buttons 97 to 128 )
  138. ; @field DWORD | dwReserved0 |
  139. ; The first reserved DWORD.
  140. ; @field DWORD | dwReserved1 |
  141. ; The second reserved DWORD.
  142. ;**************************************************************************
  143. VJPOLLDATA STRUC
  144. dwX DD ?
  145. dwY DD ?
  146. dwZ DD ?
  147. dwR DD ?
  148. dwU DD ?
  149. dwV DD ?
  150. dwPOV0 DD ?
  151. dwPOV1 DD ?
  152. dwPOV2 DD ?
  153. dwPOV3 DD ?
  154. dwBTN0 DD ?
  155. dwBTN1 DD ?
  156. dwBTN2 DD ?
  157. dwBTN3 DD ?
  158. dwReserved0 DD ?
  159. dwReserved1 DD ?
  160. VJPOLLDATA ENDS
  161. ;***************************************************************************
  162. ; @doc DDK |
  163. ; @struct JOYOEMHWCAPS |
  164. ; The <t JOYOEMHWCAPS> structure is used to pass driver capabilites
  165. ; @field DWORD | dwMaxButtons |
  166. ; The number of buttons supported by the device.
  167. ; @field DWORD | dwMaxAxes |
  168. ; The highest axis supported by the device.
  169. ; For example a device with X, Y and R has 3 axes but the highest
  170. ; one is axis 4 so dwMaxAxes is 4.
  171. ; @field DWORD | dwNumAxes |
  172. ; The number of axes supported by the device.
  173. ; For example a device with X, Y and R has 3 so dwNumAxes is 3.
  174. ;**************************************************************************
  175. JOYOEMHWCAPS STRUC
  176. dwMaxButtons DD ?
  177. dwMaxAxes DD ?
  178. dwNumAxes DD ?
  179. JOYOEMHWCAPS ENDS
  180. ;***************************************************************************
  181. ; @doc DDK |
  182. ; @struct VJPOLLREG |
  183. ; The <t VJPOLLREG> structure is used by a mini-driver to register polling
  184. ; and other general purpose callbacks with VJoyD for DX5 interface mini-
  185. ; drivers.
  186. ; @field DWORD | dwSize |
  187. ; Must be set to sizeof(<t VJPOLLREG>)
  188. ; @field JOYPOLLRTN | fpPoll |
  189. ; Poll callback. Used for all device polling.
  190. ; @field CMCONFIGHANDLER | fpCfg |
  191. ; Standard configuration manager callback.
  192. ; @field INITIALIZERTN | fpInitialize |
  193. ; Initialization callback. This callback replaces and extends the JoyId
  194. ; callback used with Win95 interface mini-drivers.
  195. ; @field ESCAPERTN | fpEscape |
  196. ; Escape callback. May be sent to a device in response to an application
  197. ; calling the Escape member.
  198. ; @field CTRLMSGRTN | fpCtrlMsg |
  199. ; Control message callback. Used to send notifications from VJoyD to mini-
  200. ; drivers.
  201. ;**************************************************************************
  202. VJPOLLREG STRUC
  203. dwSize DD ?
  204. fpPoll DD ?
  205. fpCfg DD ?
  206. fpInitialize DD ?
  207. fpEscape DD ?
  208. fpCtrlMsg DD ?
  209. VJPOLLREG ENDS
  210. ;***************************************************************************
  211. ; @doc DDK |
  212. ; @struct VJFORCEREG |
  213. ; The <t VJFORCEREG> structure is used by a mini-driver to register force
  214. ; feedback related callbacks with VJoyD for DX5 interface.
  215. ; @field DWORD | dwSize |
  216. ; Must be set to sizeof(<t VJFORCEREG>)
  217. ; @field SETGAINRTN | fpSetFFGain |
  218. ; Set Force Feedback Gain callback.
  219. ; @field SENDFFCOMMANDRTN | fpSendFFCommand |
  220. ; Send Force Feedback Command callback.
  221. ; @field GETFFSTATERTN | fpGetFFState |
  222. ; Get Force Feedback state callback.
  223. ; @field DOWNLOADEFFECTRTN | fpDownloadEff |
  224. ; Download effect callback.
  225. ; @field DESTROYEFFECTRTN | fpDestroyEff |
  226. ; Destroy effect callback.
  227. ; @field STARTEFFECTRTN | fpStartEff |
  228. ; Start effect callback.
  229. ; @field STOPEFFECTRTN | fpStopEff |
  230. ; Stop effect callback.
  231. ; @field GETEFFECTSTATUSRTN | fpGetStatusEff |
  232. ; Get effect status callback.
  233. ;**************************************************************************
  234. VJFORCEREG STRUC
  235. dwSize DD ?
  236. fpSetFFGain DD ?
  237. fpSendFFCommand DD ?
  238. fpGetFFState DD ?
  239. fpDownloadEff DD ?
  240. fpDestroyEff DD ?
  241. fpStartEff DD ?
  242. fpStopEff DD ?
  243. fpGetStatusEff DD ?
  244. VJFORCEREG ENDS
  245. ;***************************************************************************
  246. ; @doc DDK
  247. ; @struct VJDEVICEDESC |
  248. ; The <t VJDEVICEDESC > structure is used to describe a DX5 DDI
  249. ; device. This structure has been extended since DX5. See the
  250. ; VJDEVICEDESC_DX5 structure for the previous version.
  251. ; @field DWORD | dwSize |
  252. ; Must be set to sizeof(<t VJDEVICEDESC>).
  253. ; @field LPSTR | lpszOEMType |
  254. ; Points to a null terminated string containing the text used to
  255. ; describe the device as stored in the OEMName entry in the
  256. ; registry. Renamed in Win98 (was lpszOEMName), is unused for
  257. ; DX5 drivers.
  258. ; @field DWORD | dwUnitId |
  259. ; Specifies the unit id of this device.
  260. ; @field LPJOYOEMHWCAPS | lpHWCaps |
  261. ; Points to a <t JOYOEMHWCAPS> structure which contains the device
  262. ; hardware capabilities.
  263. ; @field LPJOYREGHWCONFIG | lpHWConfig |
  264. ; Points to a <t JOYREGHWCONFIG> structure which contains the
  265. ; configuration and calibration data for the device. Is unused for
  266. ; DX5 drivers.
  267. ; @field UNICODE_STRING | FileName |
  268. ; An optional filename associated with the device. This is used for
  269. ; HID devices to allow them to be accessed directly through the HID
  270. ; stack without the joyGetPosEx restrictions. Added Win98.
  271. ; @field USAGE_AND_PAGE | Usages |
  272. ; An array of HID usages to describe what HID axis description has
  273. ; been used for each WinMM axis. Added Win98. The elements are:
  274. ; Usages[0] - X
  275. ; Usages[1] - Y
  276. ; Usages[2] - Z
  277. ; Usages[3] - R
  278. ; Usages[4] - U
  279. ; Usages[5] - V
  280. ; Usages[6] - POV0
  281. ; Usages[7] - POV1
  282. ; Usages[8] - POV2
  283. ; Usages[9] - POV3
  284. ; @field LPSTR | lpszOEMName |
  285. ; Points to a null terminated string containing a friendly name
  286. ; for the device. Added Win98.
  287. ;**************************************************************************
  288. VJDEVICEDESC STRUC
  289. dwSize DD ?
  290. lpszOEMType DD ?
  291. dwUnitId DD ?
  292. lpHWCaps DD ?
  293. lpHWConfig DD ?
  294. FileName DB SIZE UNICODE_STRING DUP (?)
  295. Usages DD 10 DUP (?)
  296. lpszOEMName DD ?
  297. VJDEVICEDESC ENDS
  298. ;***************************************************************************
  299. ; @doc DDK
  300. ; @struct VJDEVICEDESC_DX5 |
  301. ; The <t VJDEVICEDESC_DX5 > structure is used to describe a DX5 DDI
  302. ; device. This is the DX5 version of the structure.
  303. ; @field DWORD | dwSize |
  304. ; Must be set to sizeof(<t VJDEVICEDESC_DX5>).
  305. ; @field LPSTR | lpszOEMName |
  306. ; This field is ignored.
  307. ; @field DWORD | dwUnitId |
  308. ; Specifies the unit id of this device.
  309. ; @field LPJOYOEMHWCAPS | lpHWCaps |
  310. ; Points to a <t JOYOEMHWCAPS> structure which contains the device
  311. ; hardware capabilities.
  312. ; @field LPJOYREGHWCONFIG | lpHWConfig |
  313. ; This field is unused in DX5.
  314. ;**************************************************************************
  315. VJDEVICEDESC_DX5 STRUC
  316. dwSize DD ?
  317. lpszOEMName DD ?
  318. dwUnitId DD ?
  319. lpHWCaps DD ?
  320. lpHWConfig DD ?
  321. VJDEVICEDESC_DX5 ENDS
  322. ;***************************************************************************
  323. ; @doc DDK
  324. ; @struct VJREGDRVINFO |
  325. ; The <t VJREGDRVINFO > structure is used to register a DX5 DDI
  326. ; driver with VJoyD.
  327. ; @field DWORD | dwSize |
  328. ; The size of the structure.
  329. ; @field DWORD | dwFunction |
  330. ; The type of registration to be performed
  331. ; It must be one of the <c VJRT_*> values.
  332. ; @field DWORD | dwFlags |
  333. ; Flags associated with this registration
  334. ; It consists of one or more <c VJDF_*> flag values.
  335. ; @field LPSTR | lpszOEMCallout |
  336. ; The name of the driver associated with this registration,
  337. ; for example "msanalog.vxd"
  338. ; @field DWORD | dwFirmwareRevision |
  339. ; Specifies the firmware revision of the device.
  340. ; If the revision is unknown a value of zero should be used.
  341. ; @field DWORD | dwHardwareRevision |
  342. ; Specifies the hardware revision of the device.
  343. ; If the revision is unknown a value of zero should be used.
  344. ; @field DWORD | dwDriverVersion |
  345. ; Specifies the version number of the device driver.
  346. ; If the revision is unknown a value of zero should be used.
  347. ; @field LPVJDEVICEDESC | lpDeviceDesc |
  348. ; Optional pointer to a <t VJDEVICEDESC > structure
  349. ; that describes the configuration properties of the device.
  350. ; This allows drivers to supply the description of the device
  351. ; rather than use the registry for this purpose.
  352. ; If no description is available then the field should be
  353. ; set to <c NULL>.
  354. ; @field LPVJPOLLREG | lpPollReg |
  355. ; Optional pointer to a <t VJPOLLREG > structure
  356. ; that contains the most common driver callbacks.
  357. ; Only a very strange driver would not need to register any
  358. ; of these callbacks but if that was the case, then the field
  359. ; should be set to <c NULL>.
  360. ; @field LPVJFORCEREG | lpForceReg |
  361. ; Optional pointer to a <t VJFORCEREG > structure
  362. ; that contains all of the force feedback specific callbacks.
  363. ; If the ring 0 driver does not support force feedback then
  364. ; the field should be set to <c NULL>.
  365. ; @field DWORD | dwReserved |
  366. ; Reserved, must be set to zero.
  367. ;**************************************************************************
  368. VJREGDRVINFO STRUC
  369. dwSize DD ?
  370. dwFunction DD ?
  371. dwFlags DD ?
  372. lpszOEMCallout DD ?
  373. dwFirmwareRevision DD ?
  374. dwHardwareRevision DD ?
  375. dwDriverVersion DD ?
  376. lpDeviceDesc DD ?
  377. lpPollReg DD ?
  378. lpForceReg DD ?
  379. dwReserved DD ?
  380. VJREGDRVINFO ENDS