1 /* -*- tab-width: 8; c-basic-offset: 4 -*- */
6 * Copyright 1998 Patrik Stridvall
9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public
11 * License as published by the Free Software Foundation; either
12 * version 2.1 of the License, or (at your option) any later version.
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with this library; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
27 #include "wine/debug.h"
32 WINE_DEFAULT_DEBUG_CHANNEL(msacm);
34 /**********************************************************************/
36 HINSTANCE MSACM_hInstance32 = 0;
38 /***********************************************************************
39 * DllMain (MSACM32.init)
41 BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpvReserved)
43 TRACE("%p 0x%lx %p\n", hInstDLL, fdwReason, lpvReserved);
46 case DLL_PROCESS_ATTACH:
47 MSACM_hHeap = HeapCreate(0, 0x10000, 0);
48 MSACM_hInstance32 = hInstDLL;
49 MSACM_RegisterAllDrivers();
51 case DLL_PROCESS_DETACH:
52 MSACM_UnregisterAllDrivers();
53 HeapDestroy(MSACM_hHeap);
54 MSACM_hHeap = (HANDLE)NULL;
55 MSACM_hInstance32 = NULL;
57 case DLL_THREAD_ATTACH:
59 case DLL_THREAD_DETACH:
67 /***********************************************************************
68 * XRegThunkEntry (MSACM32.1)
70 * No documentation found.
73 /***********************************************************************
74 * acmGetVersion (MSACM32.@)
76 DWORD WINAPI acmGetVersion(void)
78 OSVERSIONINFOA version;
80 version.dwOSVersionInfoSize = sizeof(OSVERSIONINFOA);
81 if (!GetVersionExA( &version ))
84 switch (version.dwPlatformId) {
85 case VER_PLATFORM_WIN32_NT:
86 return 0x04000565; /* 4.0.1381 */
88 FIXME("%lx not supported\n", version.dwPlatformId);
89 case VER_PLATFORM_WIN32_WINDOWS:
90 return 0x04030000; /* 4.3.0 */
94 /***********************************************************************
95 * acmMessage32 (MSACM32.35)
97 * No documentation found.
100 /***********************************************************************
101 * acmMetrics (MSACM32.@)
103 MMRESULT WINAPI acmMetrics(HACMOBJ hao, UINT uMetric, LPVOID pMetric)
105 PWINE_ACMOBJ pao = MSACM_GetObj(hao, WINE_ACMOBJ_DONTCARE);
107 PWINE_ACMDRIVERID padid;
110 MMRESULT mmr = MMSYSERR_NOERROR;
112 TRACE("(%p, %d, %p);\n", hao, uMetric, pMetric);
114 #define CheckLocal(padid) (!bLocal || ((padid)->fdwSupport & ACMDRIVERDETAILS_SUPPORTF_LOCAL))
117 case ACM_METRIC_COUNT_DRIVERS:
120 case ACM_METRIC_COUNT_LOCAL_DRIVERS:
121 if (hao) return MMSYSERR_INVALHANDLE;
122 for (padid = MSACM_pFirstACMDriverID; padid; padid = padid->pNextACMDriverID)
123 if (!(padid->fdwSupport & ACMDRIVERDETAILS_SUPPORTF_DISABLED) && CheckLocal(padid))
125 *(LPDWORD)pMetric = val;
128 case ACM_METRIC_COUNT_CODECS:
131 case ACM_METRIC_COUNT_LOCAL_CODECS:
132 if (hao) return MMSYSERR_INVALHANDLE;
133 for (padid = MSACM_pFirstACMDriverID; padid; padid = padid->pNextACMDriverID)
134 if (!(padid->fdwSupport & ACMDRIVERDETAILS_SUPPORTF_DISABLED) &&
135 (padid->fdwSupport & ACMDRIVERDETAILS_SUPPORTF_CODEC) &&
138 *(LPDWORD)pMetric = val;
141 case ACM_METRIC_COUNT_CONVERTERS:
144 case ACM_METRIC_COUNT_LOCAL_CONVERTERS:
145 if (hao) return MMSYSERR_INVALHANDLE;
146 for (padid = MSACM_pFirstACMDriverID; padid; padid = padid->pNextACMDriverID)
147 if (!(padid->fdwSupport & ACMDRIVERDETAILS_SUPPORTF_DISABLED) &&
148 (padid->fdwSupport & ACMDRIVERDETAILS_SUPPORTF_CONVERTER) &&
151 *(LPDWORD)pMetric = val;
154 case ACM_METRIC_COUNT_FILTERS:
157 case ACM_METRIC_COUNT_LOCAL_FILTERS:
158 if (hao) return MMSYSERR_INVALHANDLE;
159 for (padid = MSACM_pFirstACMDriverID; padid; padid = padid->pNextACMDriverID)
160 if (!(padid->fdwSupport & ACMDRIVERDETAILS_SUPPORTF_DISABLED) &&
161 (padid->fdwSupport & ACMDRIVERDETAILS_SUPPORTF_FILTER) &&
164 *(LPDWORD)pMetric = val;
167 case ACM_METRIC_COUNT_DISABLED:
170 case ACM_METRIC_COUNT_LOCAL_DISABLED:
171 if (hao) return MMSYSERR_INVALHANDLE;
172 for (padid = MSACM_pFirstACMDriverID; padid; padid = padid->pNextACMDriverID)
173 if ((padid->fdwSupport & ACMDRIVERDETAILS_SUPPORTF_DISABLED) && CheckLocal(padid))
175 *(LPDWORD)pMetric = val;
178 case ACM_METRIC_MAX_SIZE_FORMAT:
180 for (padid = MSACM_pFirstACMDriverID; padid; padid = padid->pNextACMDriverID) {
181 if (!(padid->fdwSupport & ACMDRIVERDETAILS_SUPPORTF_DISABLED)) {
182 for (i = 0; i < padid->cFormatTags; i++) {
183 if (val < padid->aFormatTag[i].cbwfx)
184 val = padid->aFormatTag[i].cbwfx;
188 } else if (pao != NULL) {
189 switch (pao->dwType) {
190 case WINE_ACMOBJ_DRIVER:
191 case WINE_ACMOBJ_DRIVERID:
192 padid = pao->pACMDriverID;
195 return MMSYSERR_INVALHANDLE;
197 if (!(padid->fdwSupport & ACMDRIVERDETAILS_SUPPORTF_DISABLED)) {
198 for (i = 0; i < padid->cFormatTags; i++) {
199 if (val < padid->aFormatTag[i].cbwfx)
200 val = padid->aFormatTag[i].cbwfx;
204 return MMSYSERR_INVALHANDLE;
206 *(LPDWORD)pMetric = val;
209 case ACM_METRIC_COUNT_HARDWARE:
210 case ACM_METRIC_HARDWARE_WAVE_INPUT:
211 case ACM_METRIC_HARDWARE_WAVE_OUTPUT:
212 case ACM_METRIC_MAX_SIZE_FILTER:
213 case ACM_METRIC_DRIVER_SUPPORT:
214 case ACM_METRIC_DRIVER_PRIORITY:
216 FIXME("(%p, %d, %p): stub\n", hao, uMetric, pMetric);
217 mmr = MMSYSERR_NOTSUPPORTED;