Leaked source code of windows server 2003
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.

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