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
29 #include "wine/debug.h"
36 WINE_DEFAULT_DEBUG_CHANNEL(msacm
);
38 /**********************************************************************/
40 HINSTANCE MSACM_hInstance32
= 0;
42 /***********************************************************************
43 * DllMain (MSACM32.init)
45 BOOL WINAPI
DllMain(HINSTANCE hInstDLL
, DWORD fdwReason
, LPVOID lpvReserved
)
47 TRACE("%p 0x%lx %p\n", hInstDLL
, fdwReason
, lpvReserved
);
50 case DLL_PROCESS_ATTACH
:
51 DisableThreadLibraryCalls(hInstDLL
);
52 MSACM_hHeap
= HeapCreate(0, 0x10000, 0);
53 MSACM_hInstance32
= hInstDLL
;
54 MSACM_RegisterAllDrivers();
56 case DLL_PROCESS_DETACH
:
57 MSACM_UnregisterAllDrivers();
58 HeapDestroy(MSACM_hHeap
);
60 MSACM_hInstance32
= NULL
;
68 /***********************************************************************
69 * XRegThunkEntry (MSACM32.1)
71 * No documentation found.
74 /***********************************************************************
75 * acmGetVersion (MSACM32.@)
77 DWORD WINAPI
acmGetVersion(void)
79 OSVERSIONINFOA version
;
81 version
.dwOSVersionInfoSize
= sizeof(OSVERSIONINFOA
);
82 if (!GetVersionExA( &version
))
85 switch (version
.dwPlatformId
) {
86 case VER_PLATFORM_WIN32_NT
:
87 return 0x04000565; /* 4.0.1381 */
89 FIXME("%lx not supported\n", version
.dwPlatformId
);
90 case VER_PLATFORM_WIN32_WINDOWS
:
91 return 0x04030000; /* 4.3.0 */
95 /***********************************************************************
96 * acmMessage32 (MSACM32.35)
98 * No documentation found.
101 /***********************************************************************
102 * acmMetrics (MSACM32.@)
104 MMRESULT WINAPI
acmMetrics(HACMOBJ hao
, UINT uMetric
, LPVOID pMetric
)
106 PWINE_ACMOBJ pao
= MSACM_GetObj(hao
, WINE_ACMOBJ_DONTCARE
);
108 PWINE_ACMDRIVERID padid
;
111 MMRESULT mmr
= MMSYSERR_NOERROR
;
113 TRACE("(%p, %d, %p);\n", hao
, uMetric
, pMetric
);
115 #define CheckLocal(padid) (!bLocal || ((padid)->fdwSupport & ACMDRIVERDETAILS_SUPPORTF_LOCAL))
118 case ACM_METRIC_COUNT_DRIVERS
:
121 case ACM_METRIC_COUNT_LOCAL_DRIVERS
:
122 if (hao
) return MMSYSERR_INVALHANDLE
;
123 for (padid
= MSACM_pFirstACMDriverID
; padid
; padid
= padid
->pNextACMDriverID
)
124 if (!(padid
->fdwSupport
& ACMDRIVERDETAILS_SUPPORTF_DISABLED
) && CheckLocal(padid
))
126 *(LPDWORD
)pMetric
= val
;
129 case ACM_METRIC_COUNT_CODECS
:
132 case ACM_METRIC_COUNT_LOCAL_CODECS
:
133 if (hao
) return MMSYSERR_INVALHANDLE
;
134 for (padid
= MSACM_pFirstACMDriverID
; padid
; padid
= padid
->pNextACMDriverID
)
135 if (!(padid
->fdwSupport
& ACMDRIVERDETAILS_SUPPORTF_DISABLED
) &&
136 (padid
->fdwSupport
& ACMDRIVERDETAILS_SUPPORTF_CODEC
) &&
139 *(LPDWORD
)pMetric
= val
;
142 case ACM_METRIC_COUNT_CONVERTERS
:
145 case ACM_METRIC_COUNT_LOCAL_CONVERTERS
:
146 if (hao
) return MMSYSERR_INVALHANDLE
;
147 for (padid
= MSACM_pFirstACMDriverID
; padid
; padid
= padid
->pNextACMDriverID
)
148 if (!(padid
->fdwSupport
& ACMDRIVERDETAILS_SUPPORTF_DISABLED
) &&
149 (padid
->fdwSupport
& ACMDRIVERDETAILS_SUPPORTF_CONVERTER
) &&
152 *(LPDWORD
)pMetric
= val
;
155 case ACM_METRIC_COUNT_FILTERS
:
158 case ACM_METRIC_COUNT_LOCAL_FILTERS
:
159 if (hao
) return MMSYSERR_INVALHANDLE
;
160 for (padid
= MSACM_pFirstACMDriverID
; padid
; padid
= padid
->pNextACMDriverID
)
161 if (!(padid
->fdwSupport
& ACMDRIVERDETAILS_SUPPORTF_DISABLED
) &&
162 (padid
->fdwSupport
& ACMDRIVERDETAILS_SUPPORTF_FILTER
) &&
165 *(LPDWORD
)pMetric
= val
;
168 case ACM_METRIC_COUNT_DISABLED
:
171 case ACM_METRIC_COUNT_LOCAL_DISABLED
:
172 if (hao
) return MMSYSERR_INVALHANDLE
;
173 for (padid
= MSACM_pFirstACMDriverID
; padid
; padid
= padid
->pNextACMDriverID
)
174 if ((padid
->fdwSupport
& ACMDRIVERDETAILS_SUPPORTF_DISABLED
) && CheckLocal(padid
))
176 *(LPDWORD
)pMetric
= val
;
179 case ACM_METRIC_MAX_SIZE_FORMAT
:
181 for (padid
= MSACM_pFirstACMDriverID
; padid
; padid
= padid
->pNextACMDriverID
) {
182 if (!(padid
->fdwSupport
& ACMDRIVERDETAILS_SUPPORTF_DISABLED
)) {
183 for (i
= 0; i
< padid
->cFormatTags
; i
++) {
184 if (val
< padid
->aFormatTag
[i
].cbwfx
)
185 val
= padid
->aFormatTag
[i
].cbwfx
;
189 } else if (pao
!= NULL
) {
190 switch (pao
->dwType
) {
191 case WINE_ACMOBJ_DRIVER
:
192 case WINE_ACMOBJ_DRIVERID
:
193 padid
= pao
->pACMDriverID
;
196 return MMSYSERR_INVALHANDLE
;
198 if (!(padid
->fdwSupport
& ACMDRIVERDETAILS_SUPPORTF_DISABLED
)) {
199 for (i
= 0; i
< padid
->cFormatTags
; i
++) {
200 if (val
< padid
->aFormatTag
[i
].cbwfx
)
201 val
= padid
->aFormatTag
[i
].cbwfx
;
205 return MMSYSERR_INVALHANDLE
;
207 *(LPDWORD
)pMetric
= val
;
210 case ACM_METRIC_COUNT_HARDWARE
:
211 case ACM_METRIC_HARDWARE_WAVE_INPUT
:
212 case ACM_METRIC_HARDWARE_WAVE_OUTPUT
:
213 case ACM_METRIC_MAX_SIZE_FILTER
:
214 case ACM_METRIC_DRIVER_SUPPORT
:
215 case ACM_METRIC_DRIVER_PRIORITY
:
217 FIXME("(%p, %d, %p): stub\n", hao
, uMetric
, pMetric
);
218 mmr
= MMSYSERR_NOTSUPPORTED
;