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.

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