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.

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