c5c097549c63dc23e08f4a49c9f3ad32d144d3ad
[reactos.git] / reactos / dll / win32 / msacm32 / msacm_main.c
1 /*
2 * MSACM library
3 *
4 * Copyright 1998 Patrik Stridvall
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20
21 #include <stdarg.h>
22
23 #include "windef.h"
24 #include "winbase.h"
25 #include "winerror.h"
26 #include "mmsystem.h"
27 #include "mmreg.h"
28 #include "msacm.h"
29 #include "msacmdrv.h"
30 #include "wineacm.h"
31 #include "wine/debug.h"
32
33 WINE_DEFAULT_DEBUG_CHANNEL(msacm);
34
35 /**************************************************************************
36 * DllEntryPoint (MSACM.255)
37 *
38 * MSACM DLL entry point
39 *
40 */
41 BOOL WINAPI MSACM_DllEntryPoint(DWORD fdwReason, HINSTANCE16 hinstDLL, WORD ds,
42 WORD wHeapSize, DWORD dwReserved1, WORD wReserved2)
43 {
44 static HANDLE hndl;
45
46 TRACE("0x%x 0x%lx\n", hinstDLL, fdwReason);
47
48 switch (fdwReason) {
49 case DLL_PROCESS_ATTACH:
50 if (!hndl && !(hndl = LoadLibraryA("MSACM32.DLL"))) {
51 ERR("Could not load sibling MsAcm32.dll\n");
52 return FALSE;
53 }
54 break;
55 case DLL_PROCESS_DETACH:
56 FreeLibrary(hndl);
57 hndl = 0;
58 break;
59 case DLL_THREAD_ATTACH:
60 case DLL_THREAD_DETACH:
61 break;
62 }
63 return TRUE;
64 }
65
66 /***********************************************************************
67 * acmGetVersion (MSACM.7)
68 */
69 DWORD WINAPI acmGetVersion16(void)
70 {
71 return acmGetVersion();
72 }
73
74 /***********************************************************************
75 * acmMetrics (MSACM.8)
76 */
77
78 MMRESULT16 WINAPI acmMetrics16(
79 HACMOBJ16 hao, UINT16 uMetric, LPVOID pMetric)
80 {
81 FIXME("(0x%04x, %d, %p): semi-stub\n", hao, uMetric, pMetric);
82
83 if(!hao) return acmMetrics(0, uMetric, pMetric);
84 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
85 return MMSYSERR_ERROR;
86 }
87
88 /***********************************************************************
89 * acmDriverEnum (MSACM.10)
90 */
91 MMRESULT16 WINAPI acmDriverEnum16(
92 ACMDRIVERENUMCB16 fnCallback, DWORD dwInstance, DWORD fdwEnum)
93 {
94 FIXME("(%p, %ld, %ld): stub\n",
95 fnCallback, dwInstance, fdwEnum
96 );
97 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
98 return MMSYSERR_ERROR;
99 }
100
101 /***********************************************************************
102 * acmDriverDetails (MSACM.11)
103 */
104
105 MMRESULT16 WINAPI acmDriverDetails16(
106 HACMDRIVERID16 hadid, LPACMDRIVERDETAILS16 padd, DWORD fdwDetails)
107 {
108 FIXME("(0x%04x, %p, %ld): stub\n", hadid, padd, fdwDetails);
109 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
110 return MMSYSERR_ERROR;
111 }
112
113 /***********************************************************************
114 * acmDriverAdd (MSACM.12)
115 */
116 MMRESULT16 WINAPI acmDriverAdd16(
117 LPHACMDRIVERID16 phadid, HINSTANCE16 hinstModule,
118 LPARAM lParam, DWORD dwPriority, DWORD fdwAdd)
119 {
120 FIXME("(%p, 0x%04x, %ld, %ld, %ld): stub\n",
121 phadid, hinstModule, lParam, dwPriority, fdwAdd
122 );
123 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
124 return MMSYSERR_ERROR;
125 }
126
127 /***********************************************************************
128 * acmDriverRemove (MSACM.13)
129 */
130 MMRESULT16 WINAPI acmDriverRemove16(
131 HACMDRIVERID16 hadid, DWORD fdwRemove)
132 {
133 FIXME("(0x%04x, %ld): stub\n", hadid, fdwRemove);
134 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
135 return MMSYSERR_ERROR;
136 }
137
138 /***********************************************************************
139 * acmDriverOpen (MSACM.14)
140 */
141 MMRESULT16 WINAPI acmDriverOpen16(
142 LPHACMDRIVER16 phad, HACMDRIVERID16 hadid, DWORD fdwOpen)
143 {
144 FIXME("(%p, 0x%04x, %ld): stub\n", phad, hadid, fdwOpen);
145 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
146 return MMSYSERR_ERROR;
147 }
148
149 /***********************************************************************
150 * acmDriverClose (MSACM.15)
151 */
152 MMRESULT16 WINAPI acmDriverClose16(
153 HACMDRIVER16 had, DWORD fdwClose)
154 {
155 FIXME("(0x%04x, %ld): stub\n", had, fdwClose);
156 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
157 return MMSYSERR_ERROR;
158 }
159
160 /***********************************************************************
161 * acmDriverMessage (MSACM.16)
162 */
163 LRESULT WINAPI acmDriverMessage16(
164 HACMDRIVER16 had, UINT16 uMsg, LPARAM lParam1, LPARAM lParam2)
165 {
166 FIXME("(0x%04x, %d, %ld, %ld): stub\n",
167 had, uMsg, lParam1, lParam2
168 );
169 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
170 return 0;
171 }
172
173 /***********************************************************************
174 * acmDriverID (MSACM.17)
175 */
176 MMRESULT16 WINAPI acmDriverID16(
177 HACMOBJ16 hao, LPHACMDRIVERID16 phadid, DWORD fdwDriverID)
178 {
179 FIXME("(0x%04x, %p, %ld): stub\n", hao, phadid, fdwDriverID);
180 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
181 return MMSYSERR_ERROR;
182 }
183
184 /***********************************************************************
185 * acmDriverPriority (MSACM.18)
186 */
187 MMRESULT16 WINAPI acmDriverPriority16(
188 HACMDRIVERID16 hadid, DWORD dwPriority, DWORD fdwPriority)
189 {
190 FIXME("(0x%04x, %ld, %ld): stub\n",
191 hadid, dwPriority, fdwPriority
192 );
193 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
194 return MMSYSERR_ERROR;
195 }
196
197 /***********************************************************************
198 * acmFormatTagDetails (MSACM.30)
199 */
200 MMRESULT16 WINAPI acmFormatTagDetails16(
201 HACMDRIVER16 had, LPACMFORMATTAGDETAILS16 paftd, DWORD fdwDetails)
202 {
203 FIXME("(0x%04x, %p, %ld): stub\n", had, paftd, fdwDetails);
204 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
205 return MMSYSERR_ERROR;
206 }
207
208 /***********************************************************************
209 * acmFormatTagEnum (MSACM.31)
210 */
211 MMRESULT16 WINAPI acmFormatTagEnum16(
212 HACMDRIVER16 had, LPACMFORMATTAGDETAILS16 paftd,
213 ACMFORMATTAGENUMCB16 fnCallback, DWORD dwInstance, DWORD fdwEnum)
214 {
215 FIXME("(0x%04x, %p, %p, %ld, %ld): stub\n",
216 had, paftd, fnCallback, dwInstance, fdwEnum
217 );
218 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
219 return MMSYSERR_ERROR;
220 }
221
222 /***********************************************************************
223 * acmFormatChoose (MSACM.40)
224 */
225 MMRESULT16 WINAPI acmFormatChoose16(
226 LPACMFORMATCHOOSE16 pafmtc)
227 {
228 FIXME("(%p): stub\n", pafmtc);
229 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
230 return MMSYSERR_ERROR;
231 }
232
233 /***********************************************************************
234 * acmFormatDetails (MSACM.41)
235 */
236 MMRESULT16 WINAPI acmFormatDetails16(
237 HACMDRIVER16 had, LPACMFORMATDETAILS16 pafd, DWORD fdwDetails)
238 {
239 FIXME("(0x%04x, %p, %ld): stub\n", had, pafd, fdwDetails);
240 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
241 return MMSYSERR_ERROR;
242 }
243
244 /***********************************************************************
245 * acmFormatEnum (MSACM.42)
246 */
247 MMRESULT16 WINAPI acmFormatEnum16(
248 HACMDRIVER16 had, LPACMFORMATDETAILS16 pafd,
249 ACMFORMATENUMCB16 fnCallback, DWORD dwInstance, DWORD fdwEnum)
250 {
251 FIXME("(0x%04x, %p, %p, %ld, %ld): stub\n",
252 had, pafd, fnCallback, dwInstance, fdwEnum
253 );
254 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
255 return MMSYSERR_ERROR;
256 }
257
258 /***********************************************************************
259 * acmFormatSuggest (MSACM.45)
260 */
261 MMRESULT16 WINAPI acmFormatSuggest16(
262 HACMDRIVER16 had, LPWAVEFORMATEX pwfxSrc,
263 LPWAVEFORMATEX pwfxDst, DWORD cbwfxDst, DWORD fdwSuggest)
264 {
265 FIXME("(0x%04x, %p, %p, %ld, %ld): stub\n",
266 had, pwfxSrc, pwfxDst, cbwfxDst, fdwSuggest
267 );
268 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
269 return MMSYSERR_ERROR;
270 }
271
272 /***********************************************************************
273 * acmFilterTagDetails (MSACM.50)
274 */
275 MMRESULT16 WINAPI acmFilterTagDetails16(
276 HACMDRIVER16 had, LPACMFILTERTAGDETAILS16 paftd, DWORD fdwDetails)
277 {
278 FIXME("(0x%04x, %p, %ld): stub\n", had, paftd, fdwDetails);
279 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
280 return MMSYSERR_ERROR;
281 }
282
283 /***********************************************************************
284 * acmFilterTagEnum (MSACM.51)
285 */
286 MMRESULT16 WINAPI acmFilterTagEnum16(
287 HACMDRIVER16 had, LPACMFILTERTAGDETAILS16 paftd,
288 ACMFILTERTAGENUMCB16 fnCallback, DWORD dwInstance, DWORD fdwEnum)
289 {
290 FIXME("(0x%04x, %p, %p, %ld, %ld): stub\n",
291 had, paftd, fnCallback, dwInstance, fdwEnum
292 );
293 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
294 return MMSYSERR_ERROR;
295 }
296
297 /***********************************************************************
298 * acmFilterChoose (MSACM.60)
299 */
300 MMRESULT16 WINAPI acmFilterChoose16(
301 LPACMFILTERCHOOSE16 pafltrc)
302 {
303 FIXME("(%p): stub\n", pafltrc);
304 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
305 return MMSYSERR_ERROR;
306 }
307
308 /***********************************************************************
309 * acmFilterDetails (MSACM.61)
310 */
311 MMRESULT16 WINAPI acmFilterDetails16(
312 HACMDRIVER16 had, LPACMFILTERDETAILS16 pafd, DWORD fdwDetails)
313 {
314 FIXME("(0x%04x, %p, %ld): stub\n", had, pafd, fdwDetails);
315 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
316 return MMSYSERR_ERROR;
317 }
318
319 /***********************************************************************
320 * acmFilterEnum (MSACM.62)
321 */
322 MMRESULT16 WINAPI acmFilterEnum16(
323 HACMDRIVER16 had, LPACMFILTERDETAILS16 pafd,
324 ACMFILTERENUMCB16 fnCallback, DWORD dwInstance, DWORD fdwEnum)
325 {
326 FIXME("(0x%04x, %p, %p, %ld, %ld): stub\n",
327 had, pafd, fnCallback, dwInstance, fdwEnum
328 );
329 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
330 return MMSYSERR_ERROR;
331 }
332
333 /***********************************************************************
334 * acmStreamOpen (MSACM.70)
335 */
336 MMRESULT16 WINAPI acmStreamOpen16(
337 LPHACMSTREAM16 phas, HACMDRIVER16 had,
338 LPWAVEFORMATEX pwfxSrc, LPWAVEFORMATEX pwfxDst,
339 LPWAVEFILTER pwfltr, DWORD dwCallback,
340 DWORD dwInstance, DWORD fdwOpen)
341 {
342 FIXME("(%p, 0x%04x, %p, %p, %p, %ld, %ld, %ld): stub\n",
343 phas, had, pwfxSrc, pwfxDst, pwfltr,
344 dwCallback, dwInstance, fdwOpen
345 );
346 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
347 return MMSYSERR_ERROR;
348 }
349
350 /***********************************************************************
351 * acmStreamClose (MSACM.71)
352 */
353 MMRESULT16 WINAPI acmStreamClose16(
354 HACMSTREAM16 has, DWORD fdwClose)
355 {
356 FIXME("(0x%04x, %ld): stub\n", has, fdwClose);
357 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
358 return MMSYSERR_ERROR;
359 }
360
361 /***********************************************************************
362 * acmStreamSize (MSACM.72)
363 */
364 MMRESULT16 WINAPI acmStreamSize16(
365 HACMSTREAM16 has, DWORD cbInput,
366 LPDWORD pdwOutputBytes, DWORD fdwSize)
367 {
368 FIXME("(0x%04x, %ld, %p, %ld): stub\n",
369 has, cbInput, pdwOutputBytes, fdwSize
370 );
371 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
372 return MMSYSERR_ERROR;
373 }
374
375 /***********************************************************************
376 * acmStreamConvert (MSACM.75)
377 */
378 MMRESULT16 WINAPI acmStreamConvert16(
379 HACMSTREAM16 has, LPACMSTREAMHEADER16 pash, DWORD fdwConvert)
380 {
381 FIXME("(0x%04x, %p, %ld): stub\n", has, pash, fdwConvert);
382 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
383 return MMSYSERR_ERROR;
384 }
385
386 /***********************************************************************
387 * acmStreamReset (MSACM.76)
388 */
389 MMRESULT16 WINAPI acmStreamReset16(
390 HACMSTREAM16 has, DWORD fdwReset)
391 {
392 FIXME("(0x%04x, %ld): stub\n", has, fdwReset);
393 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
394 return MMSYSERR_ERROR;
395 }
396
397 /***********************************************************************
398 * acmStreamPrepareHeader (MSACM.77)
399 */
400 MMRESULT16 WINAPI acmStreamPrepareHeader16(
401 HACMSTREAM16 has, LPACMSTREAMHEADER16 pash, DWORD fdwPrepare)
402 {
403 FIXME("(0x%04x, %p, %ld): stub\n", has, pash, fdwPrepare);
404 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
405 return MMSYSERR_ERROR;
406 }
407
408 /***********************************************************************
409 * acmStreamUnprepareHeader (MSACM.78)
410 */
411 MMRESULT16 WINAPI acmStreamUnprepareHeader16(
412 HACMSTREAM16 has, LPACMSTREAMHEADER16 pash, DWORD fdwUnprepare)
413 {
414 FIXME("(0x%04x, %p, %ld): stub\n",
415 has, pash, fdwUnprepare
416 );
417 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
418 return MMSYSERR_ERROR;
419 }
420
421 /***********************************************************************
422 * ACMAPPLICATIONEXIT (MSACM.150)
423 * FIXME
424 * No documentation found.
425 */
426
427 /***********************************************************************
428 * ACMHUGEPAGELOCK (MSACM.175)
429 *FIXME
430 * No documentation found.
431 */
432
433 /***********************************************************************
434 * ACMHUGEPAGEUNLOCK (MSACM.176)
435 * FIXME
436 * No documentation found.
437 */
438
439 /***********************************************************************
440 * ACMOPENCONVERSION (MSACM.200)
441 * FIXME
442 * No documentation found.
443 */
444
445 /***********************************************************************
446 * ACMCLOSECONVERSION (MSACM.201)
447 * FIXME
448 * No documentation found.
449 */
450
451 /***********************************************************************
452 * ACMCONVERT (MSACM.202)
453 * FIXME
454 * No documentation found.
455 */
456
457 /***********************************************************************
458 * ACMCHOOSEFORMAT (MSACM.203)
459 * FIXME
460 * No documentation found.
461 */
462
463