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.

1803 lines
44 KiB

  1. //==========================================================================;
  2. //
  3. // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
  4. // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
  5. // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
  6. // PURPOSE.
  7. //
  8. // Copyright (c) 1992 - 1994 Microsoft Corporation. All Rights Reserved.
  9. //
  10. //--------------------------------------------------------------------------;
  11. //
  12. // acmthunk.c
  13. //
  14. // Description:
  15. // This is a thunk layer to the Audio Compression Manager. It's
  16. // purpose is to allow an application to use the ACM only if it is
  17. // available (like under Win 3.1 and NT where the ACM may or may not
  18. // be installed).
  19. //
  20. // There are two requirements for using this module:
  21. //
  22. // 1. Compile and link with this module before linking to MMSYSTEM.LIB.
  23. // Do *NOT* link with MSACM.LIB.
  24. //
  25. // 2. Before calling any other functions in ACM function set, call
  26. // acmThunkInitialize(). This will cause all dyna-linking to occur.
  27. //
  28. // 3. Before exiting your application, call acmThunkTerminate().
  29. // This will unlink to the ACM and free allocated resources.
  30. //
  31. // NOTE! this could be written more efficiently in Assembly by doing
  32. // a jump to the correct API in the ACM, but this would not be
  33. // portable (easily) on NT. So the arguments will be repushed on the
  34. // stack.. such is life.
  35. //
  36. //==========================================================================;
  37. #include <windows.h>
  38. #include <windowsx.h>
  39. #include <mmsystem.h>
  40. #include <mmreg.h>
  41. #include <msacm.h>
  42. //
  43. //
  44. //
  45. #ifdef WIN32
  46. #define BCODE
  47. #else
  48. #define BCODE _based(_segname("_CODE"))
  49. #endif
  50. //==========================================================================;
  51. //
  52. // Prototypes and String Defines for Dyna-Linking to the ACM
  53. //
  54. //
  55. //==========================================================================;
  56. #define ACMINST_NOT_PRESENT NULL
  57. #define ACMINST_TRY_LINKING (HINSTANCE)(UINT)-1
  58. static HINSTANCE ghinstAcm = ACMINST_TRY_LINKING;
  59. #ifdef WIN32
  60. TCHAR BCODE gszAcmModuleName[] = TEXT("MSACM32.DLL");
  61. #else
  62. char BCODE gszAcmModuleName[] = "MSACM.DLL";
  63. #endif
  64. FARPROC *gpafnAcmFunctions;
  65. PSTR BCODE gapszAcmFunctions[] =
  66. {
  67. "acmGetVersion",
  68. "acmMetrics",
  69. "acmDriverEnum",
  70. #ifdef WIN32
  71. "acmDriverDetailsW",
  72. "acmDriverDetailsA",
  73. #else
  74. "acmDriverDetails",
  75. #endif
  76. #ifdef WIN32
  77. "acmDriverAddW",
  78. "acmDriverAddA",
  79. #else
  80. "acmDriverAdd",
  81. #endif
  82. "acmDriverRemove",
  83. "acmDriverOpen",
  84. "acmDriverClose",
  85. "acmDriverMessage",
  86. "acmDriverID",
  87. "acmDriverPriority",
  88. #ifdef WIN32
  89. "acmFormatTagDetailsW",
  90. "acmFormatTagDetailsA",
  91. #else
  92. "acmFormatTagDetails",
  93. #endif
  94. #ifdef WIN32
  95. "acmFormatTagEnumW",
  96. "acmFormatTagEnumA",
  97. #else
  98. "acmFormatTagEnum",
  99. #endif
  100. #ifdef WIN32
  101. "acmFormatChooseW",
  102. "acmFormatChooseA",
  103. #else
  104. "acmFormatChoose",
  105. #endif
  106. #ifdef WIN32
  107. "acmFormatDetailsW",
  108. "acmFormatDetailsA",
  109. #else
  110. "acmFormatDetails",
  111. #endif
  112. #ifdef WIN32
  113. "acmFormatEnumW",
  114. "acmFormatEnumA",
  115. #else
  116. "acmFormatEnum",
  117. #endif
  118. "acmFormatSuggest",
  119. #ifdef WIN32
  120. "acmFilterTagDetailsW",
  121. "acmFilterTagDetailsA",
  122. #else
  123. "acmFilterTagDetails",
  124. #endif
  125. #ifdef WIN32
  126. "acmFilterTagEnumW",
  127. "acmFilterTagEnumA",
  128. #else
  129. "acmFilterTagEnum",
  130. #endif
  131. #ifdef WIN32
  132. "acmFilterChooseW",
  133. "acmFilterChooseA",
  134. #else
  135. "acmFilterChoose",
  136. #endif
  137. #ifdef WIN32
  138. "acmFilterDetailsW",
  139. "acmFilterDetailsA",
  140. #else
  141. "acmFilterDetails",
  142. #endif
  143. #ifdef WIN32
  144. "acmFilterEnumW",
  145. "acmFilterEnumA",
  146. #else
  147. "acmFilterEnum",
  148. #endif
  149. "acmStreamOpen",
  150. "acmStreamClose",
  151. "acmStreamSize",
  152. "acmStreamConvert",
  153. "acmStreamReset",
  154. "acmStreamPrepareHeader",
  155. "acmStreamUnprepareHeader"
  156. };
  157. #ifdef WIN32
  158. //
  159. // For Win32
  160. //
  161. enum
  162. {
  163. ACMTHUNK_GETVERSION = 0,
  164. ACMTHUNK_METRICS,
  165. ACMTHUNK_DRIVERENUM,
  166. ACMTHUNK_DRIVERDETAILSW,
  167. ACMTHUNK_DRIVERDETAILSA,
  168. ACMTHUNK_DRIVERADDW,
  169. ACMTHUNK_DRIVERADDA,
  170. ACMTHUNK_DRIVERREMOVE,
  171. ACMTHUNK_DRIVEROPEN,
  172. ACMTHUNK_DRIVERCLOSE,
  173. ACMTHUNK_DRIVERMESSAGE,
  174. ACMTHUNK_DRIVERID,
  175. ACMTHUNK_DRIVERPRIORITY,
  176. ACMTHUNK_FORMATTAGDETAILSW,
  177. ACMTHUNK_FORMATTAGDETAILSA,
  178. ACMTHUNK_FORMATTAGENUMW,
  179. ACMTHUNK_FORMATTAGENUMA,
  180. ACMTHUNK_FORMATCHOOSEW,
  181. ACMTHUNK_FORMATCHOOSEA,
  182. ACMTHUNK_FORMATDETAILSW,
  183. ACMTHUNK_FORMATDETAILSA,
  184. ACMTHUNK_FORMATENUMW,
  185. ACMTHUNK_FORMATENUMA,
  186. ACMTHUNK_FORMATSUGGEST,
  187. ACMTHUNK_FILTERTAGDETAILSW,
  188. ACMTHUNK_FILTERTAGDETAILSA,
  189. ACMTHUNK_FILTERTAGENUMW,
  190. ACMTHUNK_FILTERTAGENUMA,
  191. ACMTHUNK_FILTERCHOOSEW,
  192. ACMTHUNK_FILTERCHOOSEA,
  193. ACMTHUNK_FILTERDETAILSW,
  194. ACMTHUNK_FILTERDETAILSA,
  195. ACMTHUNK_FILTERENUMW,
  196. ACMTHUNK_FILTERENUMA,
  197. ACMTHUNK_STREAMOPEN,
  198. ACMTHUNK_STREAMCLOSE,
  199. ACMTHUNK_STREAMSIZE,
  200. ACMTHUNK_STREAMCONVERT,
  201. ACMTHUNK_STREAMRESET,
  202. ACMTHUNK_STREAMPREPAREHEADER,
  203. ACMTHUNK_STREAMUNPREPAREHEADER,
  204. ACMTHUNK_MAX_FUNCTIONS
  205. };
  206. #ifdef _UNICODE
  207. #define ACMTHUNK_DRIVERDETAILS ACMTHUNK_DRIVERDETAILSW
  208. #define ACMTHUNK_DRIVERADD ACMTHUNK_DRIVERADDW
  209. #define ACMTHUNK_FORMATTAGDETAILS ACMTHUNK_FORMATTAGDETAILSW
  210. #define ACMTHUNK_FORMATTAGENUM ACMTHUNK_FORMATTAGENUMW
  211. #define ACMTHUNK_FORMATCHOOSE ACMTHUNK_FORMATCHOOSEW
  212. #define ACMTHUNK_FORMATDETAILS ACMTHUNK_FORMATDETAILSW
  213. #define ACMTHUNK_FORMATENUM ACMTHUNK_FORMATENUMW
  214. #define ACMTHUNK_FILTERTAGDETAILS ACMTHUNK_FILTERTAGDETAILSW
  215. #define ACMTHUNK_FILTERTAGENUM ACMTHUNK_FILTERTAGENUMW
  216. #define ACMTHUNK_FILTERCHOOSE ACMTHUNK_FILTERCHOOSEW
  217. #define ACMTHUNK_FILTERDETAILS ACMTHUNK_FILTERDETAILSW
  218. #define ACMTHUNK_FILTERENUM ACMTHUNK_FILTERENUMW
  219. #else
  220. #define ACMTHUNK_DRIVERDETAILS ACMTHUNK_DRIVERDETAILSA
  221. #define ACMTHUNK_DRIVERADD ACMTHUNK_DRIVERADDA
  222. #define ACMTHUNK_FORMATTAGDETAILS ACMTHUNK_FORMATTAGDETAILSA
  223. #define ACMTHUNK_FORMATTAGENUM ACMTHUNK_FORMATTAGENUMA
  224. #define ACMTHUNK_FORMATCHOOSE ACMTHUNK_FORMATCHOOSEA
  225. #define ACMTHUNK_FORMATDETAILS ACMTHUNK_FORMATDETAILSA
  226. #define ACMTHUNK_FORMATENUM ACMTHUNK_FORMATENUMA
  227. #define ACMTHUNK_FILTERTAGDETAILS ACMTHUNK_FILTERTAGDETAILSA
  228. #define ACMTHUNK_FILTERTAGENUM ACMTHUNK_FILTERTAGENUMA
  229. #define ACMTHUNK_FILTERCHOOSE ACMTHUNK_FILTERCHOOSEA
  230. #define ACMTHUNK_FILTERDETAILS ACMTHUNK_FILTERDETAILSA
  231. #define ACMTHUNK_FILTERENUM ACMTHUNK_FILTERENUMA
  232. #endif
  233. #else // if Win32
  234. //
  235. // For Win16
  236. //
  237. enum
  238. {
  239. ACMTHUNK_GETVERSION = 0,
  240. ACMTHUNK_METRICS,
  241. ACMTHUNK_DRIVERENUM,
  242. ACMTHUNK_DRIVERDETAILS,
  243. ACMTHUNK_DRIVERADD,
  244. ACMTHUNK_DRIVERREMOVE,
  245. ACMTHUNK_DRIVEROPEN,
  246. ACMTHUNK_DRIVERCLOSE,
  247. ACMTHUNK_DRIVERMESSAGE,
  248. ACMTHUNK_DRIVERID,
  249. ACMTHUNK_DRIVERPRIORITY,
  250. ACMTHUNK_FORMATTAGDETAILS,
  251. ACMTHUNK_FORMATTAGENUM,
  252. ACMTHUNK_FORMATCHOOSE,
  253. ACMTHUNK_FORMATDETAILS,
  254. ACMTHUNK_FORMATENUM,
  255. ACMTHUNK_FORMATSUGGEST,
  256. ACMTHUNK_FILTERTAGDETAILS,
  257. ACMTHUNK_FILTERTAGENUM,
  258. ACMTHUNK_FILTERCHOOSE,
  259. ACMTHUNK_FILTERDETAILS,
  260. ACMTHUNK_FILTERENUM,
  261. ACMTHUNK_STREAMOPEN,
  262. ACMTHUNK_STREAMCLOSE,
  263. ACMTHUNK_STREAMSIZE,
  264. ACMTHUNK_STREAMCONVERT,
  265. ACMTHUNK_STREAMRESET,
  266. ACMTHUNK_STREAMPREPAREHEADER,
  267. ACMTHUNK_STREAMUNPREPAREHEADER,
  268. ACMTHUNK_MAX_FUNCTIONS
  269. };
  270. #endif // if WIN32 else
  271. #define ACMTHUNK_SIZE_TABLE_BYTES (ACMTHUNK_MAX_FUNCTIONS * sizeof(FARPROC))
  272. //==========================================================================;
  273. //
  274. //
  275. //
  276. //==========================================================================;
  277. //--------------------------------------------------------------------------;
  278. //
  279. // BOOL acmThunkInitialize
  280. //
  281. // Description:
  282. //
  283. //
  284. // Arguments:
  285. // None.
  286. //
  287. // Return (BOOL):
  288. //
  289. //--------------------------------------------------------------------------;
  290. BOOL FAR PASCAL acmThunkInitialize
  291. (
  292. void
  293. )
  294. {
  295. DWORD (ACMAPI *pfnAcmGetVersion)
  296. (
  297. void
  298. );
  299. UINT fuErrorMode;
  300. DWORD dwVersion;
  301. UINT u;
  302. //
  303. // if we have already linked to the API's, then just succeed...
  304. //
  305. if (NULL != gpafnAcmFunctions)
  306. {
  307. //
  308. // someone isn't satisfied with calling this API only once?
  309. //
  310. return (TRUE);
  311. }
  312. //
  313. // if we have already tried to link to the ACM, then fail this
  314. // call--it isn't present.
  315. //
  316. if (ACMINST_TRY_LINKING != ghinstAcm)
  317. return (FALSE);
  318. //
  319. // try to get a handle on the ACM--if we cannot do this, then fail
  320. //
  321. fuErrorMode = SetErrorMode(SEM_NOOPENFILEERRORBOX);
  322. ghinstAcm = LoadLibrary(gszAcmModuleName);
  323. SetErrorMode(fuErrorMode);
  324. if (ghinstAcm < (HINSTANCE)HINSTANCE_ERROR)
  325. {
  326. ghinstAcm = ACMINST_NOT_PRESENT;
  327. return (FALSE);
  328. }
  329. (FARPROC)pfnAcmGetVersion = GetProcAddress(ghinstAcm, gapszAcmFunctions[ACMTHUNK_GETVERSION]);
  330. if (NULL == pfnAcmGetVersion)
  331. {
  332. FreeLibrary(ghinstAcm);
  333. ghinstAcm = ACMINST_NOT_PRESENT;
  334. return (FALSE);
  335. }
  336. //
  337. // allocate our array of function pointers to the ACM... note that
  338. // this is dynamically allocated so if the ACM is _not_ present,
  339. // then this code and data takes up very little space.
  340. //
  341. gpafnAcmFunctions = (FARPROC *)LocalAlloc(LPTR, ACMTHUNK_SIZE_TABLE_BYTES);
  342. if (NULL == gpafnAcmFunctions)
  343. {
  344. FreeLibrary(ghinstAcm);
  345. ghinstAcm = ACMINST_NOT_PRESENT;
  346. return (FALSE);
  347. }
  348. gpafnAcmFunctions[ACMTHUNK_GETVERSION] = (FARPROC)pfnAcmGetVersion;
  349. //
  350. // if the version of the ACM is *NOT* V2.00 or greater, then
  351. // all other API's are unavailable--so don't waste time trying
  352. // to link to them.
  353. //
  354. dwVersion = (* pfnAcmGetVersion)();
  355. if (0x0200 > HIWORD(dwVersion))
  356. {
  357. return (TRUE);
  358. }
  359. //
  360. // yipee! the ACM V2.00 or greater appears to be installed and
  361. // happy with us--so link to the rest of the nifty cool API's.
  362. //
  363. // start at index 1 since we already linked to acmGetVersion above
  364. //
  365. for (u = 1; u < ACMTHUNK_MAX_FUNCTIONS; u++)
  366. {
  367. gpafnAcmFunctions[u] = GetProcAddress(ghinstAcm, gapszAcmFunctions[u]);
  368. }
  369. //
  370. // finally, return success
  371. //
  372. return (TRUE);
  373. } // acmThunkInitialize()
  374. //--------------------------------------------------------------------------;
  375. //
  376. // BOOL acmThunkTerminate
  377. //
  378. // Description:
  379. //
  380. //
  381. // Arguments:
  382. // None.
  383. //
  384. // Return (BOOL):
  385. //
  386. //--------------------------------------------------------------------------;
  387. BOOL FAR PASCAL acmThunkTerminate
  388. (
  389. void
  390. )
  391. {
  392. //
  393. //
  394. //
  395. if (NULL != gpafnAcmFunctions)
  396. {
  397. LocalFree((HLOCAL)gpafnAcmFunctions);
  398. gpafnAcmFunctions = NULL;
  399. FreeLibrary(ghinstAcm);
  400. ghinstAcm = ACMINST_TRY_LINKING;
  401. }
  402. return (TRUE);
  403. } // acmThunkTerminate()
  404. //==========================================================================;
  405. //
  406. // General Information API's
  407. //
  408. //
  409. //==========================================================================;
  410. DWORD ACMAPI acmGetVersion
  411. (
  412. void
  413. )
  414. {
  415. DWORD (ACMAPI *pfnAcmGetVersion)
  416. (
  417. void
  418. );
  419. DWORD dwVersion;
  420. if (NULL == gpafnAcmFunctions)
  421. return (0L);
  422. (FARPROC)pfnAcmGetVersion = gpafnAcmFunctions[ACMTHUNK_GETVERSION];
  423. if (NULL == pfnAcmGetVersion)
  424. return (0L);
  425. dwVersion = (* pfnAcmGetVersion)();
  426. return (dwVersion);
  427. } // acmGetVersion()
  428. //--------------------------------------------------------------------------;
  429. //--------------------------------------------------------------------------;
  430. MMRESULT ACMAPI acmMetrics
  431. (
  432. HACMOBJ hao,
  433. UINT uMetric,
  434. LPVOID pMetric
  435. )
  436. {
  437. MMRESULT (ACMAPI *pfnAcmMetrics)
  438. (
  439. HACMOBJ hao,
  440. UINT uMetric,
  441. LPVOID pMetric
  442. );
  443. MMRESULT mmr;
  444. if (NULL == gpafnAcmFunctions)
  445. return (MMSYSERR_ERROR);
  446. (FARPROC)pfnAcmMetrics = gpafnAcmFunctions[ACMTHUNK_METRICS];
  447. if (NULL == pfnAcmMetrics)
  448. return (MMSYSERR_ERROR);
  449. mmr = (* pfnAcmMetrics)(hao, uMetric, pMetric);
  450. return (mmr);
  451. } // acmMetrics()
  452. //==========================================================================;
  453. //
  454. // ACM Driver Management API's
  455. //
  456. //
  457. //==========================================================================;
  458. //--------------------------------------------------------------------------;
  459. //--------------------------------------------------------------------------;
  460. MMRESULT ACMAPI acmDriverEnum
  461. (
  462. ACMDRIVERENUMCB fnCallback,
  463. DWORD dwInstance,
  464. DWORD fdwEnum
  465. )
  466. {
  467. MMRESULT (ACMAPI *pfnAcmDriverEnum)
  468. (
  469. ACMDRIVERENUMCB fnCallback,
  470. DWORD dwInstance,
  471. DWORD fdwEnum
  472. );
  473. MMRESULT mmr;
  474. if (NULL == gpafnAcmFunctions)
  475. return (MMSYSERR_ERROR);
  476. (FARPROC)pfnAcmDriverEnum = gpafnAcmFunctions[ACMTHUNK_DRIVERENUM];
  477. if (NULL == pfnAcmDriverEnum)
  478. return (MMSYSERR_ERROR);
  479. mmr = (* pfnAcmDriverEnum)(fnCallback, dwInstance, fdwEnum);
  480. return (mmr);
  481. }
  482. //--------------------------------------------------------------------------;
  483. //--------------------------------------------------------------------------;
  484. MMRESULT ACMAPI acmDriverDetails
  485. (
  486. HACMDRIVERID hadid,
  487. LPACMDRIVERDETAILS padd,
  488. DWORD fdwDetails
  489. )
  490. {
  491. MMRESULT (ACMAPI *pfnAcmDriverDetails)
  492. (
  493. HACMDRIVERID hadid,
  494. LPACMDRIVERDETAILS padd,
  495. DWORD fdwDetails
  496. );
  497. MMRESULT mmr;
  498. if (NULL == gpafnAcmFunctions)
  499. return (MMSYSERR_ERROR);
  500. (FARPROC)pfnAcmDriverDetails = gpafnAcmFunctions[ACMTHUNK_DRIVERDETAILS];
  501. if (NULL == pfnAcmDriverDetails)
  502. return (MMSYSERR_ERROR);
  503. mmr = (* pfnAcmDriverDetails)(hadid, padd, fdwDetails);
  504. return (mmr);
  505. }
  506. #ifdef _UNICODE
  507. MMRESULT ACMAPI acmDriverDetailsA
  508. (
  509. HACMDRIVERID hadid,
  510. LPACMDRIVERDETAILSA padd,
  511. DWORD fdwDetails
  512. )
  513. {
  514. MMRESULT (ACMAPI *pfnAcmDriverDetails)
  515. (
  516. HACMDRIVERID hadid,
  517. LPACMDRIVERDETAILSA padd,
  518. DWORD fdwDetails
  519. );
  520. MMRESULT mmr;
  521. if (NULL == gpafnAcmFunctions)
  522. return (MMSYSERR_ERROR);
  523. (FARPROC)pfnAcmDriverDetails = gpafnAcmFunctions[ACMTHUNK_DRIVERDETAILSA];
  524. if (NULL == pfnAcmDriverDetails)
  525. return (MMSYSERR_ERROR);
  526. mmr = (* pfnAcmDriverDetails)(hadid, padd, fdwDetails);
  527. return (mmr);
  528. }
  529. #endif
  530. //--------------------------------------------------------------------------;
  531. //--------------------------------------------------------------------------;
  532. MMRESULT ACMAPI acmDriverAdd
  533. (
  534. LPHACMDRIVERID phadid,
  535. HINSTANCE hinstModule,
  536. LPARAM lParam,
  537. DWORD dwPriority,
  538. DWORD fdwAdd
  539. )
  540. {
  541. MMRESULT (ACMAPI *pfnAcmDriverAdd)
  542. (
  543. LPHACMDRIVERID phadid,
  544. HINSTANCE hinstModule,
  545. LPARAM lParam,
  546. DWORD dwPriority,
  547. DWORD fdwAdd
  548. );
  549. MMRESULT mmr;
  550. if (NULL == gpafnAcmFunctions)
  551. return (MMSYSERR_ERROR);
  552. (FARPROC)pfnAcmDriverAdd = gpafnAcmFunctions[ACMTHUNK_DRIVERADD];
  553. if (NULL == pfnAcmDriverAdd)
  554. return (MMSYSERR_ERROR);
  555. mmr = (* pfnAcmDriverAdd)(phadid, hinstModule, lParam, dwPriority, fdwAdd);
  556. return (mmr);
  557. }
  558. #ifdef _UNICODE
  559. MMRESULT ACMAPI acmDriverAddA
  560. (
  561. LPHACMDRIVERID phadid,
  562. HINSTANCE hinstModule,
  563. LPARAM lParam,
  564. DWORD dwPriority,
  565. DWORD fdwAdd
  566. )
  567. {
  568. MMRESULT (ACMAPI *pfnAcmDriverAdd)
  569. (
  570. LPHACMDRIVERID phadid,
  571. HINSTANCE hinstModule,
  572. LPARAM lParam,
  573. DWORD dwPriority,
  574. DWORD fdwAdd
  575. );
  576. MMRESULT mmr;
  577. if (NULL == gpafnAcmFunctions)
  578. return (MMSYSERR_ERROR);
  579. (FARPROC)pfnAcmDriverAdd = gpafnAcmFunctions[ACMTHUNK_DRIVERADDA];
  580. if (NULL == pfnAcmDriverAdd)
  581. return (MMSYSERR_ERROR);
  582. mmr = (* pfnAcmDriverAdd)(phadid, hinstModule, lParam, dwPriority, fdwAdd);
  583. return (mmr);
  584. }
  585. #endif
  586. //--------------------------------------------------------------------------;
  587. //--------------------------------------------------------------------------;
  588. MMRESULT ACMAPI acmDriverRemove
  589. (
  590. HACMDRIVERID hadid,
  591. DWORD fdwRemove
  592. )
  593. {
  594. MMRESULT (ACMAPI *pfnAcmDriverRemove)
  595. (
  596. HACMDRIVERID hadid,
  597. DWORD fdwRemove
  598. );
  599. MMRESULT mmr;
  600. if (NULL == gpafnAcmFunctions)
  601. return (MMSYSERR_ERROR);
  602. (FARPROC)pfnAcmDriverRemove = gpafnAcmFunctions[ACMTHUNK_DRIVERREMOVE];
  603. if (NULL == pfnAcmDriverRemove)
  604. return (MMSYSERR_ERROR);
  605. mmr = (* pfnAcmDriverRemove)(hadid, fdwRemove);
  606. return (mmr);
  607. }
  608. //--------------------------------------------------------------------------;
  609. //--------------------------------------------------------------------------;
  610. MMRESULT ACMAPI acmDriverOpen
  611. (
  612. LPHACMDRIVER phad,
  613. HACMDRIVERID hadid,
  614. DWORD fdwOpen
  615. )
  616. {
  617. MMRESULT (ACMAPI *pfnAcmDriverOpen)
  618. (
  619. LPHACMDRIVER phad,
  620. HACMDRIVERID hadid,
  621. DWORD fdwOpen
  622. );
  623. MMRESULT mmr;
  624. if (NULL == gpafnAcmFunctions)
  625. return (MMSYSERR_ERROR);
  626. (FARPROC)pfnAcmDriverOpen = gpafnAcmFunctions[ACMTHUNK_DRIVEROPEN];
  627. if (NULL == pfnAcmDriverOpen)
  628. return (MMSYSERR_ERROR);
  629. mmr = (* pfnAcmDriverOpen)(phad, hadid, fdwOpen);
  630. return (mmr);
  631. }
  632. //--------------------------------------------------------------------------;
  633. //--------------------------------------------------------------------------;
  634. MMRESULT ACMAPI acmDriverClose
  635. (
  636. HACMDRIVER had,
  637. DWORD fdwClose
  638. )
  639. {
  640. MMRESULT (ACMAPI *pfnAcmDriverClose)
  641. (
  642. HACMDRIVER had,
  643. DWORD fdwClose
  644. );
  645. MMRESULT mmr;
  646. if (NULL == gpafnAcmFunctions)
  647. return (MMSYSERR_ERROR);
  648. (FARPROC)pfnAcmDriverClose = gpafnAcmFunctions[ACMTHUNK_DRIVERCLOSE];
  649. if (NULL == pfnAcmDriverClose)
  650. return (MMSYSERR_ERROR);
  651. mmr = (* pfnAcmDriverClose)(had, fdwClose);
  652. return (mmr);
  653. }
  654. //--------------------------------------------------------------------------;
  655. //--------------------------------------------------------------------------;
  656. LRESULT ACMAPI acmDriverMessage
  657. (
  658. HACMDRIVER had,
  659. UINT uMsg,
  660. LPARAM lParam1,
  661. LPARAM lParam2
  662. )
  663. {
  664. LRESULT (ACMAPI *pfnAcmDriverMessage)
  665. (
  666. HACMDRIVER had,
  667. UINT uMsg,
  668. LPARAM lParam1,
  669. LPARAM lParam2
  670. );
  671. LRESULT lr;
  672. if (NULL == gpafnAcmFunctions)
  673. return (MMSYSERR_ERROR);
  674. (FARPROC)pfnAcmDriverMessage = gpafnAcmFunctions[ACMTHUNK_DRIVERMESSAGE];
  675. if (NULL == pfnAcmDriverMessage)
  676. return (MMSYSERR_ERROR);
  677. lr = (* pfnAcmDriverMessage)(had, uMsg, lParam1, lParam2);
  678. return (lr);
  679. }
  680. //--------------------------------------------------------------------------;
  681. //--------------------------------------------------------------------------;
  682. MMRESULT ACMAPI acmDriverID
  683. (
  684. HACMOBJ hao,
  685. LPHACMDRIVERID phadid,
  686. DWORD fdwDriverId
  687. )
  688. {
  689. MMRESULT (ACMAPI *pfnAcmDriverId)
  690. (
  691. HACMOBJ hao,
  692. LPHACMDRIVERID phadid,
  693. DWORD fdwDriverId
  694. );
  695. MMRESULT mmr;
  696. if (NULL == gpafnAcmFunctions)
  697. return (MMSYSERR_ERROR);
  698. (FARPROC)pfnAcmDriverId = gpafnAcmFunctions[ACMTHUNK_DRIVERID];
  699. if (NULL == pfnAcmDriverId)
  700. return (MMSYSERR_ERROR);
  701. mmr = (* pfnAcmDriverId)(hao, phadid, fdwDriverId);
  702. return (mmr);
  703. }
  704. //--------------------------------------------------------------------------;
  705. //--------------------------------------------------------------------------;
  706. MMRESULT ACMAPI acmDriverPriority
  707. (
  708. HACMDRIVERID hadid,
  709. DWORD dwPriority,
  710. DWORD fdwPriority
  711. )
  712. {
  713. MMRESULT (ACMAPI *pfnAcmDriverPriority)
  714. (
  715. HACMDRIVERID hadid,
  716. DWORD dwPriority,
  717. DWORD fdwPriority
  718. );
  719. MMRESULT mmr;
  720. if (NULL == gpafnAcmFunctions)
  721. return (MMSYSERR_ERROR);
  722. (FARPROC)pfnAcmDriverPriority = gpafnAcmFunctions[ACMTHUNK_DRIVERPRIORITY];
  723. if (NULL == pfnAcmDriverPriority)
  724. return (MMSYSERR_ERROR);
  725. mmr = (* pfnAcmDriverPriority)(hadid, dwPriority, fdwPriority);
  726. return (mmr);
  727. }
  728. //==========================================================================;
  729. //
  730. // Format Tag Information API's
  731. //
  732. //
  733. //==========================================================================;
  734. //--------------------------------------------------------------------------;
  735. //--------------------------------------------------------------------------;
  736. MMRESULT ACMAPI acmFormatTagDetails
  737. (
  738. HACMDRIVER had,
  739. LPACMFORMATTAGDETAILS paftd,
  740. DWORD fdwDetails
  741. )
  742. {
  743. MMRESULT (ACMAPI *pfnAcmFormatTagDetails)
  744. (
  745. HACMDRIVER had,
  746. LPACMFORMATTAGDETAILS paftd,
  747. DWORD fdwDetails
  748. );
  749. MMRESULT mmr;
  750. if (NULL == gpafnAcmFunctions)
  751. return (MMSYSERR_ERROR);
  752. (FARPROC)pfnAcmFormatTagDetails = gpafnAcmFunctions[ACMTHUNK_FORMATTAGDETAILS];
  753. if (NULL == pfnAcmFormatTagDetails)
  754. return (MMSYSERR_ERROR);
  755. mmr = (* pfnAcmFormatTagDetails)(had, paftd, fdwDetails);
  756. return (mmr);
  757. } // acmFormatTagDetails()
  758. #ifdef _UNICODE
  759. MMRESULT ACMAPI acmFormatTagDetailsA
  760. (
  761. HACMDRIVER had,
  762. LPACMFORMATTAGDETAILSA paftd,
  763. DWORD fdwDetails
  764. )
  765. {
  766. MMRESULT (ACMAPI *pfnAcmFormatTagDetails)
  767. (
  768. HACMDRIVER had,
  769. LPACMFORMATTAGDETAILSA paftd,
  770. DWORD fdwDetails
  771. );
  772. MMRESULT mmr;
  773. if (NULL == gpafnAcmFunctions)
  774. return (MMSYSERR_ERROR);
  775. (FARPROC)pfnAcmFormatTagDetails = gpafnAcmFunctions[ACMTHUNK_FORMATTAGDETAILSA];
  776. if (NULL == pfnAcmFormatTagDetails)
  777. return (MMSYSERR_ERROR);
  778. mmr = (* pfnAcmFormatTagDetails)(had, paftd, fdwDetails);
  779. return (mmr);
  780. } // acmFormatTagDetails()
  781. #endif
  782. //--------------------------------------------------------------------------;
  783. //--------------------------------------------------------------------------;
  784. MMRESULT ACMAPI acmFormatTagEnum
  785. (
  786. HACMDRIVER had,
  787. LPACMFORMATTAGDETAILS paftd,
  788. ACMFORMATTAGENUMCB fnCallback,
  789. DWORD dwInstance,
  790. DWORD fdwEnum
  791. )
  792. {
  793. MMRESULT (ACMAPI *pfnAcmFormatTagEnum)
  794. (
  795. HACMDRIVER had,
  796. LPACMFORMATTAGDETAILS paftd,
  797. ACMFORMATTAGENUMCB fnCallback,
  798. DWORD dwInstance,
  799. DWORD fdwEnum
  800. );
  801. MMRESULT mmr;
  802. if (NULL == gpafnAcmFunctions)
  803. return (MMSYSERR_ERROR);
  804. (FARPROC)pfnAcmFormatTagEnum = gpafnAcmFunctions[ACMTHUNK_FORMATTAGENUM];
  805. if (NULL == pfnAcmFormatTagEnum)
  806. return (MMSYSERR_ERROR);
  807. mmr = (* pfnAcmFormatTagEnum)(had, paftd, fnCallback, dwInstance, fdwEnum);
  808. return (mmr);
  809. } // acmFormatTagEnum()
  810. #ifdef _UNICODE
  811. MMRESULT ACMAPI acmFormatTagEnumA
  812. (
  813. HACMDRIVER had,
  814. LPACMFORMATTAGDETAILSA paftd,
  815. ACMFORMATTAGENUMCBA fnCallback,
  816. DWORD dwInstance,
  817. DWORD fdwEnum
  818. )
  819. {
  820. MMRESULT (ACMAPI *pfnAcmFormatTagEnum)
  821. (
  822. HACMDRIVER had,
  823. LPACMFORMATTAGDETAILSA paftd,
  824. ACMFORMATTAGENUMCBA fnCallback,
  825. DWORD dwInstance,
  826. DWORD fdwEnum
  827. );
  828. MMRESULT mmr;
  829. if (NULL == gpafnAcmFunctions)
  830. return (MMSYSERR_ERROR);
  831. (FARPROC)pfnAcmFormatTagEnum = gpafnAcmFunctions[ACMTHUNK_FORMATTAGENUMA];
  832. if (NULL == pfnAcmFormatTagEnum)
  833. return (MMSYSERR_ERROR);
  834. mmr = (* pfnAcmFormatTagEnum)(had, paftd, fnCallback, dwInstance, fdwEnum);
  835. return (mmr);
  836. } // acmFormatTagEnum()
  837. #endif
  838. //==========================================================================;
  839. //
  840. // Format Information API's
  841. //
  842. //
  843. //==========================================================================;
  844. //--------------------------------------------------------------------------;
  845. //--------------------------------------------------------------------------;
  846. MMRESULT ACMAPI acmFormatChoose
  847. (
  848. LPACMFORMATCHOOSE pafmtc
  849. )
  850. {
  851. MMRESULT (ACMAPI *pfnAcmFormatChoose)
  852. (
  853. LPACMFORMATCHOOSE pafmtc
  854. );
  855. MMRESULT mmr;
  856. if (NULL == gpafnAcmFunctions)
  857. return (MMSYSERR_ERROR);
  858. (FARPROC)pfnAcmFormatChoose = gpafnAcmFunctions[ACMTHUNK_FORMATCHOOSE];
  859. if (NULL == pfnAcmFormatChoose)
  860. return (MMSYSERR_ERROR);
  861. mmr = (* pfnAcmFormatChoose)(pafmtc);
  862. return (mmr);
  863. }
  864. #ifdef _UNICODE
  865. MMRESULT ACMAPI acmFormatChooseA
  866. (
  867. LPACMFORMATCHOOSEA pafmtc
  868. )
  869. {
  870. MMRESULT (ACMAPI *pfnAcmFormatChoose)
  871. (
  872. LPACMFORMATCHOOSEA pafmtc
  873. );
  874. MMRESULT mmr;
  875. if (NULL == gpafnAcmFunctions)
  876. return (MMSYSERR_ERROR);
  877. (FARPROC)pfnAcmFormatChoose = gpafnAcmFunctions[ACMTHUNK_FORMATCHOOSEA];
  878. if (NULL == pfnAcmFormatChoose)
  879. return (MMSYSERR_ERROR);
  880. mmr = (* pfnAcmFormatChoose)(pafmtc);
  881. return (mmr);
  882. }
  883. #endif
  884. //--------------------------------------------------------------------------;
  885. //--------------------------------------------------------------------------;
  886. MMRESULT ACMAPI acmFormatDetails
  887. (
  888. HACMDRIVER had,
  889. LPACMFORMATDETAILS pafd,
  890. DWORD fdwDetails
  891. )
  892. {
  893. MMRESULT (ACMAPI *pfnAcmFormatDetails)
  894. (
  895. HACMDRIVER had,
  896. LPACMFORMATDETAILS pafd,
  897. DWORD fdwDetails
  898. );
  899. MMRESULT mmr;
  900. if (NULL == gpafnAcmFunctions)
  901. return (MMSYSERR_ERROR);
  902. (FARPROC)pfnAcmFormatDetails = gpafnAcmFunctions[ACMTHUNK_FORMATDETAILS];
  903. if (NULL == pfnAcmFormatDetails)
  904. return (MMSYSERR_ERROR);
  905. mmr = (* pfnAcmFormatDetails)(had, pafd, fdwDetails);
  906. return (mmr);
  907. } // acmFormatDetails()
  908. #ifdef _UNICODE
  909. MMRESULT ACMAPI acmFormatDetailsA
  910. (
  911. HACMDRIVER had,
  912. LPACMFORMATDETAILSA pafd,
  913. DWORD fdwDetails
  914. )
  915. {
  916. MMRESULT (ACMAPI *pfnAcmFormatDetails)
  917. (
  918. HACMDRIVER had,
  919. LPACMFORMATDETAILSA pafd,
  920. DWORD fdwDetails
  921. );
  922. MMRESULT mmr;
  923. if (NULL == gpafnAcmFunctions)
  924. return (MMSYSERR_ERROR);
  925. (FARPROC)pfnAcmFormatDetails = gpafnAcmFunctions[ACMTHUNK_FORMATDETAILSA];
  926. if (NULL == pfnAcmFormatDetails)
  927. return (MMSYSERR_ERROR);
  928. mmr = (* pfnAcmFormatDetails)(had, pafd, fdwDetails);
  929. return (mmr);
  930. } // acmFormatDetails()
  931. #endif
  932. //--------------------------------------------------------------------------;
  933. //--------------------------------------------------------------------------;
  934. MMRESULT ACMAPI acmFormatEnum
  935. (
  936. HACMDRIVER had,
  937. LPACMFORMATDETAILS pafd,
  938. ACMFORMATENUMCB fnCallback,
  939. DWORD dwInstance,
  940. DWORD fdwEnum
  941. )
  942. {
  943. MMRESULT (ACMAPI *pfnAcmFormatEnum)
  944. (
  945. HACMDRIVER had,
  946. LPACMFORMATDETAILS pafd,
  947. ACMFORMATENUMCB fnCallback,
  948. DWORD dwInstance,
  949. DWORD fdwEnum
  950. );
  951. MMRESULT mmr;
  952. if (NULL == gpafnAcmFunctions)
  953. return (MMSYSERR_ERROR);
  954. (FARPROC)pfnAcmFormatEnum = gpafnAcmFunctions[ACMTHUNK_FORMATENUM];
  955. if (NULL == pfnAcmFormatEnum)
  956. return (MMSYSERR_ERROR);
  957. mmr = (* pfnAcmFormatEnum)(had, pafd, fnCallback, dwInstance, fdwEnum);
  958. return (mmr);
  959. }
  960. #ifdef _UNICODE
  961. MMRESULT ACMAPI acmFormatEnumA
  962. (
  963. HACMDRIVER had,
  964. LPACMFORMATDETAILSA pafd,
  965. ACMFORMATENUMCBA fnCallback,
  966. DWORD dwInstance,
  967. DWORD fdwEnum
  968. )
  969. {
  970. MMRESULT (ACMAPI *pfnAcmFormatEnum)
  971. (
  972. HACMDRIVER had,
  973. LPACMFORMATDETAILSA pafd,
  974. ACMFORMATENUMCBA fnCallback,
  975. DWORD dwInstance,
  976. DWORD fdwEnum
  977. );
  978. MMRESULT mmr;
  979. if (NULL == gpafnAcmFunctions)
  980. return (MMSYSERR_ERROR);
  981. (FARPROC)pfnAcmFormatEnum = gpafnAcmFunctions[ACMTHUNK_FORMATENUMA];
  982. if (NULL == pfnAcmFormatEnum)
  983. return (MMSYSERR_ERROR);
  984. mmr = (* pfnAcmFormatEnum)(had, pafd, fnCallback, dwInstance, fdwEnum);
  985. return (mmr);
  986. }
  987. #endif
  988. //--------------------------------------------------------------------------;
  989. //--------------------------------------------------------------------------;
  990. MMRESULT ACMAPI acmFormatSuggest
  991. (
  992. HACMDRIVER had,
  993. LPWAVEFORMATEX pwfxSrc,
  994. LPWAVEFORMATEX pwfxDst,
  995. DWORD cbwfxDst,
  996. DWORD fdwSuggest
  997. )
  998. {
  999. MMRESULT (ACMAPI *pfnAcmFormatSuggest)
  1000. (
  1001. HACMDRIVER had,
  1002. LPWAVEFORMATEX pwfxSrc,
  1003. LPWAVEFORMATEX pwfxDst,
  1004. DWORD cbwfxDst,
  1005. DWORD fdwSuggest
  1006. );
  1007. MMRESULT mmr;
  1008. if (NULL == gpafnAcmFunctions)
  1009. return (MMSYSERR_ERROR);
  1010. (FARPROC)pfnAcmFormatSuggest = gpafnAcmFunctions[ACMTHUNK_FORMATSUGGEST];
  1011. if (NULL == pfnAcmFormatSuggest)
  1012. return (MMSYSERR_ERROR);
  1013. mmr = (* pfnAcmFormatSuggest)(had, pwfxSrc, pwfxDst, cbwfxDst, fdwSuggest);
  1014. return (mmr);
  1015. }
  1016. //==========================================================================;
  1017. //
  1018. // Filter Tag Information API's
  1019. //
  1020. //
  1021. //==========================================================================;
  1022. //--------------------------------------------------------------------------;
  1023. //--------------------------------------------------------------------------;
  1024. MMRESULT ACMAPI acmFilterTagDetails
  1025. (
  1026. HACMDRIVER had,
  1027. LPACMFILTERTAGDETAILS paftd,
  1028. DWORD fdwDetails
  1029. )
  1030. {
  1031. MMRESULT (ACMAPI *pfnAcmFilterTagDetails)
  1032. (
  1033. HACMDRIVER had,
  1034. LPACMFILTERTAGDETAILS paftd,
  1035. DWORD fdwDetails
  1036. );
  1037. MMRESULT mmr;
  1038. if (NULL == gpafnAcmFunctions)
  1039. return (MMSYSERR_ERROR);
  1040. (FARPROC)pfnAcmFilterTagDetails = gpafnAcmFunctions[ACMTHUNK_FILTERTAGDETAILS];
  1041. if (NULL == pfnAcmFilterTagDetails)
  1042. return (MMSYSERR_ERROR);
  1043. mmr = (* pfnAcmFilterTagDetails)(had, paftd, fdwDetails);
  1044. return (mmr);
  1045. } // acmFilterTagDetails()
  1046. #ifdef _UNICODE
  1047. MMRESULT ACMAPI acmFilterTagDetailsA
  1048. (
  1049. HACMDRIVER had,
  1050. LPACMFILTERTAGDETAILSA paftd,
  1051. DWORD fdwDetails
  1052. )
  1053. {
  1054. MMRESULT (ACMAPI *pfnAcmFilterTagDetails)
  1055. (
  1056. HACMDRIVER had,
  1057. LPACMFILTERTAGDETAILSA paftd,
  1058. DWORD fdwDetails
  1059. );
  1060. MMRESULT mmr;
  1061. if (NULL == gpafnAcmFunctions)
  1062. return (MMSYSERR_ERROR);
  1063. (FARPROC)pfnAcmFilterTagDetails = gpafnAcmFunctions[ACMTHUNK_FILTERTAGDETAILSA];
  1064. if (NULL == pfnAcmFilterTagDetails)
  1065. return (MMSYSERR_ERROR);
  1066. mmr = (* pfnAcmFilterTagDetails)(had, paftd, fdwDetails);
  1067. return (mmr);
  1068. } // acmFilterTagDetails()
  1069. #endif
  1070. //--------------------------------------------------------------------------;
  1071. //--------------------------------------------------------------------------;
  1072. MMRESULT ACMAPI acmFilterTagEnum
  1073. (
  1074. HACMDRIVER had,
  1075. LPACMFILTERTAGDETAILS paftd,
  1076. ACMFILTERTAGENUMCB fnCallback,
  1077. DWORD dwInstance,
  1078. DWORD fdwEnum
  1079. )
  1080. {
  1081. MMRESULT (ACMAPI *pfnAcmFilterTagEnum)
  1082. (
  1083. HACMDRIVER had,
  1084. LPACMFILTERTAGDETAILS paftd,
  1085. ACMFILTERTAGENUMCB fnCallback,
  1086. DWORD dwInstance,
  1087. DWORD fdwEnum
  1088. );
  1089. MMRESULT mmr;
  1090. if (NULL == gpafnAcmFunctions)
  1091. return (MMSYSERR_ERROR);
  1092. (FARPROC)pfnAcmFilterTagEnum = gpafnAcmFunctions[ACMTHUNK_FILTERTAGENUM];
  1093. if (NULL == pfnAcmFilterTagEnum)
  1094. return (MMSYSERR_ERROR);
  1095. mmr = (* pfnAcmFilterTagEnum)(had, paftd, fnCallback, dwInstance, fdwEnum);
  1096. return (mmr);
  1097. } // acmFilterTagEnum()
  1098. #ifdef _UNICODE
  1099. MMRESULT ACMAPI acmFilterTagEnumA
  1100. (
  1101. HACMDRIVER had,
  1102. LPACMFILTERTAGDETAILSA paftd,
  1103. ACMFILTERTAGENUMCBA fnCallback,
  1104. DWORD dwInstance,
  1105. DWORD fdwEnum
  1106. )
  1107. {
  1108. MMRESULT (ACMAPI *pfnAcmFilterTagEnum)
  1109. (
  1110. HACMDRIVER had,
  1111. LPACMFILTERTAGDETAILSA paftd,
  1112. ACMFILTERTAGENUMCBA fnCallback,
  1113. DWORD dwInstance,
  1114. DWORD fdwEnum
  1115. );
  1116. MMRESULT mmr;
  1117. if (NULL == gpafnAcmFunctions)
  1118. return (MMSYSERR_ERROR);
  1119. (FARPROC)pfnAcmFilterTagEnum = gpafnAcmFunctions[ACMTHUNK_FILTERTAGENUMA];
  1120. if (NULL == pfnAcmFilterTagEnum)
  1121. return (MMSYSERR_ERROR);
  1122. mmr = (* pfnAcmFilterTagEnum)(had, paftd, fnCallback, dwInstance, fdwEnum);
  1123. return (mmr);
  1124. } // acmFilterTagEnum()
  1125. #endif
  1126. //==========================================================================;
  1127. //
  1128. // Filter Information API's
  1129. //
  1130. //
  1131. //==========================================================================;
  1132. //--------------------------------------------------------------------------;
  1133. //--------------------------------------------------------------------------;
  1134. MMRESULT ACMAPI acmFilterChoose
  1135. (
  1136. LPACMFILTERCHOOSE pafltrc
  1137. )
  1138. {
  1139. MMRESULT (ACMAPI *pfnAcmFilterChoose)
  1140. (
  1141. LPACMFILTERCHOOSE pafltrc
  1142. );
  1143. MMRESULT mmr;
  1144. if (NULL == gpafnAcmFunctions)
  1145. return (MMSYSERR_ERROR);
  1146. (FARPROC)pfnAcmFilterChoose = gpafnAcmFunctions[ACMTHUNK_FILTERCHOOSE];
  1147. if (NULL == pfnAcmFilterChoose)
  1148. return (MMSYSERR_ERROR);
  1149. mmr = (* pfnAcmFilterChoose)(pafltrc);
  1150. return (mmr);
  1151. }
  1152. #ifdef _UNICODE
  1153. MMRESULT ACMAPI acmFilterChooseA
  1154. (
  1155. LPACMFILTERCHOOSEA pafltrc
  1156. )
  1157. {
  1158. MMRESULT (ACMAPI *pfnAcmFilterChoose)
  1159. (
  1160. LPACMFILTERCHOOSEA pafltrc
  1161. );
  1162. MMRESULT mmr;
  1163. if (NULL == gpafnAcmFunctions)
  1164. return (MMSYSERR_ERROR);
  1165. (FARPROC)pfnAcmFilterChoose = gpafnAcmFunctions[ACMTHUNK_FILTERCHOOSEA];
  1166. if (NULL == pfnAcmFilterChoose)
  1167. return (MMSYSERR_ERROR);
  1168. mmr = (* pfnAcmFilterChoose)(pafltrc);
  1169. return (mmr);
  1170. }
  1171. #endif
  1172. //--------------------------------------------------------------------------;
  1173. //--------------------------------------------------------------------------;
  1174. MMRESULT ACMAPI acmFilterDetails
  1175. (
  1176. HACMDRIVER had,
  1177. LPACMFILTERDETAILS pafd,
  1178. DWORD fdwDetails
  1179. )
  1180. {
  1181. MMRESULT (ACMAPI *pfnAcmFilterDetails)
  1182. (
  1183. HACMDRIVER had,
  1184. LPACMFILTERDETAILS pafd,
  1185. DWORD fdwDetails
  1186. );
  1187. MMRESULT mmr;
  1188. if (NULL == gpafnAcmFunctions)
  1189. return (MMSYSERR_ERROR);
  1190. (FARPROC)pfnAcmFilterDetails = gpafnAcmFunctions[ACMTHUNK_FILTERDETAILS];
  1191. if (NULL == pfnAcmFilterDetails)
  1192. return (MMSYSERR_ERROR);
  1193. mmr = (* pfnAcmFilterDetails)(had, pafd, fdwDetails);
  1194. return (mmr);
  1195. } // acmFilterDetails()
  1196. #ifdef _UNICODE
  1197. MMRESULT ACMAPI acmFilterDetailsA
  1198. (
  1199. HACMDRIVER had,
  1200. LPACMFILTERDETAILSA pafd,
  1201. DWORD fdwDetails
  1202. )
  1203. {
  1204. MMRESULT (ACMAPI *pfnAcmFilterDetails)
  1205. (
  1206. HACMDRIVER had,
  1207. LPACMFILTERDETAILSA pafd,
  1208. DWORD fdwDetails
  1209. );
  1210. MMRESULT mmr;
  1211. if (NULL == gpafnAcmFunctions)
  1212. return (MMSYSERR_ERROR);
  1213. (FARPROC)pfnAcmFilterDetails = gpafnAcmFunctions[ACMTHUNK_FILTERDETAILSA];
  1214. if (NULL == pfnAcmFilterDetails)
  1215. return (MMSYSERR_ERROR);
  1216. mmr = (* pfnAcmFilterDetails)(had, pafd, fdwDetails);
  1217. return (mmr);
  1218. } // acmFilterDetails()
  1219. #endif
  1220. //--------------------------------------------------------------------------;
  1221. //--------------------------------------------------------------------------;
  1222. MMRESULT ACMAPI acmFilterEnum
  1223. (
  1224. HACMDRIVER had,
  1225. LPACMFILTERDETAILS pafd,
  1226. ACMFILTERENUMCB fnCallback,
  1227. DWORD dwInstance,
  1228. DWORD fdwEnum
  1229. )
  1230. {
  1231. MMRESULT (ACMAPI *pfnAcmFilterEnum)
  1232. (
  1233. HACMDRIVER had,
  1234. LPACMFILTERDETAILS pafd,
  1235. ACMFILTERENUMCB fnCallback,
  1236. DWORD dwInstance,
  1237. DWORD fdwEnum
  1238. );
  1239. MMRESULT mmr;
  1240. if (NULL == gpafnAcmFunctions)
  1241. return (MMSYSERR_ERROR);
  1242. (FARPROC)pfnAcmFilterEnum = gpafnAcmFunctions[ACMTHUNK_FILTERENUM];
  1243. if (NULL == pfnAcmFilterEnum)
  1244. return (MMSYSERR_ERROR);
  1245. mmr = (* pfnAcmFilterEnum)(had, pafd, fnCallback, dwInstance, fdwEnum);
  1246. return (mmr);
  1247. }
  1248. #ifdef _UNICODE
  1249. MMRESULT ACMAPI acmFilterEnumA
  1250. (
  1251. HACMDRIVER had,
  1252. LPACMFILTERDETAILSA pafd,
  1253. ACMFILTERENUMCBA fnCallback,
  1254. DWORD dwInstance,
  1255. DWORD fdwEnum
  1256. )
  1257. {
  1258. MMRESULT (ACMAPI *pfnAcmFilterEnum)
  1259. (
  1260. HACMDRIVER had,
  1261. LPACMFILTERDETAILSA pafd,
  1262. ACMFILTERENUMCBA fnCallback,
  1263. DWORD dwInstance,
  1264. DWORD fdwEnum
  1265. );
  1266. MMRESULT mmr;
  1267. if (NULL == gpafnAcmFunctions)
  1268. return (MMSYSERR_ERROR);
  1269. (FARPROC)pfnAcmFilterEnum = gpafnAcmFunctions[ACMTHUNK_FILTERENUMA];
  1270. if (NULL == pfnAcmFilterEnum)
  1271. return (MMSYSERR_ERROR);
  1272. mmr = (* pfnAcmFilterEnum)(had, pafd, fnCallback, dwInstance, fdwEnum);
  1273. return (mmr);
  1274. }
  1275. #endif
  1276. //==========================================================================;
  1277. //
  1278. // ACM Stream Management API's
  1279. //
  1280. //
  1281. //==========================================================================;
  1282. //--------------------------------------------------------------------------;
  1283. //--------------------------------------------------------------------------;
  1284. MMRESULT ACMAPI acmStreamOpen
  1285. (
  1286. LPHACMSTREAM phas,
  1287. HACMDRIVER had,
  1288. LPWAVEFORMATEX pwfxSrc,
  1289. LPWAVEFORMATEX pwfxDst,
  1290. LPWAVEFILTER pwfltr,
  1291. DWORD dwCallback,
  1292. DWORD dwInstance,
  1293. DWORD fdwOpen
  1294. )
  1295. {
  1296. MMRESULT (ACMAPI *pfnAcmStreamOpen)
  1297. (
  1298. LPHACMSTREAM phas,
  1299. HACMDRIVER had,
  1300. LPWAVEFORMATEX pwfxSrc,
  1301. LPWAVEFORMATEX pwfxDst,
  1302. LPWAVEFILTER pwfltr,
  1303. DWORD dwCallback,
  1304. DWORD dwInstance,
  1305. DWORD fdwOpen
  1306. );
  1307. MMRESULT mmr;
  1308. if (NULL == gpafnAcmFunctions)
  1309. return (MMSYSERR_ERROR);
  1310. (FARPROC)pfnAcmStreamOpen = gpafnAcmFunctions[ACMTHUNK_STREAMOPEN];
  1311. if (NULL == pfnAcmStreamOpen)
  1312. return (MMSYSERR_ERROR);
  1313. mmr = (* pfnAcmStreamOpen)(phas, had, pwfxSrc, pwfxDst, pwfltr, dwCallback, dwInstance, fdwOpen);
  1314. return (mmr);
  1315. }
  1316. //--------------------------------------------------------------------------;
  1317. //--------------------------------------------------------------------------;
  1318. MMRESULT ACMAPI acmStreamClose
  1319. (
  1320. HACMSTREAM has,
  1321. DWORD fdwClose
  1322. )
  1323. {
  1324. MMRESULT (ACMAPI *pfnAcmStreamClose)
  1325. (
  1326. HACMSTREAM has,
  1327. DWORD fdwClose
  1328. );
  1329. MMRESULT mmr;
  1330. if (NULL == gpafnAcmFunctions)
  1331. return (MMSYSERR_ERROR);
  1332. (FARPROC)pfnAcmStreamClose = gpafnAcmFunctions[ACMTHUNK_STREAMCLOSE];
  1333. if (NULL == pfnAcmStreamClose)
  1334. return (MMSYSERR_ERROR);
  1335. mmr = (* pfnAcmStreamClose)(has, fdwClose);
  1336. return (mmr);
  1337. }
  1338. //--------------------------------------------------------------------------;
  1339. //--------------------------------------------------------------------------;
  1340. MMRESULT ACMAPI acmStreamSize
  1341. (
  1342. HACMSTREAM has,
  1343. DWORD cbInput,
  1344. LPDWORD pdwOutputBytes,
  1345. DWORD fdwSize
  1346. )
  1347. {
  1348. MMRESULT (ACMAPI *pfnAcmStreamSize)
  1349. (
  1350. HACMSTREAM has,
  1351. DWORD cbInput,
  1352. LPDWORD pdwOutputBytes,
  1353. DWORD fdwSize
  1354. );
  1355. MMRESULT mmr;
  1356. if (NULL == gpafnAcmFunctions)
  1357. return (MMSYSERR_ERROR);
  1358. (FARPROC)pfnAcmStreamSize = gpafnAcmFunctions[ACMTHUNK_STREAMSIZE];
  1359. if (NULL == pfnAcmStreamSize)
  1360. return (MMSYSERR_ERROR);
  1361. mmr = (* pfnAcmStreamSize)(has, cbInput, pdwOutputBytes, fdwSize);
  1362. return (mmr);
  1363. }
  1364. //--------------------------------------------------------------------------;
  1365. //--------------------------------------------------------------------------;
  1366. MMRESULT ACMAPI acmStreamConvert
  1367. (
  1368. HACMSTREAM has,
  1369. LPACMSTREAMHEADER pash,
  1370. DWORD fdwConvert
  1371. )
  1372. {
  1373. MMRESULT (ACMAPI *pfnAcmStreamConvert)
  1374. (
  1375. HACMSTREAM has,
  1376. LPACMSTREAMHEADER pash,
  1377. DWORD fdwConvert
  1378. );
  1379. MMRESULT mmr;
  1380. if (NULL == gpafnAcmFunctions)
  1381. return (MMSYSERR_ERROR);
  1382. (FARPROC)pfnAcmStreamConvert = gpafnAcmFunctions[ACMTHUNK_STREAMCONVERT];
  1383. if (NULL == pfnAcmStreamConvert)
  1384. return (MMSYSERR_ERROR);
  1385. mmr = (* pfnAcmStreamConvert)(has, pash, fdwConvert);
  1386. return (mmr);
  1387. }
  1388. //--------------------------------------------------------------------------;
  1389. //--------------------------------------------------------------------------;
  1390. MMRESULT ACMAPI acmStreamReset
  1391. (
  1392. HACMSTREAM has,
  1393. DWORD fdwReset
  1394. )
  1395. {
  1396. MMRESULT (ACMAPI *pfnAcmStreamReset)
  1397. (
  1398. HACMSTREAM has,
  1399. DWORD fdwReset
  1400. );
  1401. MMRESULT mmr;
  1402. if (NULL == gpafnAcmFunctions)
  1403. return (MMSYSERR_ERROR);
  1404. (FARPROC)pfnAcmStreamReset = gpafnAcmFunctions[ACMTHUNK_STREAMRESET];
  1405. if (NULL == pfnAcmStreamReset)
  1406. return (MMSYSERR_ERROR);
  1407. mmr = (* pfnAcmStreamReset)(has, fdwReset);
  1408. return (mmr);
  1409. }
  1410. //--------------------------------------------------------------------------;
  1411. //--------------------------------------------------------------------------;
  1412. MMRESULT ACMAPI acmStreamPrepareHeader
  1413. (
  1414. HACMSTREAM has,
  1415. LPACMSTREAMHEADER pash,
  1416. DWORD fdwPrepare
  1417. )
  1418. {
  1419. MMRESULT (ACMAPI *pfnAcmStreamPrepareHeader)
  1420. (
  1421. HACMSTREAM has,
  1422. LPACMSTREAMHEADER pash,
  1423. DWORD fdwPrepare
  1424. );
  1425. MMRESULT mmr;
  1426. if (NULL == gpafnAcmFunctions)
  1427. return (MMSYSERR_ERROR);
  1428. (FARPROC)pfnAcmStreamPrepareHeader = gpafnAcmFunctions[ACMTHUNK_STREAMPREPAREHEADER];
  1429. if (NULL == pfnAcmStreamPrepareHeader)
  1430. return (MMSYSERR_ERROR);
  1431. mmr = (* pfnAcmStreamPrepareHeader)(has, pash, fdwPrepare);
  1432. return (mmr);
  1433. }
  1434. //--------------------------------------------------------------------------;
  1435. //--------------------------------------------------------------------------;
  1436. MMRESULT ACMAPI acmStreamUnprepareHeader
  1437. (
  1438. HACMSTREAM has,
  1439. LPACMSTREAMHEADER pash,
  1440. DWORD fdwUnprepare
  1441. )
  1442. {
  1443. MMRESULT (ACMAPI *pfnAcmStreamUnprepareHeader)
  1444. (
  1445. HACMSTREAM has,
  1446. LPACMSTREAMHEADER pash,
  1447. DWORD fdwUnprepare
  1448. );
  1449. MMRESULT mmr;
  1450. if (NULL == gpafnAcmFunctions)
  1451. return (MMSYSERR_ERROR);
  1452. (FARPROC)pfnAcmStreamUnprepareHeader = gpafnAcmFunctions[ACMTHUNK_STREAMUNPREPAREHEADER];
  1453. if (NULL == pfnAcmStreamUnprepareHeader)
  1454. return (MMSYSERR_ERROR);
  1455. mmr = (* pfnAcmStreamUnprepareHeader)(has, pash, fdwUnprepare);
  1456. return (mmr);
  1457. }
  1458.