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.

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