wine/dlls/msacm32/msacm32_main.c

132 lines
3.3 KiB
C
Raw Normal View History

1999-10-31 18:29:16 +00:00
/* -*- tab-width: 8; c-basic-offset: 4 -*- */
/*
* MSACM32 library
*
* Copyright 1998 Patrik Stridvall
1999-10-31 18:29:16 +00:00
* 1999 Eric Pouech
*/
#include "winbase.h"
#include "winerror.h"
1999-03-14 16:35:05 +00:00
#include "windef.h"
#include "debugtools.h"
#include "msacm.h"
#include "msacmdrv.h"
1999-10-31 18:29:16 +00:00
#include "wineacm.h"
#include "winversion.h"
DEFAULT_DEBUG_CHANNEL(msacm)
1999-10-31 18:29:16 +00:00
/**********************************************************************/
1999-10-31 18:29:16 +00:00
static DWORD MSACM_dwProcessesAttached = 0;
/***********************************************************************
* MSACM_LibMain32 (MSACM32.init)
*/
1999-10-31 18:29:16 +00:00
BOOL WINAPI MSACM32_LibMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpvReserved)
{
1999-10-31 18:29:16 +00:00
TRACE("0x%x 0x%lx %p\n", hInstDLL, fdwReason, lpvReserved);
switch (fdwReason) {
case DLL_PROCESS_ATTACH:
1999-10-31 18:29:16 +00:00
if (MSACM_dwProcessesAttached == 0) {
MSACM_hHeap = HeapCreate(0, 0x10000, 0);
MSACM_RegisterAllDrivers();
}
1999-10-31 18:29:16 +00:00
MSACM_dwProcessesAttached++;
break;
case DLL_PROCESS_DETACH:
1999-10-31 18:29:16 +00:00
MSACM_dwProcessesAttached--;
if (MSACM_dwProcessesAttached == 0) {
MSACM_UnregisterAllDrivers();
HeapDestroy(MSACM_hHeap);
MSACM_hHeap = (HANDLE) NULL;
}
1999-10-31 18:29:16 +00:00
break;
case DLL_THREAD_ATTACH:
1999-10-31 18:29:16 +00:00
break;
case DLL_THREAD_DETACH:
1999-10-31 18:29:16 +00:00
break;
default:
1999-10-31 18:29:16 +00:00
break;
}
1999-10-31 18:29:16 +00:00
return TRUE;
}
/***********************************************************************
* XRegThunkEntry (MSACM32.1)
* FIXME
* No documentation found.
*/
/***********************************************************************
* acmGetVersion32 (MSACM32.34)
*/
1999-10-31 18:29:16 +00:00
DWORD WINAPI acmGetVersion(void)
{
1999-10-31 18:29:16 +00:00
switch (VERSION_GetVersion()) {
default:
1999-10-31 18:29:16 +00:00
FIXME("%s not supported\n", VERSION_GetVersionName());
case WIN95:
1999-10-31 18:29:16 +00:00
return 0x04000000; /* 4.0.0 */
case NT40:
1999-10-31 18:29:16 +00:00
return 0x04000565; /* 4.0.1381 */
}
}
/***********************************************************************
* acmMessage32 (MSACM32.35)
* FIXME
* No documentation found.
*/
/***********************************************************************
* acmMetrics (MSACM32.36)
*/
1999-10-31 18:29:16 +00:00
MMRESULT WINAPI acmMetrics(HACMOBJ hao, UINT uMetric, LPVOID pMetric)
{
1999-10-31 18:29:16 +00:00
PWINE_ACMOBJ pao = MSACM_GetObj(hao);
BOOL bLocal = TRUE;
FIXME("(0x%08x, %d, %p): stub\n", hao, uMetric, pMetric);
switch (uMetric) {
case ACM_METRIC_COUNT_DRIVERS:
1999-10-31 18:29:16 +00:00
bLocal = FALSE;
case ACM_METRIC_COUNT_LOCAL_DRIVERS:
1999-10-31 18:29:16 +00:00
if (!pao)
return MMSYSERR_INVALHANDLE;
return MMSYSERR_NOTSUPPORTED;
case ACM_METRIC_COUNT_CODECS:
1999-10-31 18:29:16 +00:00
bLocal = FALSE;
case ACM_METRIC_COUNT_LOCAL_CODECS:
1999-10-31 18:29:16 +00:00
return MMSYSERR_NOTSUPPORTED;
case ACM_METRIC_COUNT_CONVERTERS:
1999-10-31 18:29:16 +00:00
bLocal = FALSE;
case ACM_METRIC_COUNT_LOCAL_CONVERTERS:
1999-10-31 18:29:16 +00:00
return MMSYSERR_NOTSUPPORTED;
case ACM_METRIC_COUNT_FILTERS:
1999-10-31 18:29:16 +00:00
bLocal = FALSE;
case ACM_METRIC_COUNT_LOCAL_FILTERS:
1999-10-31 18:29:16 +00:00
return MMSYSERR_NOTSUPPORTED;
case ACM_METRIC_COUNT_DISABLED:
1999-10-31 18:29:16 +00:00
bLocal = FALSE;
case ACM_METRIC_COUNT_LOCAL_DISABLED:
1999-10-31 18:29:16 +00:00
if (!pao)
return MMSYSERR_INVALHANDLE;
return MMSYSERR_NOTSUPPORTED;
case ACM_METRIC_COUNT_HARDWARE:
case ACM_METRIC_HARDWARE_WAVE_INPUT:
case ACM_METRIC_HARDWARE_WAVE_OUTPUT:
case ACM_METRIC_MAX_SIZE_FORMAT:
case ACM_METRIC_MAX_SIZE_FILTER:
case ACM_METRIC_DRIVER_SUPPORT:
case ACM_METRIC_DRIVER_PRIORITY:
default:
1999-10-31 18:29:16 +00:00
return MMSYSERR_NOTSUPPORTED;
}
1999-10-31 18:29:16 +00:00
return MMSYSERR_NOERROR;
}