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.

721 lines
27 KiB

  1. /****************************************************************************/
  2. /* */
  3. /* MMDDK.H - Include file for Multimedia Device Development Kit */
  4. /* */
  5. /* Note: You must include the WINDOWS.H and MMSYSTEM.H header files */
  6. /* before including this file. */
  7. /* */
  8. /* Copyright (c) 1990-1998, Microsoft Corp. All rights reserved. */
  9. /* */
  10. /****************************************************************************/
  11. #ifndef _INC_MMDDK
  12. #define _INC_MMDDK
  13. #include "pshpack1.h" // Assume byte packing throughout
  14. #ifdef __cplusplus
  15. extern "C" {
  16. #endif /* __cplusplus */
  17. /* If defined, the following flags inhibit inclusion
  18. * of the indicated items:
  19. *
  20. * MMNOMIDIDEV - MIDI support
  21. * MMNOWAVEDEV - Waveform support
  22. * MMNOAUXDEV - Auxiliary output support
  23. * MMNOMIXERDEV - Mixer support
  24. * MMNOTIMERDEV - Timer support
  25. * MMNOJOYDEV - Joystick support
  26. * MMNOMCIDEV - MCI support
  27. * MMNOTASKDEV - Task support
  28. */
  29. #ifdef MMNOTIMER
  30. #define MMNOTIMERDEV
  31. #endif
  32. #ifdef MMNOWAVE
  33. #define MMNOWAVEDEV
  34. #endif
  35. #ifdef MMNOMIDI
  36. #define MMNOMIDIDEV
  37. #endif
  38. #ifdef MMNOAUX
  39. #define MMNOAUXDEV
  40. #endif
  41. #ifdef MMNOJOY
  42. #define MMNOJOYDEV
  43. #endif
  44. #ifdef MMNOMMIO
  45. #define MMNOMMIODEV
  46. #endif
  47. #ifdef MMNOMCI
  48. #define MMNOMCIDEV
  49. #endif
  50. #ifdef NOMIDIDEV /* ;Internal */
  51. #define MMNOMIDIDEV /* ;Internal */
  52. #endif /* ;Internal */
  53. #ifdef NOWAVEDEV /* ;Internal */
  54. #define MMNOWAVEDEV /* ;Internal */
  55. #endif /* ;Internal */
  56. #ifdef NOAUXDEV /* ;Internal */
  57. #define MMNOAUXDEV /* ;Internal */
  58. #endif /* ;Internal */
  59. #ifdef NOTIMERDEV /* ;Internal */
  60. #define MMNOTIMERDEV /* ;Internal */
  61. #endif /* ;Internal */
  62. #ifdef NOJOYDEV /* ;Internal */
  63. #define MMNOJOYDEV /* ;Internal */
  64. #endif /* ;Internal */
  65. #ifdef NOMCIDEV /* ;Internal */
  66. #define MMNOMCIDEV /* ;Internal */
  67. #endif /* ;Internal */
  68. #ifdef NOTASKDEV /* ;Internal */
  69. #define MMNOTASKDEV /* ;Internal */
  70. #endif /* ;Internal */
  71. /***************************************************************************
  72. Helper functions for drivers
  73. ***************************************************************************/
  74. #ifndef NODRIVERS
  75. #define DRV_LOAD 0x0001
  76. #define DRV_ENABLE 0x0002
  77. #define DRV_OPEN 0x0003
  78. #define DRV_CLOSE 0x0004
  79. #define DRV_DISABLE 0x0005
  80. #define DRV_FREE 0x0006
  81. #define DRV_CONFIGURE 0x0007
  82. #define DRV_QUERYCONFIGURE 0x0008
  83. #define DRV_INSTALL 0x0009
  84. #define DRV_REMOVE 0x000A
  85. #define DRV_RESERVED 0x0800
  86. #define DRV_USER 0x4000
  87. #define DRIVERS_SECTION TEXT("DRIVERS32") // Section name for installed drivers
  88. #define MCI_SECTION TEXT("MCI32") // Section name for installed MCI drivers
  89. #endif /* !NODRIVERS */
  90. #define DCB_NOSWITCH 0x0008 // don't switch stacks for callback
  91. #define DCB_TYPEMASK 0x0007 // callback type mask
  92. #define DCB_NULL 0x0000 // unknown callback type
  93. // flags for wFlags parameter of DriverCallback()
  94. #define DCB_WINDOW 0x0001 // dwCallback is a HWND
  95. #define DCB_TASK 0x0002 // dwCallback is a HTASK
  96. #define DCB_FUNCTION 0x0003 // dwCallback is a FARPROC
  97. #define DCB_EVENT 0x0005 // dwCallback is an EVENT
  98. BOOL APIENTRY DriverCallback(DWORD_PTR dwCallback, DWORD dwFlags,
  99. HDRVR hDevice, DWORD dwMsg, DWORD_PTR dwUser, DWORD_PTR dwParam1, DWORD_PTR dwParam2);
  100. // generic prototype for audio device driver entry-point functions
  101. // midMessage(), modMessage(), widMessage(), wodMessage(), auxMessage()
  102. //typedef DWORD (SOUNDDEVMSGPROC)(WORD, WORD, DWORD, DWORD, DWORD);
  103. //typedef SOUNDDEVMSGPROC FAR *LPSOUNDDEVMSGPROC;
  104. #define DRVM_INIT 100
  105. #define DRVM_EXIT 101
  106. #define DRVM_DISABLE 102
  107. #define DRVM_ENABLE 103
  108. // message base for driver specific messages.
  109. //
  110. #define DRVM_MAPPER 0x2000
  111. #define DRVM_USER 0x4000
  112. #define DRVM_MAPPER_STATUS (DRVM_MAPPER+0)
  113. #define DRVM_MAPPER_RECONFIGURE (DRVM_MAPPER+1)
  114. #define DRVM_MAPPER_QUERYDEST (DRVM_MAPPER+20) /* ;Internal */
  115. #define DRVM_MAPPER_PREFERRED_GET (DRVM_MAPPER+21)
  116. #define DRVM_MAPPER_PREFERRED_SET (DRVM_MAPPER+22) /* ;Internal */
  117. #define DRVM_MAPPER_CONSOLEVOICECOM_GET (DRVM_MAPPER+23)
  118. #define DRVM_MAPPER_CONSOLEVOICECOM_SET (DRVM_MAPPER+24) /* ;Internal */
  119. #define DRV_QUERYDRVENTRY (DRV_RESERVED + 1) /* ;Internal */
  120. #define DRV_QUERYDEVNODE (DRV_RESERVED + 2)
  121. #define DRV_QUERYNAME (DRV_RESERVED + 3) /* ;Internal */
  122. #define DRV_QUERYDRIVERIDS (DRV_RESERVED + 4) /* ;Internal */
  123. #define DRV_QUERYMAPPABLE (DRV_RESERVED + 5)
  124. #define DRV_QUERYMAPID (DRV_RESERVED + 6) /* ;Internal */
  125. #define DRV_QUERYNUMPORTS (DRV_RESERVED + 8) /* ;Internal */
  126. #define DRV_QUERYMODULE (DRV_RESERVED + 9)
  127. #define DRV_QUERYFILENAME (DRV_RESERVED + 10) /* ;Internal */
  128. #define DRV_PNPINSTALL (DRV_RESERVED + 11)
  129. #define DRV_QUERYDEVICEINTERFACE (DRV_RESERVED + 12)
  130. #define DRV_QUERYDEVICEINTERFACESIZE (DRV_RESERVED + 13)
  131. #define DRV_QUERYSTRINGID (DRV_RESERVED + 14)
  132. #define DRV_QUERYSTRINGIDSIZE (DRV_RESERVED + 15)
  133. #define DRV_QUERYIDFROMSTRINGID (DRV_RESERVED + 16)
  134. //
  135. // DRVM_MAPPER_PREFERRED_GET flags
  136. //
  137. #define DRVM_MAPPER_PREFERRED_FLAGS_PREFERREDONLY 0x00000001
  138. //
  139. // messages that have IOCTL format
  140. // dw1 = NULL or handle
  141. // dw2 = NULL or ptr to DRVM_IOCTL_DATA
  142. // return is MMRESULT
  143. //
  144. #define DRVM_IOCTL 0x100
  145. #define DRVM_ADD_THRU (DRVM_IOCTL+1)
  146. #define DRVM_REMOVE_THRU (DRVM_IOCTL+2)
  147. #define DRVM_IOCTL_LAST (DRVM_IOCTL+5)
  148. typedef struct {
  149. DWORD dwSize; // size of this structure (inclusive)
  150. DWORD dwCmd; // IOCTL command code, 0x80000000 and above reserved for system
  151. } DRVM_IOCTL_DATA, FAR * LPDRVM_IOCTL_DATA;
  152. // command code ranges for dwCmd field of DRVM_IOCTL message
  153. // codes from 0 to 0x7FFFFFFF are user defined
  154. // codes from 0x80000000 to 0xFFFFFFFF are reserved for future
  155. // definition by microsoft
  156. //
  157. #define DRVM_IOCTL_CMD_USER 0x00000000L
  158. #define DRVM_IOCTL_CMD_SYSTEM 0x80000000L
  159. // device ID for 386 AUTODMA VxD
  160. #define VADMAD_Device_ID 0X0444
  161. /* PnP version of media device caps */
  162. typedef struct {
  163. DWORD cbSize;
  164. LPVOID pCaps;
  165. } MDEVICECAPSEX;
  166. #ifndef MMNOWAVEDEV
  167. /****************************************************************************
  168. Waveform device driver support
  169. ****************************************************************************/
  170. #define WODM_INIT DRVM_INIT
  171. #define WIDM_INIT DRVM_INIT
  172. // waveform input and output device open information structure
  173. typedef struct waveopendesc_tag {
  174. HWAVE hWave; // handle
  175. LPWAVEFORMAT lpFormat; // format of wave data
  176. DWORD_PTR dwCallback; // callback
  177. DWORD_PTR dwInstance; // app's private instance information
  178. UINT uMappedDeviceID; // device to map to if WAVE_MAPPED set
  179. DWORD_PTR dnDevNode; /* if device is PnP */
  180. } WAVEOPENDESC;
  181. typedef WAVEOPENDESC FAR *LPWAVEOPENDESC;
  182. // messages sent to wodMessage() entry-point function
  183. #define WODM_GETNUMDEVS 3
  184. #define WODM_GETDEVCAPS 4
  185. #define WODM_OPEN 5
  186. #define WODM_CLOSE 6
  187. #define WODM_PREPARE 7
  188. #define WODM_UNPREPARE 8
  189. #define WODM_WRITE 9
  190. #define WODM_PAUSE 10
  191. #define WODM_RESTART 11
  192. #define WODM_RESET 12
  193. #define WODM_GETPOS 13
  194. #define WODM_GETPITCH 14
  195. #define WODM_SETPITCH 15
  196. #define WODM_GETVOLUME 16
  197. #define WODM_SETVOLUME 17
  198. #define WODM_GETPLAYBACKRATE 18
  199. #define WODM_SETPLAYBACKRATE 19
  200. #define WODM_BREAKLOOP 20
  201. #define WODM_PREFERRED 21
  202. // #if (WINVER >= 0x030B)
  203. #define WODM_MAPPER_STATUS (DRVM_MAPPER_STATUS + 0)
  204. #define WAVEOUT_MAPPER_STATUS_DEVICE 0
  205. #define WAVEOUT_MAPPER_STATUS_MAPPED 1
  206. #define WAVEOUT_MAPPER_STATUS_FORMAT 2
  207. // #endif /* WINVER >= 0x030B */
  208. #define WODM_BUSY 21
  209. // messages sent to widMessage() entry-point function
  210. #define WIDM_GETNUMDEVS 50
  211. #define WIDM_GETDEVCAPS 51
  212. #define WIDM_OPEN 52
  213. #define WIDM_CLOSE 53
  214. #define WIDM_PREPARE 54
  215. #define WIDM_UNPREPARE 55
  216. #define WIDM_ADDBUFFER 56
  217. #define WIDM_START 57
  218. #define WIDM_STOP 58
  219. #define WIDM_RESET 59
  220. #define WIDM_GETPOS 60
  221. #define WIDM_PREFERRED 61
  222. // #if (WINVER >= 0x030B)
  223. #define WIDM_MAPPER_STATUS (DRVM_MAPPER_STATUS + 0)
  224. #define WAVEIN_MAPPER_STATUS_DEVICE 0
  225. #define WAVEIN_MAPPER_STATUS_MAPPED 1
  226. #define WAVEIN_MAPPER_STATUS_FORMAT 2
  227. // #endif /* WINVER >= 0x30B */
  228. #endif // ifndef MMNOWAVEDEV
  229. #ifndef MMNOMIDIDEV
  230. /****************************************************************************
  231. MIDI device driver support
  232. ****************************************************************************/
  233. #define MODM_USER DRVM_USER
  234. #define MIDM_USER DRVM_USER
  235. #define MODM_MAPPER DRVM_MAPPER
  236. #define MIDM_MAPPER DRVM_MAPPER
  237. #define MODM_INIT DRVM_INIT
  238. #define MIDM_INIT DRVM_INIT
  239. #ifndef MMNOMIDI // This protects the definition of HMIDI in WINMM.H
  240. // Win 3.1 works the same way
  241. typedef struct midiopenstrmid_tag {
  242. DWORD dwStreamID;
  243. UINT uDeviceID;
  244. } MIDIOPENSTRMID;
  245. // MIDI input and output device open information structure
  246. typedef struct midiopendesc_tag {
  247. HMIDI hMidi; // handle
  248. DWORD_PTR dwCallback; // callback
  249. DWORD_PTR dwInstance; // app's private instance information
  250. DWORD_PTR dnDevNode; // DevNode
  251. DWORD cIds; // If stream open, # stream ids
  252. MIDIOPENSTRMID rgIds[1]; // Array of device ID's (actually [cIds])
  253. } MIDIOPENDESC;
  254. typedef MIDIOPENDESC FAR *LPMIDIOPENDESC;
  255. #endif // MMNOMIDI
  256. /* Flags for MODM_OPEN */
  257. #define MIDI_IO_PACKED 0x00000000L /* Compatibility mode */
  258. #define MIDI_IO_COOKED 0x00000002L
  259. // messages sent to modMessage() entry-point function
  260. #define MODM_GETNUMDEVS 1
  261. #define MODM_GETDEVCAPS 2
  262. #define MODM_OPEN 3
  263. #define MODM_CLOSE 4
  264. #define MODM_PREPARE 5
  265. #define MODM_UNPREPARE 6
  266. #define MODM_DATA 7
  267. #define MODM_LONGDATA 8
  268. #define MODM_RESET 9
  269. #define MODM_GETVOLUME 10
  270. #define MODM_SETVOLUME 11
  271. #define MODM_CACHEPATCHES 12
  272. #define MODM_CACHEDRUMPATCHES 13
  273. #if (WINVER >= 0x400)
  274. #define MODM_STRMDATA 14
  275. #define MODM_GETPOS 17
  276. #define MODM_PAUSE 18
  277. #define MODM_RESTART 19
  278. #define MODM_STOP 20
  279. #define MODM_PROPERTIES 21
  280. #define MODM_PREFERRED 22
  281. #define MODM_RECONFIGURE (MODM_USER+0x0768)
  282. #endif
  283. // messages sent to midMessage() entry-point function
  284. #define MIDM_GETNUMDEVS 53
  285. #define MIDM_GETDEVCAPS 54
  286. #define MIDM_OPEN 55
  287. #define MIDM_CLOSE 56
  288. #define MIDM_PREPARE 57
  289. #define MIDM_UNPREPARE 58
  290. #define MIDM_ADDBUFFER 59
  291. #define MIDM_START 60
  292. #define MIDM_STOP 61
  293. #define MIDM_RESET 62
  294. #endif // ifndef MMNOMIDIDEV
  295. #ifndef MMNOAUXDEV
  296. /****************************************************************************
  297. Auxiliary audio device driver support
  298. ****************************************************************************/
  299. #define AUXM_INIT DRVM_INIT
  300. // messages sent to auxMessage() entry-point function
  301. #define AUXDM_GETNUMDEVS 3
  302. #define AUXDM_GETDEVCAPS 4
  303. #define AUXDM_GETVOLUME 5
  304. #define AUXDM_SETVOLUME 6
  305. #endif // ifndef MMNOAUXDEV
  306. // #if (WINVER >= 0x030B)
  307. #ifndef MMNOMIXERDEV
  308. //
  309. // mixer device open information structure
  310. //
  311. //
  312. typedef struct tMIXEROPENDESC
  313. {
  314. HMIXER hmx; // handle that will be used
  315. LPVOID pReserved0; // reserved--driver should ignore
  316. DWORD_PTR dwCallback; // callback
  317. DWORD_PTR dwInstance; // app's private instance information
  318. DWORD_PTR dnDevNode; // if device is PnP
  319. } MIXEROPENDESC, *PMIXEROPENDESC, FAR *LPMIXEROPENDESC;
  320. //
  321. //
  322. //
  323. //
  324. #define MXDM_INIT 100
  325. #define MXDM_USER DRV_USER
  326. #define MXDM_BASE (1)
  327. #define MXDM_GETNUMDEVS (MXDM_BASE + 0)
  328. #define MXDM_GETDEVCAPS (MXDM_BASE + 1)
  329. #define MXDM_OPEN (MXDM_BASE + 2)
  330. #define MXDM_CLOSE (MXDM_BASE + 3)
  331. #define MXDM_GETLINEINFO (MXDM_BASE + 4)
  332. #define MXDM_GETLINECONTROLS (MXDM_BASE + 5)
  333. #define MXDM_GETCONTROLDETAILS (MXDM_BASE + 6)
  334. #define MXDM_SETCONTROLDETAILS (MXDM_BASE + 7)
  335. #endif // MMNOMIXERDEV
  336. // #endif /* ifdef WINVER >= 0x030B */
  337. #if !defined(MMNOTIMERDEV)
  338. /****************************************************************************
  339. Timer device driver support
  340. ****************************************************************************/
  341. typedef struct timerevent_tag {
  342. WORD wDelay; // delay required
  343. WORD wResolution; // resolution required
  344. LPTIMECALLBACK lpFunction; // ptr to callback function
  345. DWORD dwUser; // user DWORD
  346. WORD wFlags; // defines how to program event
  347. WORD wReserved1; // structure packing
  348. } TIMEREVENT;
  349. typedef TIMEREVENT FAR *LPTIMEREVENT;
  350. // messages sent to tddMessage() function
  351. #define TDD_KILLTIMEREVENT (DRV_RESERVED+0) // indices into a table of
  352. #define TDD_SETTIMEREVENT (DRV_RESERVED+4) // functions; thus offset by
  353. #define TDD_GETSYSTEMTIME (DRV_RESERVED+8) // four each time...
  354. #define TDD_GETDEVCAPS (DRV_RESERVED+12) // room for future expansion
  355. #define TDD_BEGINMINPERIOD (DRV_RESERVED+16) // room for future expansion
  356. #define TDD_ENDMINPERIOD (DRV_RESERVED+20) // room for future expansion
  357. #endif // ifndef MMNOTIMERDEV
  358. #ifndef MMNOJOYDEV
  359. /****************************************************************************
  360. Joystick device driver support
  361. ****************************************************************************/
  362. /* RegisterWindowMessage with this to get msg id of config changes */
  363. #define JOY_CONFIGCHANGED_MSGSTRING "MSJSTICK_VJOYD_MSGSTR"
  364. /* pre-defined joystick types */
  365. #define JOY_HW_NONE 0
  366. #define JOY_HW_CUSTOM 1
  367. #define JOY_HW_2A_2B_GENERIC 2
  368. #define JOY_HW_2A_4B_GENERIC 3
  369. #define JOY_HW_2B_GAMEPAD 4
  370. #define JOY_HW_2B_FLIGHTYOKE 5
  371. #define JOY_HW_2B_FLIGHTYOKETHROTTLE 6
  372. #define JOY_HW_3A_2B_GENERIC 7
  373. #define JOY_HW_3A_4B_GENERIC 8
  374. #define JOY_HW_4B_GAMEPAD 9
  375. #define JOY_HW_4B_FLIGHTYOKE 10
  376. #define JOY_HW_4B_FLIGHTYOKETHROTTLE 11
  377. #define JOY_HW_LASTENTRY 12
  378. /* calibration flags */
  379. #define JOY_ISCAL_XY 0x00000001l /* XY are calibrated */
  380. #define JOY_ISCAL_Z 0x00000002l /* Z is calibrated */
  381. #define JOY_ISCAL_R 0x00000004l /* R is calibrated */
  382. #define JOY_ISCAL_U 0x00000008l /* U is calibrated */
  383. #define JOY_ISCAL_V 0x00000010l /* V is calibrated */
  384. #define JOY_ISCAL_POV 0x00000020l /* POV is calibrated */
  385. /* point of view constants */
  386. #define JOY_POV_NUMDIRS 4
  387. #define JOY_POVVAL_FORWARD 0
  388. #define JOY_POVVAL_BACKWARD 1
  389. #define JOY_POVVAL_LEFT 2
  390. #define JOY_POVVAL_RIGHT 3
  391. /* Specific settings for joystick hardware */
  392. #define JOY_HWS_HASZ 0x00000001l /* has Z info? */
  393. #define JOY_HWS_HASPOV 0x00000002l /* point of view hat present */
  394. #define JOY_HWS_POVISBUTTONCOMBOS 0x00000004l /* pov done through combo of buttons */
  395. #define JOY_HWS_POVISPOLL 0x00000008l /* pov done through polling */
  396. #define JOY_HWS_ISYOKE 0x00000010l /* joystick is a flight yoke */
  397. #define JOY_HWS_ISGAMEPAD 0x00000020l /* joystick is a game pad */
  398. #define JOY_HWS_ISCARCTRL 0x00000040l /* joystick is a car controller */
  399. /* X defaults to J1 X axis */
  400. #define JOY_HWS_XISJ1Y 0x00000080l /* X is on J1 Y axis */
  401. #define JOY_HWS_XISJ2X 0x00000100l /* X is on J2 X axis */
  402. #define JOY_HWS_XISJ2Y 0x00000200l /* X is on J2 Y axis */
  403. /* Y defaults to J1 Y axis */
  404. #define JOY_HWS_YISJ1X 0x00000400l /* Y is on J1 X axis */
  405. #define JOY_HWS_YISJ2X 0x00000800l /* Y is on J2 X axis */
  406. #define JOY_HWS_YISJ2Y 0x00001000l /* Y is on J2 Y axis */
  407. /* Z defaults to J2 Y axis */
  408. #define JOY_HWS_ZISJ1X 0x00002000l /* Z is on J1 X axis */
  409. #define JOY_HWS_ZISJ1Y 0x00004000l /* Z is on J1 Y axis */
  410. #define JOY_HWS_ZISJ2X 0x00008000l /* Z is on J2 X axis */
  411. /* POV defaults to J2 Y axis, if it is not button based */
  412. #define JOY_HWS_POVISJ1X 0x00010000l /* pov done through J1 X axis */
  413. #define JOY_HWS_POVISJ1Y 0x00020000l /* pov done through J1 Y axis */
  414. #define JOY_HWS_POVISJ2X 0x00040000l /* pov done through J2 X axis */
  415. /* R defaults to J2 X axis */
  416. #define JOY_HWS_HASR 0x00080000l /* has R (4th axis) info */
  417. #define JOY_HWS_RISJ1X 0x00100000l /* R done through J1 X axis */
  418. #define JOY_HWS_RISJ1Y 0x00200000l /* R done through J1 Y axis */
  419. #define JOY_HWS_RISJ2Y 0x00400000l /* R done through J2 X axis */
  420. /* U & V for future hardware */
  421. #define JOY_HWS_HASU 0x00800000l /* has U (5th axis) info */
  422. #define JOY_HWS_HASV 0x01000000l /* has V (6th axis) info */
  423. /* Usage settings */
  424. #define JOY_US_HASRUDDER 0x00000001l /* joystick configured with rudder */
  425. #define JOY_US_PRESENT 0x00000002l /* is joystick actually present? */
  426. #define JOY_US_ISOEM 0x00000004l /* joystick is an OEM defined type */
  427. /* struct for storing x,y, z, and rudder values */
  428. typedef struct joypos_tag {
  429. DWORD dwX;
  430. DWORD dwY;
  431. DWORD dwZ;
  432. DWORD dwR;
  433. DWORD dwU;
  434. DWORD dwV;
  435. } JOYPOS, FAR *LPJOYPOS;
  436. /* struct for storing ranges */
  437. typedef struct joyrange_tag {
  438. JOYPOS jpMin;
  439. JOYPOS jpMax;
  440. JOYPOS jpCenter;
  441. } JOYRANGE,FAR *LPJOYRANGE;
  442. typedef struct joyreguservalues_tag {
  443. DWORD dwTimeOut; /* value at which to timeout joystick polling */
  444. JOYRANGE jrvRanges; /* range of values app wants returned for axes */
  445. JOYPOS jpDeadZone; /* area around center to be considered
  446. as "dead". specified as a percentage
  447. (0-100). Only X & Y handled by system driver */
  448. } JOYREGUSERVALUES, FAR *LPJOYREGUSERVALUES;
  449. typedef struct joyreghwsettings_tag {
  450. DWORD dwFlags;
  451. DWORD dwNumButtons; /* number of buttons */
  452. } JOYREGHWSETTINGS, FAR *LPJOYHWSETTINGS;
  453. /* range of values returned by the hardware (filled in by calibration) */
  454. typedef struct joyreghwvalues_tag {
  455. JOYRANGE jrvHardware; /* values returned by hardware */
  456. DWORD dwPOVValues[JOY_POV_NUMDIRS];/* POV values returned by hardware */
  457. DWORD dwCalFlags; /* what has been calibrated */
  458. } JOYREGHWVALUES, FAR *LPJOYREGHWVALUES;
  459. /* hardware configuration */
  460. typedef struct joyreghwconfig_tag {
  461. JOYREGHWSETTINGS hws; /* hardware settings */
  462. DWORD dwUsageSettings;/* usage settings */
  463. JOYREGHWVALUES hwv; /* values returned by hardware */
  464. DWORD dwType; /* type of joystick */
  465. DWORD dwReserved; /* reserved for OEM drivers */
  466. } JOYREGHWCONFIG, FAR *LPJOYREGHWCONFIG;
  467. // joystick calibration info structure
  468. typedef struct joycalibrate_tag {
  469. WORD wXbase;
  470. WORD wXdelta;
  471. WORD wYbase;
  472. WORD wYdelta;
  473. WORD wZbase;
  474. WORD wZdelta;
  475. } JOYCALIBRATE;
  476. typedef JOYCALIBRATE FAR *LPJOYCALIBRATE;
  477. // prototype for joystick message function
  478. typedef DWORD (JOYDEVMSGPROC)(DWORD, UINT, LONG, LONG);
  479. typedef JOYDEVMSGPROC FAR *LPJOYDEVMSGPROC;
  480. // messages sent to joystick driver's DriverProc() function
  481. #define JDD_GETNUMDEVS (DRV_RESERVED + 0x0001)
  482. #define JDD_GETDEVCAPS (DRV_RESERVED + 0x0002)
  483. #define JDD_GETPOS (DRV_RESERVED + 0x0101)
  484. #define JDD_SETCALIBRATION (DRV_RESERVED + 0x0102)
  485. #define JDD_CONFIGCHANGED (DRV_RESERVED + 0x0103)
  486. #define JDD_GETPOSEX (DRV_RESERVED + 0x0104)
  487. #endif // ifndef MMNOJOYDEV
  488. #ifndef MAKELRESULT
  489. #define MAKELRESULT(low, high) ((LRESULT)MAKELONG(low, high))
  490. #endif//MAKELRESULT
  491. #ifndef MMNOMCIDEV
  492. /****************************************************************************
  493. MCI device driver support
  494. ****************************************************************************/
  495. // internal MCI messages
  496. #define MCI_OPEN_DRIVER 0x0801
  497. #define MCI_CLOSE_DRIVER 0x0802
  498. #define MAKEMCIRESOURCE(wRet, wRes) MAKELRESULT((wRet), (wRes))
  499. // string return values only used with MAKEMCIRESOURCE
  500. #define MCI_FALSE (MCI_STRING_OFFSET + 19)
  501. #define MCI_TRUE (MCI_STRING_OFFSET + 20)
  502. // resource string return values
  503. #define MCI_FORMAT_RETURN_BASE MCI_FORMAT_MILLISECONDS_S
  504. #define MCI_FORMAT_MILLISECONDS_S (MCI_STRING_OFFSET + 21)
  505. #define MCI_FORMAT_HMS_S (MCI_STRING_OFFSET + 22)
  506. #define MCI_FORMAT_MSF_S (MCI_STRING_OFFSET + 23)
  507. #define MCI_FORMAT_FRAMES_S (MCI_STRING_OFFSET + 24)
  508. #define MCI_FORMAT_SMPTE_24_S (MCI_STRING_OFFSET + 25)
  509. #define MCI_FORMAT_SMPTE_25_S (MCI_STRING_OFFSET + 26)
  510. #define MCI_FORMAT_SMPTE_30_S (MCI_STRING_OFFSET + 27)
  511. #define MCI_FORMAT_SMPTE_30DROP_S (MCI_STRING_OFFSET + 28)
  512. #define MCI_FORMAT_BYTES_S (MCI_STRING_OFFSET + 29)
  513. #define MCI_FORMAT_SAMPLES_S (MCI_STRING_OFFSET + 30)
  514. #define MCI_FORMAT_TMSF_S (MCI_STRING_OFFSET + 31)
  515. #define MCI_VD_FORMAT_TRACK_S (MCI_VD_OFFSET + 5)
  516. #define WAVE_FORMAT_PCM_S (MCI_WAVE_OFFSET + 0)
  517. #define WAVE_MAPPER_S (MCI_WAVE_OFFSET + 1)
  518. #define MCI_SEQ_MAPPER_S (MCI_SEQ_OFFSET + 5)
  519. #define MCI_SEQ_FILE_S (MCI_SEQ_OFFSET + 6)
  520. #define MCI_SEQ_MIDI_S (MCI_SEQ_OFFSET + 7)
  521. #define MCI_SEQ_SMPTE_S (MCI_SEQ_OFFSET + 8)
  522. #define MCI_SEQ_FORMAT_SONGPTR_S (MCI_SEQ_OFFSET + 9)
  523. #define MCI_SEQ_NONE_S (MCI_SEQ_OFFSET + 10)
  524. #define MIDIMAPPER_S (MCI_SEQ_OFFSET + 11)
  525. #define MCI_TABLE_NOT_PRESENT ((UINT)-1)
  526. // parameters for internal version of MCI_OPEN message sent from
  527. // mciOpenDevice() to the driver
  528. typedef struct {
  529. MCIDEVICEID wDeviceID; // device ID
  530. LPCWSTR lpstrParams; // parameter string for entry in SYSTEM.INI
  531. UINT wCustomCommandTable; // custom command table ((-1) if none)
  532. // filled in by the driver
  533. UINT wType; // driver type
  534. // filled in by the driver
  535. } MCI_OPEN_DRIVER_PARMS;
  536. typedef MCI_OPEN_DRIVER_PARMS FAR * LPMCI_OPEN_DRIVER_PARMS;
  537. // maximum length of an MCI device type
  538. #define MCI_MAX_DEVICE_TYPE_LENGTH 80
  539. // flags for mciSendCommandInternal() which direct mciSendString() how to
  540. // interpret the return value
  541. #define MCI_RESOURCE_RETURNED 0x00010000 // resource ID
  542. #define MCI_COLONIZED3_RETURN 0x00020000 // colonized ID, 3 bytes data
  543. #define MCI_COLONIZED4_RETURN 0x00040000 // colonized ID, 4 bytes data
  544. #define MCI_INTEGER_RETURNED 0x00080000 // integer conversion needed
  545. #define MCI_RESOURCE_DRIVER 0x00100000 // driver owns returned resource
  546. // invalid command table ID
  547. #define MCI_NO_COMMAND_TABLE ((UINT)(-1))
  548. // command table information type tags
  549. #define MCI_COMMAND_HEAD 0
  550. #define MCI_STRING 1
  551. #define MCI_INTEGER 2
  552. #define MCI_END_COMMAND 3
  553. #define MCI_RETURN 4
  554. #define MCI_FLAG 5
  555. #define MCI_END_COMMAND_LIST 6
  556. #define MCI_RECT 7
  557. #define MCI_CONSTANT 8
  558. #define MCI_END_CONSTANT 9
  559. #define MCI_HWND 10
  560. #define MCI_HPAL 11
  561. #define MCI_HDC 12
  562. // function prototypes for MCI driver functions
  563. DWORD_PTR APIENTRY mciGetDriverData(MCIDEVICEID wDeviceID);
  564. BOOL APIENTRY mciSetDriverData(MCIDEVICEID wDeviceID, DWORD_PTR dwData);
  565. UINT APIENTRY mciDriverYield (MCIDEVICEID wDeviceID);
  566. BOOL APIENTRY mciDriverNotify (HANDLE hwndCallback, MCIDEVICEID wDeviceID,
  567. UINT uStatus);
  568. UINT APIENTRY mciLoadCommandResource(HANDLE hInstance,
  569. LPCWSTR lpResName, UINT wType);
  570. BOOL APIENTRY mciFreeCommandResource(UINT wTable);
  571. #endif // ifndef MMNOMCIDEV
  572. #ifndef MMNOTASKDEV
  573. /*****************************************************************************
  574. Task support
  575. *****************************************************************************/
  576. // error return values
  577. #define TASKERR_NOTASKSUPPORT 1
  578. #define TASKERR_OUTOFMEMORY 2
  579. // task support function prototypes
  580. #ifdef BUILDDLL /* ;Internal */
  581. typedef VOID (FAR PASCAL TASKCALLBACK) (DWORD_PTR dwInst); /* ;Internal */
  582. #else /* ;Internal */
  583. typedef VOID (TASKCALLBACK) (DWORD_PTR dwInst);
  584. #endif // ifdef BUILDDLL /* ;Internal */
  585. typedef TASKCALLBACK FAR *LPTASKCALLBACK;
  586. UINT APIENTRY mmTaskCreate(LPTASKCALLBACK lpfn, HANDLE FAR * lph, DWORD_PTR dwInst);
  587. VOID APIENTRY mmTaskBlock(DWORD h);
  588. BOOL APIENTRY mmTaskSignal(DWORD h);
  589. VOID APIENTRY mmTaskYield(VOID);
  590. DWORD APIENTRY mmGetCurrentTask(VOID);
  591. #endif // endif MMNOTASKDEV
  592. #define MMDDKINC
  593. #ifdef __cplusplus
  594. }
  595. #endif /* __cplusplus */
  596. #include "poppack.h" /* Revert to default packing */
  597. #endif /* _INC_MMDDK */