Abandoning silverblade-audio branch.
[reactos.git] / reactos / lib / drivers / sound / mmebuddy / wave / widMessage.c
1 /*
2 * PROJECT: ReactOS Sound System "MME Buddy" Library
3 * LICENSE: GPL - See COPYING in the top level directory
4 * FILE: lib/sound/mmebuddy/wave/widMessage.c
5 *
6 * PURPOSE: Provides the widMessage exported function, as required by
7 * the MME API, for wave input device support.
8 *
9 * PROGRAMMERS: Andrew Greenwood (silverblade@reactos.org)
10 */
11
12 #include <windows.h>
13 #include <mmsystem.h>
14 #include <mmddk.h>
15
16 #include <ntddsnd.h>
17
18 #include <mmebuddy.h>
19
20 /*
21 Standard MME driver entry-point for messages relating to wave audio
22 input.
23 */
24 APIENTRY DWORD
25 widMessage(
26 DWORD DeviceId,
27 DWORD Message,
28 DWORD PrivateHandle,
29 DWORD Parameter1,
30 DWORD Parameter2)
31 {
32 MMRESULT Result = MMSYSERR_NOTSUPPORTED;
33
34 AcquireEntrypointMutex(WAVE_IN_DEVICE_TYPE);
35
36 SND_TRACE(L"widMessage - Message type %d\n", Message);
37
38 switch ( Message )
39 {
40 case WIDM_GETNUMDEVS :
41 {
42 Result = GetSoundDeviceCount(WAVE_IN_DEVICE_TYPE);
43 break;
44 }
45
46 case WIDM_GETDEVCAPS :
47 {
48 Result = MmeGetSoundDeviceCapabilities(WAVE_IN_DEVICE_TYPE,
49 DeviceId,
50 (PVOID) Parameter1,
51 Parameter2);
52 break;
53 }
54 }
55
56 SND_TRACE(L"widMessage returning MMRESULT %d\n", Result);
57
58 ReleaseEntrypointMutex(WAVE_IN_DEVICE_TYPE);
59
60 return Result;
61 }