1998-10-11 19:00:29 +02:00
|
|
|
/*
|
|
|
|
* MSACM32 library
|
|
|
|
*
|
|
|
|
* Copyright 1998 Patrik Stridvall
|
|
|
|
*/
|
|
|
|
|
1999-02-17 14:51:06 +01:00
|
|
|
#include "winbase.h"
|
1998-10-11 19:00:29 +02:00
|
|
|
#include "winerror.h"
|
1999-03-14 17:35:05 +01:00
|
|
|
#include "windef.h"
|
1999-05-14 10:17:14 +02:00
|
|
|
#include "debugtools.h"
|
1998-10-11 19:00:29 +02:00
|
|
|
#include "msacm.h"
|
|
|
|
#include "msacmdrv.h"
|
|
|
|
#include "winversion.h"
|
|
|
|
|
1999-04-19 16:56:29 +02:00
|
|
|
DEFAULT_DEBUG_CHANNEL(msacm)
|
|
|
|
|
1998-10-11 19:00:29 +02:00
|
|
|
/**********************************************************************/
|
|
|
|
|
1999-02-26 12:11:13 +01:00
|
|
|
static DWORD MSACM_dwProcessesAttached = 0;
|
1998-10-11 19:00:29 +02:00
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* MSACM_LibMain32 (MSACM32.init)
|
|
|
|
*/
|
1999-02-26 12:11:13 +01:00
|
|
|
BOOL WINAPI MSACM32_LibMain(
|
|
|
|
HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
|
1998-10-11 19:00:29 +02:00
|
|
|
{
|
|
|
|
switch(fdwReason)
|
|
|
|
{
|
|
|
|
case DLL_PROCESS_ATTACH:
|
1999-02-26 12:11:13 +01:00
|
|
|
if(MSACM_dwProcessesAttached == 0)
|
1998-10-11 19:00:29 +02:00
|
|
|
{
|
1999-02-26 12:11:13 +01:00
|
|
|
MSACM_hHeap = HeapCreate(0, 0x10000, 0);
|
|
|
|
MSACM_RegisterAllDrivers();
|
1998-10-11 19:00:29 +02:00
|
|
|
}
|
1999-02-26 12:11:13 +01:00
|
|
|
MSACM_dwProcessesAttached++;
|
1998-10-11 19:00:29 +02:00
|
|
|
break;
|
|
|
|
case DLL_PROCESS_DETACH:
|
1999-02-26 12:11:13 +01:00
|
|
|
MSACM_dwProcessesAttached--;
|
|
|
|
if(MSACM_dwProcessesAttached == 0)
|
1998-10-11 19:00:29 +02:00
|
|
|
{
|
1999-02-26 12:11:13 +01:00
|
|
|
MSACM_UnregisterAllDrivers();
|
|
|
|
HeapDestroy(MSACM_hHeap);
|
|
|
|
MSACM_hHeap = (HANDLE) NULL;
|
1998-10-11 19:00:29 +02:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case DLL_THREAD_ATTACH:
|
|
|
|
break;
|
|
|
|
case DLL_THREAD_DETACH:
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* XRegThunkEntry (MSACM32.1)
|
|
|
|
* FIXME
|
|
|
|
* No documentation found.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* acmGetVersion32 (MSACM32.34)
|
|
|
|
*/
|
1999-02-26 12:11:13 +01:00
|
|
|
DWORD WINAPI acmGetVersion()
|
1998-10-11 19:00:29 +02:00
|
|
|
{
|
|
|
|
switch(VERSION_GetVersion())
|
|
|
|
{
|
|
|
|
default:
|
1999-05-14 10:17:14 +02:00
|
|
|
FIXME("%s not supported\n", VERSION_GetVersionName());
|
1998-10-11 19:00:29 +02:00
|
|
|
case WIN95:
|
|
|
|
return 0x04000000; /* 4.0.0 */
|
|
|
|
case NT40:
|
|
|
|
return 0x04000565; /* 4.0.1381 */
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* acmMessage32 (MSACM32.35)
|
|
|
|
* FIXME
|
|
|
|
* No documentation found.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* acmMetrics (MSACM32.36)
|
|
|
|
*/
|
1999-02-26 12:11:13 +01:00
|
|
|
MMRESULT WINAPI acmMetrics(
|
|
|
|
HACMOBJ hao, UINT uMetric, LPVOID pMetric)
|
1998-10-11 19:00:29 +02:00
|
|
|
{
|
1999-02-26 12:11:13 +01:00
|
|
|
PWINE_ACMOBJ pao = MSACM_GetObj(hao);
|
|
|
|
BOOL bLocal = TRUE;
|
1998-10-11 19:00:29 +02:00
|
|
|
|
1999-05-14 10:17:14 +02:00
|
|
|
FIXME("(0x%08x, %d, %p): stub\n", hao, uMetric, pMetric);
|
1998-10-11 19:00:29 +02:00
|
|
|
|
|
|
|
switch(uMetric)
|
|
|
|
{
|
|
|
|
case ACM_METRIC_COUNT_DRIVERS:
|
|
|
|
bLocal = FALSE;
|
|
|
|
case ACM_METRIC_COUNT_LOCAL_DRIVERS:
|
|
|
|
if(!pao)
|
|
|
|
return MMSYSERR_INVALHANDLE;
|
|
|
|
return MMSYSERR_NOTSUPPORTED;
|
|
|
|
case ACM_METRIC_COUNT_CODECS:
|
|
|
|
bLocal = FALSE;
|
|
|
|
case ACM_METRIC_COUNT_LOCAL_CODECS:
|
|
|
|
return MMSYSERR_NOTSUPPORTED;
|
|
|
|
case ACM_METRIC_COUNT_CONVERTERS:
|
|
|
|
bLocal = FALSE;
|
|
|
|
case ACM_METRIC_COUNT_LOCAL_CONVERTERS:
|
|
|
|
return MMSYSERR_NOTSUPPORTED;
|
|
|
|
case ACM_METRIC_COUNT_FILTERS:
|
|
|
|
bLocal = FALSE;
|
|
|
|
case ACM_METRIC_COUNT_LOCAL_FILTERS:
|
|
|
|
return MMSYSERR_NOTSUPPORTED;
|
|
|
|
case ACM_METRIC_COUNT_DISABLED:
|
|
|
|
bLocal = FALSE;
|
|
|
|
case ACM_METRIC_COUNT_LOCAL_DISABLED:
|
|
|
|
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:
|
|
|
|
return MMSYSERR_NOTSUPPORTED;
|
|
|
|
}
|
|
|
|
return MMSYSERR_NOERROR;
|
|
|
|
}
|