1 /* -*- tab-width: 8; c-basic-offset: 4 -*- */
6 * Copyright 1998 Patrik Stridvall
13 #include "debugtools.h"
18 DEFAULT_DEBUG_CHANNEL(msacm);
20 /**********************************************************************/
22 HINSTANCE MSACM_hInstance32 = 0;
24 /***********************************************************************
25 * MSACM_LibMain (MSACM32.init)
27 BOOL WINAPI MSACM32_LibMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpvReserved)
29 TRACE("0x%x 0x%lx %p\n", hInstDLL, fdwReason, lpvReserved);
32 case DLL_PROCESS_ATTACH:
33 MSACM_hHeap = HeapCreate(0, 0x10000, 0);
34 MSACM_hInstance32 = hInstDLL;
35 MSACM_RegisterAllDrivers();
37 case DLL_PROCESS_DETACH:
38 MSACM_UnregisterAllDrivers();
39 HeapDestroy(MSACM_hHeap);
40 MSACM_hHeap = (HANDLE) NULL;
41 MSACM_hInstance32 = (HINSTANCE)NULL;
43 case DLL_THREAD_ATTACH:
45 case DLL_THREAD_DETACH:
53 /***********************************************************************
54 * XRegThunkEntry (MSACM32.1)
56 * No documentation found.
59 /***********************************************************************
60 * acmGetVersion (MSACM32.34)
62 DWORD WINAPI acmGetVersion(void)
64 OSVERSIONINFOA version;
65 GetVersionExA( &version );
66 switch(version.dwPlatformId)
68 case VER_PLATFORM_WIN32_NT:
69 return 0x04000565; /* 4.0.1381 */
71 FIXME("%ld not supported\n",version.dwPlatformId);
72 case VER_PLATFORM_WIN32_WINDOWS:
73 return 0x04000000; /* 4.0.0 */
77 /***********************************************************************
78 * acmMessage32 (MSACM32.35)
80 * No documentation found.
83 /***********************************************************************
84 * acmMetrics (MSACM32.36)
86 MMRESULT WINAPI acmMetrics(HACMOBJ hao, UINT uMetric, LPVOID pMetric)
88 PWINE_ACMOBJ pao = MSACM_GetObj(hao, WINE_ACMOBJ_DONTCARE);
90 PWINE_ACMDRIVERID padid;
92 MMRESULT mmr = MMSYSERR_NOERROR;
94 TRACE("(0x%08x, %d, %p);\n", hao, uMetric, pMetric);
97 case ACM_METRIC_COUNT_DRIVERS:
100 case ACM_METRIC_COUNT_LOCAL_DRIVERS:
102 return MMSYSERR_INVALHANDLE;
103 for (padid = MSACM_pFirstACMDriverID; padid; padid = padid->pNextACMDriverID)
104 if (padid->bEnabled /* && (local(padid) || !bLocal) */)
106 *(LPDWORD)pMetric = val;
109 case ACM_METRIC_COUNT_CODECS:
111 return MMSYSERR_INVALHANDLE;
114 case ACM_METRIC_COUNT_LOCAL_CODECS:
115 /* FIXME: don't know how to differentiate codec, converters & filters yet */
116 for (padid = MSACM_pFirstACMDriverID; padid; padid = padid->pNextACMDriverID)
117 if (padid->bEnabled /* && (local(padid) || !bLocal) */)
119 *(LPDWORD)pMetric = val;
122 case ACM_METRIC_COUNT_CONVERTERS:
125 case ACM_METRIC_COUNT_LOCAL_CONVERTERS:
126 /* FIXME: don't know how to differentiate codec, converters & filters yet */
127 for (padid = MSACM_pFirstACMDriverID; padid; padid = padid->pNextACMDriverID)
128 if (padid->bEnabled /* && (local(padid) || !bLocal) */)
130 *(LPDWORD)pMetric = val;
133 case ACM_METRIC_COUNT_FILTERS:
136 case ACM_METRIC_COUNT_LOCAL_FILTERS:
137 /* FIXME: don't know how to differentiate codec, converters & filters yet */
138 for (padid = MSACM_pFirstACMDriverID; padid; padid = padid->pNextACMDriverID)
139 if (padid->bEnabled /* && (local(padid) || !bLocal) */)
141 *(LPDWORD)pMetric = val;
144 case ACM_METRIC_COUNT_DISABLED:
147 case ACM_METRIC_COUNT_LOCAL_DISABLED:
149 return MMSYSERR_INVALHANDLE;
150 for (padid = MSACM_pFirstACMDriverID; padid; padid = padid->pNextACMDriverID)
151 if (!padid->bEnabled /* && (local(padid) || !bLocal) */)
153 *(LPDWORD)pMetric = val;
156 case ACM_METRIC_MAX_SIZE_FORMAT:
158 ACMFORMATTAGDETAILSW aftd;
160 aftd.cbStruct = sizeof(aftd);
161 aftd.dwFormatTag = WAVE_FORMAT_UNKNOWN;
163 if (hao == (HACMOBJ)NULL) {
164 mmr = acmFormatTagDetailsW((HACMDRIVER)NULL, &aftd, ACM_FORMATTAGDETAILSF_LARGESTSIZE);
165 } else if (MSACM_GetObj(hao, WINE_ACMOBJ_DRIVER)) {
166 mmr = acmFormatTagDetailsW((HACMDRIVER)hao, &aftd, ACM_FORMATTAGDETAILSF_LARGESTSIZE);
167 } else if (MSACM_GetObj(hao, WINE_ACMOBJ_DRIVERID)) {
170 if (acmDriverOpen(&had, (HACMDRIVERID)hao, 0) == 0) {
171 mmr = acmFormatTagDetailsW((HACMDRIVER)hao, &aftd, ACM_FORMATTAGDETAILSF_LARGESTSIZE);
172 acmDriverClose(had, 0);
175 mmr = MMSYSERR_INVALHANDLE;
177 if (mmr == MMSYSERR_NOERROR) *(LPDWORD)pMetric = aftd.cbFormatSize;
181 case ACM_METRIC_COUNT_HARDWARE:
182 case ACM_METRIC_HARDWARE_WAVE_INPUT:
183 case ACM_METRIC_HARDWARE_WAVE_OUTPUT:
184 case ACM_METRIC_MAX_SIZE_FILTER:
185 case ACM_METRIC_DRIVER_SUPPORT:
186 case ACM_METRIC_DRIVER_PRIORITY:
188 FIXME("(0x%08x, %d, %p): stub\n", hao, uMetric, pMetric);
189 mmr = MMSYSERR_NOTSUPPORTED;