a3815b8cb9ed3bcb6dda105ac8f1cb067bf3f6ab
[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 APIENTRY DWORD
26 widMessage(
27 DWORD DeviceId,
28 DWORD Message,
29 DWORD PrivateHandle,
30 DWORD Parameter1,
31 DWORD Parameter2)
32 {
33 MMRESULT Result = MMSYSERR_NOTSUPPORTED;
34
35 AcquireEntrypointMutex(WAVE_IN_DEVICE_TYPE);
36
37 SND_TRACE(L"widMessage - Message type %d\n", Message);
38
39 switch ( Message )
40 {
41 case WIDM_GETNUMDEVS :
42 {
43 Result = GetSoundDeviceCount(WAVE_IN_DEVICE_TYPE);
44 break;
45 }
46
47 case WIDM_GETDEVCAPS :
48 {
49 Result = MmeGetSoundDeviceCapabilities(WAVE_IN_DEVICE_TYPE,
50 DeviceId,
51 (PVOID) Parameter1,
52 Parameter2);
53 break;
54 }
55 }
56
57 SND_TRACE(L"widMessage returning MMRESULT %d\n", Result);
58
59 ReleaseEntrypointMutex(WAVE_IN_DEVICE_TYPE);
60
61 return Result;
62 }