forgot the header update part.
[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 #include <sndtypes.h>
18
19 #include <mmebuddy.h>
20
21 /*
22 Standard MME driver entry-point for messages relating to wave audio
23 input.
24 */
25 DWORD
26 APIENTRY
27 widMessage(
28 DWORD DeviceId,
29 DWORD Message,
30 DWORD PrivateHandle,
31 DWORD Parameter1,
32 DWORD Parameter2)
33 {
34 MMRESULT Result = MMSYSERR_NOTSUPPORTED;
35
36 AcquireEntrypointMutex(WAVE_IN_DEVICE_TYPE);
37
38 SND_TRACE(L"widMessage - Message type %d\n", Message);
39
40 switch ( Message )
41 {
42 case WIDM_GETNUMDEVS :
43 {
44 Result = GetSoundDeviceCount(WAVE_IN_DEVICE_TYPE);
45 break;
46 }
47
48 case WIDM_GETDEVCAPS :
49 {
50 Result = MmeGetSoundDeviceCapabilities(WAVE_IN_DEVICE_TYPE,
51 DeviceId,
52 (PVOID) Parameter1,
53 Parameter2);
54 break;
55 }
56 }
57
58 SND_TRACE(L"widMessage returning MMRESULT %d\n", Result);
59
60 ReleaseEntrypointMutex(WAVE_IN_DEVICE_TYPE);
61
62 return Result;
63 }