1 /* -*- tab-width: 8; c-basic-offset: 4 -*- */
6 * Copyright 1998 Patrik Stridvall
13 #include "debugtools.h"
17 #include "winversion.h"
19 DEFAULT_DEBUG_CHANNEL(msacm
)
21 /**********************************************************************/
23 static DWORD MSACM_dwProcessesAttached
= 0;
25 /***********************************************************************
26 * MSACM_LibMain32 (MSACM32.init)
28 BOOL WINAPI
MSACM32_LibMain(HINSTANCE hInstDLL
, DWORD fdwReason
, LPVOID lpvReserved
)
30 TRACE("0x%x 0x%lx %p\n", hInstDLL
, fdwReason
, lpvReserved
);
33 case DLL_PROCESS_ATTACH
:
34 if (MSACM_dwProcessesAttached
== 0) {
35 MSACM_hHeap
= HeapCreate(0, 0x10000, 0);
36 MSACM_RegisterAllDrivers();
38 MSACM_dwProcessesAttached
++;
40 case DLL_PROCESS_DETACH
:
41 MSACM_dwProcessesAttached
--;
42 if (MSACM_dwProcessesAttached
== 0) {
43 MSACM_UnregisterAllDrivers();
44 HeapDestroy(MSACM_hHeap
);
45 MSACM_hHeap
= (HANDLE
) NULL
;
48 case DLL_THREAD_ATTACH
:
50 case DLL_THREAD_DETACH
:
58 /***********************************************************************
59 * XRegThunkEntry (MSACM32.1)
61 * No documentation found.
64 /***********************************************************************
65 * acmGetVersion32 (MSACM32.34)
67 DWORD WINAPI
acmGetVersion(void)
69 switch (VERSION_GetVersion()) {
71 FIXME("%s not supported\n", VERSION_GetVersionName());
73 return 0x04000000; /* 4.0.0 */
75 return 0x04000565; /* 4.0.1381 */
79 /***********************************************************************
80 * acmMessage32 (MSACM32.35)
82 * No documentation found.
85 /***********************************************************************
86 * acmMetrics (MSACM32.36)
88 MMRESULT WINAPI
acmMetrics(HACMOBJ hao
, UINT uMetric
, LPVOID pMetric
)
90 PWINE_ACMOBJ pao
= MSACM_GetObj(hao
);
92 PWINE_ACMDRIVERID padid
;
95 FIXME("(0x%08x, %d, %p): stub\n", hao
, uMetric
, pMetric
);
98 case ACM_METRIC_COUNT_DRIVERS
:
101 case ACM_METRIC_COUNT_LOCAL_DRIVERS
:
103 return MMSYSERR_INVALHANDLE
;
104 for (padid
= MSACM_pFirstACMDriverID
; padid
; padid
= padid
->pNextACMDriverID
)
105 if (padid
->bEnabled
/* && (local(padid) || !bLocal) */)
107 *(LPDWORD
)pMetric
= val
;
110 case ACM_METRIC_COUNT_CODECS
:
112 return MMSYSERR_INVALHANDLE
;
115 case ACM_METRIC_COUNT_LOCAL_CODECS
:
116 /* FIXME: don't know how to differentiate codec, converters & filters yet */
117 for (padid
= MSACM_pFirstACMDriverID
; padid
; padid
= padid
->pNextACMDriverID
)
118 if (padid
->bEnabled
/* && (local(padid) || !bLocal) */)
120 *(LPDWORD
)pMetric
= val
;
123 case ACM_METRIC_COUNT_CONVERTERS
:
126 case ACM_METRIC_COUNT_LOCAL_CONVERTERS
:
127 /* FIXME: don't know how to differentiate codec, converters & filters yet */
128 for (padid
= MSACM_pFirstACMDriverID
; padid
; padid
= padid
->pNextACMDriverID
)
129 if (padid
->bEnabled
/* && (local(padid) || !bLocal) */)
131 *(LPDWORD
)pMetric
= val
;
134 case ACM_METRIC_COUNT_FILTERS
:
137 case ACM_METRIC_COUNT_LOCAL_FILTERS
:
138 /* FIXME: don't know how to differentiate codec, converters & filters yet */
139 for (padid
= MSACM_pFirstACMDriverID
; padid
; padid
= padid
->pNextACMDriverID
)
140 if (padid
->bEnabled
/* && (local(padid) || !bLocal) */)
142 *(LPDWORD
)pMetric
= val
;
145 case ACM_METRIC_COUNT_DISABLED
:
148 case ACM_METRIC_COUNT_LOCAL_DISABLED
:
150 return MMSYSERR_INVALHANDLE
;
151 for (padid
= MSACM_pFirstACMDriverID
; padid
; padid
= padid
->pNextACMDriverID
)
152 if (!padid
->bEnabled
/* && (local(padid) || !bLocal) */)
154 *(LPDWORD
)pMetric
= val
;
157 case ACM_METRIC_COUNT_HARDWARE
:
158 case ACM_METRIC_HARDWARE_WAVE_INPUT
:
159 case ACM_METRIC_HARDWARE_WAVE_OUTPUT
:
160 case ACM_METRIC_MAX_SIZE_FORMAT
:
161 case ACM_METRIC_MAX_SIZE_FILTER
:
162 case ACM_METRIC_DRIVER_SUPPORT
:
163 case ACM_METRIC_DRIVER_PRIORITY
:
165 return MMSYSERR_NOTSUPPORTED
;
167 return MMSYSERR_NOERROR
;