ReactOS  0.4.14-dev-323-g6fe6a88
msacm32_main.c File Reference
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "wine/debug.h"
#include "mmsystem.h"
#include "mmreg.h"
#include "msacm.h"
#include "msacmdrv.h"
#include "wineacm.h"
Include dependency graph for msacm32_main.c:

Go to the source code of this file.

Macros

#define NOBITMAP
 
#define CheckLocal(padid)   (!bLocal || ((padid)->fdwSupport & ACMDRIVERDETAILS_SUPPORTF_LOCAL))
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (msacm)
 
BOOL WINAPI DllMain (HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpvReserved)
 
DWORD WINAPI acmGetVersion (void)
 
MMRESULT WINAPI acmMetrics (HACMOBJ hao, UINT uMetric, LPVOID pMetric)
 

Variables

HINSTANCE MSACM_hInstance32 = 0
 

Macro Definition Documentation

◆ CheckLocal

#define CheckLocal (   padid)    (!bLocal || ((padid)->fdwSupport & ACMDRIVERDETAILS_SUPPORTF_LOCAL))

◆ NOBITMAP

#define NOBITMAP

Definition at line 30 of file msacm32_main.c.

Function Documentation

◆ acmGetVersion()

DWORD WINAPI acmGetVersion ( void  )

Definition at line 76 of file msacm32_main.c.

77 {
79 
80  version.dwOSVersionInfoSize = sizeof(OSVERSIONINFOA);
81  if (!GetVersionExA( &version ))
82  return 0x04030000;
83 
84  switch (version.dwPlatformId) {
86  return 0x04000565; /* 4.0.1381 */
88  return 0x02010000; /* 2.1 */
89  default:
90  FIXME("%x not supported\n", version.dwPlatformId);
91  /* fall through */
93  return 0x04030000; /* 4.3.0 */
94  }
95 }
#define VER_PLATFORM_WIN32_NT
Definition: rtltypes.h:236
#define VER_PLATFORM_WIN32s
Definition: rtltypes.h:234
#define FIXME(fmt,...)
Definition: debug.h:110
static const WCHAR version[]
Definition: asmname.c:66
BOOL WINAPI GetVersionExA(IN LPOSVERSIONINFOA lpVersionInformation)
Definition: version.c:69
struct _OSVERSIONINFOA OSVERSIONINFOA
#define VER_PLATFORM_WIN32_WINDOWS
Definition: rtltypes.h:235

Referenced by acmDriverOpen(), and driver_tests().

◆ acmMetrics()

MMRESULT WINAPI acmMetrics ( HACMOBJ  hao,
UINT  uMetric,
LPVOID  pMetric 
)

Definition at line 106 of file msacm32_main.c.

107 {
109  BOOL bLocal = TRUE;
110  PWINE_ACMDRIVERID padid;
111  DWORD val = 0;
112  unsigned int i;
114 
115  TRACE("(%p, %d, %p);\n", hao, uMetric, pMetric);
116 
117 #define CheckLocal(padid) (!bLocal || ((padid)->fdwSupport & ACMDRIVERDETAILS_SUPPORTF_LOCAL))
118 
119  switch (uMetric) {
121  bLocal = FALSE;
122  /* fall through */
124  if (hao) return MMSYSERR_INVALHANDLE;
125  if (!pMetric) return MMSYSERR_INVALPARAM;
126  for (padid = MSACM_pFirstACMDriverID; padid; padid = padid->pNextACMDriverID)
127  if (!(padid->fdwSupport & ACMDRIVERDETAILS_SUPPORTF_DISABLED) && CheckLocal(padid))
128  val++;
129  *(LPDWORD)pMetric = val;
130  break;
131 
133  bLocal = FALSE;
134  /* fall through */
136  if (hao) return MMSYSERR_INVALHANDLE;
137  if (!pMetric) return MMSYSERR_INVALPARAM;
138  for (padid = MSACM_pFirstACMDriverID; padid; padid = padid->pNextACMDriverID)
141  CheckLocal(padid))
142  val++;
143  *(LPDWORD)pMetric = val;
144  break;
145 
147  bLocal = FALSE;
148  /* fall through */
150  if (hao) return MMSYSERR_INVALHANDLE;
151  if (!pMetric) return MMSYSERR_INVALPARAM;
152  for (padid = MSACM_pFirstACMDriverID; padid; padid = padid->pNextACMDriverID)
155  CheckLocal(padid))
156  val++;
157  *(LPDWORD)pMetric = val;
158  break;
159 
161  bLocal = FALSE;
162  /* fall through */
164  if (hao) return MMSYSERR_INVALHANDLE;
165  if (!pMetric) return MMSYSERR_INVALPARAM;
166  for (padid = MSACM_pFirstACMDriverID; padid; padid = padid->pNextACMDriverID)
169  CheckLocal(padid))
170  val++;
171  *(LPDWORD)pMetric = val;
172  break;
173 
175  bLocal = FALSE;
176  /* fall through */
178  if (hao) return MMSYSERR_INVALHANDLE;
179  if (!pMetric) return MMSYSERR_INVALPARAM;
180  for (padid = MSACM_pFirstACMDriverID; padid; padid = padid->pNextACMDriverID)
182  val++;
183  *(LPDWORD)pMetric = val;
184  break;
185 
187  if (hao == NULL) {
188  for (padid = MSACM_pFirstACMDriverID; padid; padid = padid->pNextACMDriverID) {
190  for (i = 0; i < padid->cFormatTags; i++) {
191  if (val < padid->aFormatTag[i].cbwfx)
192  val = padid->aFormatTag[i].cbwfx;
193  }
194  }
195  }
196  } else if (pao != NULL) {
197  switch (pao->dwType) {
198  case WINE_ACMOBJ_DRIVER:
200  padid = pao->pACMDriverID;
201  break;
202  default:
203  return MMSYSERR_INVALHANDLE;
204  }
206  for (i = 0; i < padid->cFormatTags; i++) {
207  if (val < padid->aFormatTag[i].cbwfx)
208  val = padid->aFormatTag[i].cbwfx;
209  }
210  }
211  } else {
212  return MMSYSERR_INVALHANDLE;
213  }
214  if (!pMetric) return MMSYSERR_INVALPARAM;
215  *(LPDWORD)pMetric = val;
216  break;
217 
219  if (hao) return MMSYSERR_INVALHANDLE;
220  if (!pMetric) return MMSYSERR_INVALPARAM;
221  *(LPDWORD)pMetric = 0;
222  FIXME("ACM_METRIC_COUNT_HARDWARE not implemented\n");
223  break;
224 
226  /* Return current list position of driver */
227  if (!hao) return MMSYSERR_INVALHANDLE;
228  mmr = MMSYSERR_INVALHANDLE;
229  for (i = 1, padid = MSACM_pFirstACMDriverID; padid; i++, padid = padid->pNextACMDriverID) {
230  if (padid == (PWINE_ACMDRIVERID)hao) {
231  if (pMetric) {
232  *(LPDWORD)pMetric = i;
233  mmr = MMSYSERR_NOERROR;
234  } else {
235  mmr = MMSYSERR_INVALPARAM;
236  }
237  break;
238  }
239  }
240  break;
241 
243  /* Return fdwSupport for driver */
244  if (!hao) return MMSYSERR_INVALHANDLE;
245  mmr = MMSYSERR_INVALHANDLE;
246  for (padid = MSACM_pFirstACMDriverID; padid; padid = padid->pNextACMDriverID) {
247  if (padid == (PWINE_ACMDRIVERID)hao) {
248  if (pMetric) {
249  *(LPDWORD)pMetric = padid->fdwSupport;
250  mmr = MMSYSERR_NOERROR;
251  } else {
252  mmr = MMSYSERR_INVALPARAM;
253  }
254  break;
255  }
256  }
257  break;
258 
262  default:
263  FIXME("(%p, %d, %p): stub\n", hao, uMetric, pMetric);
264  mmr = MMSYSERR_NOTSUPPORTED;
265  }
266  return mmr;
267 }
#define ACM_METRIC_COUNT_HARDWARE
Definition: msacm.h:192
DWORD fdwSupport
Definition: wineacm.h:98
#define TRUE
Definition: types.h:120
#define ACM_METRIC_DRIVER_SUPPORT
Definition: msacm.h:202
#define CheckLocal(padid)
#define ACM_METRIC_COUNT_DRIVERS
Definition: msacm.h:187
#define ACM_METRIC_COUNT_LOCAL_CODECS
Definition: msacm.h:194
#define ACM_METRIC_HARDWARE_WAVE_INPUT
Definition: msacm.h:198
#define ACMDRIVERDETAILS_SUPPORTF_CODEC
Definition: msacm.h:61
PWINE_ACMDRIVERID pACMDriverID
Definition: wineacm.h:45
DWORD cFormatTags
Definition: wineacm.h:97
DWORD dwType
Definition: wineacm.h:44
UINT MMRESULT
Definition: mmsystem.h:962
#define WINE_ACMOBJ_DRIVERID
Definition: wineacm.h:36
#define ACM_METRIC_COUNT_LOCAL_FILTERS
Definition: msacm.h:196
#define MMSYSERR_INVALHANDLE
Definition: mmsystem.h:101
#define ACM_METRIC_COUNT_CONVERTERS
Definition: msacm.h:189
#define ACM_METRIC_COUNT_LOCAL_DRIVERS
Definition: msacm.h:193
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
unsigned int BOOL
Definition: ntddk_ex.h:94
#define ACMDRIVERDETAILS_SUPPORTF_FILTER
Definition: msacm.h:63
#define FIXME(fmt,...)
Definition: debug.h:110
#define ACM_METRIC_HARDWARE_WAVE_OUTPUT
Definition: msacm.h:199
#define ACM_METRIC_COUNT_DISABLED
Definition: msacm.h:191
PWINE_ACMOBJ MSACM_GetObj(HACMOBJ hObj, DWORD type)
Definition: internal.c:823
smooth NULL
Definition: ftsmooth.c:416
#define ACM_METRIC_DRIVER_PRIORITY
Definition: msacm.h:203
#define ACM_METRIC_COUNT_FILTERS
Definition: msacm.h:190
#define ACM_METRIC_COUNT_LOCAL_DISABLED
Definition: msacm.h:197
PWINE_ACMDRIVERID pNextACMDriverID
Definition: wineacm.h:93
GLuint GLfloat * val
Definition: glext.h:7180
#define TRACE(s)
Definition: solgame.cpp:4
#define MMSYSERR_NOERROR
Definition: mmsystem.h:96
#define ACM_METRIC_COUNT_LOCAL_CONVERTERS
Definition: msacm.h:195
unsigned long DWORD
Definition: ntddk_ex.h:95
#define WINE_ACMOBJ_DONTCARE
Definition: wineacm.h:35
#define ACMDRIVERDETAILS_SUPPORTF_CONVERTER
Definition: msacm.h:62
#define MMSYSERR_NOTSUPPORTED
Definition: mmsystem.h:104
#define LPDWORD
Definition: nt_native.h:46
PWINE_ACMDRIVERID MSACM_pFirstACMDriverID
Definition: internal.c:48
#define ACM_METRIC_MAX_SIZE_FILTER
Definition: msacm.h:201
struct _WINE_ACMDRIVERID::@464 * aFormatTag
#define MMSYSERR_INVALPARAM
Definition: mmsystem.h:107
#define ACM_METRIC_COUNT_CODECS
Definition: msacm.h:188
#define ACMDRIVERDETAILS_SUPPORTF_DISABLED
Definition: msacm.h:67
#define WINE_ACMOBJ_DRIVER
Definition: wineacm.h:37
#define ACM_METRIC_MAX_SIZE_FORMAT
Definition: msacm.h:200

Referenced by acmFormatEnumW(), AVISaveOptionsFmtChoose(), check_count(), DriverEnumProc(), FormatEnumProc(), FormatTagEnumProc(), test_acmFormatChoose(), and test_acmFormatSuggest().

◆ DllMain()

BOOL WINAPI DllMain ( HINSTANCE  hInstDLL,
DWORD  fdwReason,
LPVOID  lpvReserved 
)

Definition at line 45 of file msacm32_main.c.

46 {
47  TRACE("%p 0x%x %p\n", hInstDLL, fdwReason, lpvReserved);
48 
49  switch (fdwReason) {
50  case DLL_PROCESS_ATTACH:
51  DisableThreadLibraryCalls(hInstDLL);
52  MSACM_hHeap = HeapCreate(0, 0x10000, 0);
53  MSACM_hInstance32 = hInstDLL;
55  break;
56  case DLL_PROCESS_DETACH:
58  if (lpvReserved) break;
60  break;
61  default:
62  break;
63  }
64  return TRUE;
65 }
#define TRUE
Definition: types.h:120
HANDLE WINAPI HeapCreate(DWORD flOptions, SIZE_T dwInitialSize, SIZE_T dwMaximumSize)
Definition: heapmem.c:45
BOOL WINAPI DisableThreadLibraryCalls(IN HMODULE hLibModule)
Definition: loader.c:85
#define DLL_PROCESS_ATTACH
Definition: compat.h:120
static IN DWORD IN LPVOID lpvReserved
BOOL WINAPI HeapDestroy(HANDLE hHeap)
Definition: heapmem.c:85
HANDLE MSACM_hHeap
Definition: internal.c:47
#define DLL_PROCESS_DETACH
Definition: compat.h:119
#define TRACE(s)
Definition: solgame.cpp:4
void MSACM_RegisterAllDrivers(void)
Definition: internal.c:354
void MSACM_UnregisterAllDrivers(void)
Definition: internal.c:805
HINSTANCE MSACM_hInstance32
Definition: msacm32_main.c:40

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( msacm  )

Variable Documentation

◆ MSACM_hInstance32

HINSTANCE MSACM_hInstance32 = 0

Definition at line 40 of file msacm32_main.c.

Referenced by acmFormatChooseW(), and DllMain().