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