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.

579 lines
8.2 KiB

  1. #include "multimediapch.h"
  2. #pragma hdrstop
  3. #define _WINMM_
  4. #include <mmsystem.h>
  5. static
  6. void
  7. WINAPI
  8. MigrateAllDrivers (
  9. void
  10. )
  11. {
  12. return;
  13. }
  14. static
  15. void
  16. WINAPI
  17. MigrateSoundEvents (
  18. void
  19. )
  20. {
  21. return;
  22. }
  23. static
  24. BOOL
  25. WINAPI
  26. PlaySoundW(
  27. LPCWSTR szSoundName,
  28. HMODULE hModule,
  29. DWORD wFlags
  30. )
  31. {
  32. return FALSE;
  33. }
  34. static
  35. BOOL
  36. WINAPI
  37. PlaySoundA(
  38. LPCSTR szSoundName,
  39. HMODULE hModule,
  40. DWORD wFlags
  41. )
  42. {
  43. return FALSE;
  44. }
  45. static
  46. void
  47. WINAPI
  48. WinmmLogoff(
  49. void
  50. )
  51. {
  52. return;
  53. }
  54. static
  55. void
  56. WINAPI
  57. WinmmLogon(
  58. BOOL fConsole
  59. )
  60. {
  61. return;
  62. }
  63. static
  64. UINT
  65. WINAPI
  66. waveOutGetNumDevs(
  67. void
  68. )
  69. {
  70. return 0;
  71. }
  72. static
  73. MMRESULT
  74. WINAPI
  75. waveOutMessage(
  76. IN HWAVEOUT hwo,
  77. IN UINT uMsg,
  78. IN DWORD_PTR dw1,
  79. IN DWORD_PTR dw2
  80. )
  81. {
  82. // Perhaps should raise an exception here. There's no way to know
  83. // the proper return value, and this shouldn't be called if other
  84. // wave functions have failed.
  85. return MMSYSERR_ERROR;
  86. }
  87. static
  88. MMRESULT
  89. WINAPI
  90. mixerClose(
  91. IN OUT HMIXER hmx
  92. )
  93. {
  94. return MMSYSERR_ERROR;
  95. }
  96. static
  97. MMRESULT
  98. WINAPI
  99. mixerGetControlDetailsW(
  100. IN HMIXEROBJ hmxobj,
  101. IN OUT LPMIXERCONTROLDETAILS pmxcd,
  102. IN DWORD fdwDetails
  103. )
  104. {
  105. return MMSYSERR_ERROR;
  106. }
  107. static
  108. MMRESULT
  109. WINAPI
  110. mixerGetDevCapsW(
  111. UINT_PTR uMxId,
  112. LPMIXERCAPS pmxcaps,
  113. UINT cbmxcaps
  114. )
  115. {
  116. return MMSYSERR_ERROR;
  117. }
  118. static
  119. MMRESULT
  120. WINAPI
  121. mixerGetLineControlsW(
  122. IN HMIXEROBJ hmxobj,
  123. IN OUT LPMIXERLINECONTROLSW pmxlc,
  124. IN DWORD fdwControls
  125. )
  126. {
  127. return MMSYSERR_ERROR;
  128. }
  129. MMRESULT
  130. WINAPI
  131. mixerGetID(
  132. IN HMIXEROBJ hmxobj,
  133. OUT UINT FAR *puMxId,
  134. IN DWORD fdwId
  135. )
  136. {
  137. return MMSYSERR_ERROR;
  138. }
  139. static
  140. MMRESULT
  141. WINAPI
  142. mixerGetLineInfoW(
  143. IN HMIXEROBJ hmxobj,
  144. OUT LPMIXERLINEW pmxl,
  145. IN DWORD fdwInfo
  146. )
  147. {
  148. return MMSYSERR_ERROR;
  149. }
  150. static
  151. DWORD
  152. WINAPI
  153. mixerMessage(
  154. IN HMIXER hmx,
  155. IN UINT uMsg,
  156. IN DWORD_PTR dwParam1,
  157. IN DWORD_PTR dwParam2
  158. )
  159. {
  160. // Perhaps should raise an exception here. There's no way to know
  161. // the proper return value, and this shouldn't be called if other
  162. // mixer functions have failed.
  163. return MMSYSERR_ERROR;
  164. }
  165. static
  166. MMRESULT
  167. WINAPI
  168. mixerOpen(
  169. OUT LPHMIXER phmx,
  170. IN UINT uMxId,
  171. IN DWORD_PTR dwCallback,
  172. IN DWORD_PTR dwInstance,
  173. IN DWORD fdwOpen
  174. )
  175. {
  176. return MMSYSERR_ERROR;
  177. }
  178. static
  179. MMRESULT
  180. WINAPI
  181. mixerSetControlDetails(
  182. IN HMIXEROBJ hmxobj,
  183. IN LPMIXERCONTROLDETAILS pmxcd,
  184. IN DWORD fdwDetails
  185. )
  186. {
  187. return MMSYSERR_ERROR;
  188. }
  189. static
  190. MMRESULT
  191. WINAPI
  192. mmioAscend(
  193. HMMIO hmmio,
  194. LPMMCKINFO lpck,
  195. UINT wFlags
  196. )
  197. {
  198. return MMSYSERR_ERROR;
  199. }
  200. static
  201. MMRESULT
  202. WINAPI
  203. mmioClose(
  204. HMMIO hmmio,
  205. UINT wFlags
  206. )
  207. {
  208. return MMSYSERR_ERROR;
  209. }
  210. static
  211. MMRESULT
  212. WINAPI
  213. mmioDescend(
  214. HMMIO hmmio,
  215. LPMMCKINFO lpck,
  216. const MMCKINFO *lpckParent,
  217. UINT wFlags
  218. )
  219. {
  220. return MMSYSERR_ERROR;
  221. }
  222. static
  223. HMMIO
  224. WINAPI
  225. mmioOpenW(
  226. LPWSTR szFilename,
  227. LPMMIOINFO lpmmioinfo,
  228. DWORD dwOpenFlags
  229. )
  230. {
  231. if (lpmmioinfo)
  232. {
  233. // Must fill in wErrorRet field. Docs say, of MMIOERR_INVALIDFILE:
  234. // "Another failure condition occurred. This is the default error for an open-file failure."
  235. lpmmioinfo->wErrorRet = MMIOERR_INVALIDFILE;
  236. }
  237. return NULL;
  238. }
  239. static
  240. LONG
  241. WINAPI
  242. mmioRead(
  243. HMMIO hmmio,
  244. HPSTR pch,
  245. LONG cch
  246. )
  247. {
  248. return -1;
  249. }
  250. static
  251. BOOL
  252. WINAPI
  253. sndPlaySoundW(
  254. IN LPCWSTR pszSound,
  255. IN UINT fuSound
  256. )
  257. {
  258. return FALSE;
  259. }
  260. static
  261. MCIERROR
  262. WINAPI
  263. mciSendCommandW(
  264. IN MCIDEVICEID IDDevice,
  265. IN UINT uMsg,
  266. IN DWORD_PTR fdwCommand,
  267. IN DWORD_PTR dwParam
  268. )
  269. {
  270. return MCIERR_OUT_OF_MEMORY;
  271. }
  272. static
  273. MCIERROR
  274. WINAPI
  275. mciSendStringW(
  276. IN LPCWSTR lpstrCommand,
  277. OUT LPWSTR lpstrReturnString,
  278. IN UINT uReturnLength,
  279. IN HWND hwndCallback
  280. )
  281. {
  282. return MCIERR_OUT_OF_MEMORY;
  283. }
  284. static
  285. MMRESULT
  286. WINAPI
  287. waveOutClose(
  288. IN OUT HWAVEOUT hwo
  289. )
  290. {
  291. return MMSYSERR_ERROR;
  292. }
  293. static
  294. MMRESULT
  295. WINAPI
  296. waveOutUnprepareHeader(
  297. IN HWAVEOUT hwo,
  298. IN OUT LPWAVEHDR pwh,
  299. IN UINT cbwh
  300. )
  301. {
  302. return MMSYSERR_ERROR;
  303. }
  304. static
  305. WINMMAPI
  306. MMRESULT
  307. WINAPI
  308. waveOutReset(
  309. IN HWAVEOUT hwo
  310. )
  311. {
  312. return MMSYSERR_ERROR;
  313. }
  314. static
  315. MMRESULT
  316. WINAPI
  317. waveOutOpen(
  318. OUT LPHWAVEOUT phwo,
  319. IN UINT uDeviceID,
  320. IN LPCWAVEFORMATEX pwfx,
  321. IN DWORD_PTR dwCallback,
  322. IN DWORD_PTR dwInstance,
  323. IN DWORD fdwOpen
  324. )
  325. {
  326. if (!(fdwOpen & WAVE_FORMAT_QUERY))
  327. {
  328. if (!phwo)
  329. {
  330. return MMSYSERR_INVALPARAM;
  331. }
  332. else
  333. {
  334. *phwo = NULL;
  335. }
  336. }
  337. return MMSYSERR_ERROR;
  338. }
  339. static
  340. MMRESULT
  341. WINAPI
  342. waveOutPrepareHeader(
  343. IN HWAVEOUT hwo,
  344. IN OUT LPWAVEHDR pwh,
  345. IN UINT cbwh
  346. )
  347. {
  348. return MMSYSERR_ERROR;
  349. }
  350. static
  351. MMRESULT
  352. WINAPI
  353. waveOutWrite(
  354. IN HWAVEOUT hwo,
  355. IN OUT LPWAVEHDR pwh,
  356. IN UINT cbwh
  357. )
  358. {
  359. return MMSYSERR_ERROR;
  360. }
  361. static
  362. MMRESULT
  363. WINAPI
  364. waveInClose(
  365. IN OUT HWAVEIN hwi
  366. )
  367. {
  368. return MMSYSERR_ERROR;
  369. }
  370. static
  371. MMRESULT
  372. WINAPI
  373. waveInOpen(
  374. OUT LPHWAVEIN phwi,
  375. IN UINT uDeviceID,
  376. IN LPCWAVEFORMATEX pwfx,
  377. IN DWORD_PTR dwCallback,
  378. IN DWORD_PTR dwInstance,
  379. IN DWORD fdwOpen
  380. )
  381. {
  382. if (!(fdwOpen & WAVE_FORMAT_QUERY))
  383. {
  384. if (!phwi)
  385. {
  386. return MMSYSERR_INVALPARAM;
  387. }
  388. else
  389. {
  390. *phwi = NULL;
  391. }
  392. }
  393. return MMSYSERR_ERROR;
  394. }
  395. static
  396. UINT
  397. WINAPI
  398. waveInGetNumDevs(
  399. void
  400. )
  401. {
  402. return 0;
  403. }
  404. static
  405. UINT
  406. WINAPI
  407. midiOutGetNumDevs(
  408. void
  409. )
  410. {
  411. return 0;
  412. }
  413. static
  414. MMRESULT
  415. WINAPI
  416. midiOutClose(
  417. IN OUT HMIDIOUT hmo
  418. )
  419. {
  420. return MMSYSERR_ERROR;
  421. }
  422. static
  423. MMRESULT
  424. WINAPI
  425. midiOutOpen(
  426. OUT LPHMIDIOUT phmo,
  427. IN UINT uDeviceID,
  428. IN DWORD_PTR dwCallback,
  429. IN DWORD_PTR dwInstance,
  430. IN DWORD fdwOpen
  431. )
  432. {
  433. if (!phmo)
  434. {
  435. return MMSYSERR_INVALPARAM;
  436. }
  437. else
  438. {
  439. *phmo = NULL;
  440. }
  441. return MMSYSERR_ERROR;
  442. }
  443. static
  444. MMRESULT
  445. WINAPI
  446. midiOutShortMsg(
  447. IN HMIDIOUT hmo,
  448. IN DWORD dwMsg
  449. )
  450. {
  451. return MMSYSERR_ERROR;
  452. }
  453. static
  454. LONG
  455. WINAPI
  456. mmioSeek(
  457. IN HMMIO hmmio,
  458. IN LONG lOffset,
  459. IN int iOrigin
  460. )
  461. {
  462. return -1;
  463. }
  464. //
  465. // !! WARNING !! The entries below must be in alphabetical order, and are CASE SENSITIVE (eg lower case comes last!)
  466. //
  467. DEFINE_PROCNAME_ENTRIES(winmm)
  468. {
  469. DLPENTRY(MigrateAllDrivers)
  470. DLPENTRY(MigrateSoundEvents)
  471. DLPENTRY(PlaySoundA)
  472. DLPENTRY(PlaySoundW)
  473. DLPENTRY(WinmmLogoff)
  474. DLPENTRY(WinmmLogon)
  475. DLPENTRY(mciSendCommandW)
  476. DLPENTRY(mciSendStringW)
  477. DLPENTRY(midiOutClose)
  478. DLPENTRY(midiOutGetNumDevs)
  479. DLPENTRY(midiOutOpen)
  480. DLPENTRY(midiOutShortMsg)
  481. DLPENTRY(mixerClose)
  482. DLPENTRY(mixerGetControlDetailsW)
  483. DLPENTRY(mixerGetDevCapsW)
  484. DLPENTRY(mixerGetID)
  485. DLPENTRY(mixerGetLineControlsW)
  486. DLPENTRY(mixerGetLineInfoW)
  487. DLPENTRY(mixerMessage)
  488. DLPENTRY(mixerOpen)
  489. DLPENTRY(mixerSetControlDetails)
  490. DLPENTRY(mmioAscend)
  491. DLPENTRY(mmioClose)
  492. DLPENTRY(mmioDescend)
  493. DLPENTRY(mmioOpenW)
  494. DLPENTRY(mmioRead)
  495. DLPENTRY(mmioSeek)
  496. DLPENTRY(sndPlaySoundW)
  497. DLPENTRY(waveInClose)
  498. DLPENTRY(waveInGetNumDevs)
  499. DLPENTRY(waveInOpen)
  500. DLPENTRY(waveOutClose)
  501. DLPENTRY(waveOutGetNumDevs)
  502. DLPENTRY(waveOutMessage)
  503. DLPENTRY(waveOutOpen)
  504. DLPENTRY(waveOutPrepareHeader)
  505. DLPENTRY(waveOutReset)
  506. DLPENTRY(waveOutUnprepareHeader)
  507. DLPENTRY(waveOutWrite)
  508. };
  509. DEFINE_PROCNAME_MAP(winmm)