057ce3e43007a37f09a74ff5efc3a12064eb57d0
[reactos.git] / sdk / include / reactos / libs / audiosrv / audiosrv.h
1 /*
2 * PROJECT: ReactOS
3 * LICENSE: GPL - See COPYING in the top level directory
4 * FILE: include/reactos/libs/audiosrv/audiosrv.h
5 * PURPOSE: Audio Service Plug and Play list
6 * COPYRIGHT: Copyright 2007 Andrew Greenwood
7 */
8
9 #include <winsvc.h>
10
11 #ifndef AUDIOSRV_H
12 #define AUDIOSRV_H
13
14 /* This is currently set to avoid conflicting service names in Windows! */
15 #define SERVICE_NAME L"RosAudioSrv"
16
17 /* A named mutex is used for synchronizing access to the device list.
18 If this mutex doesn't exist, it means the audio service isn't running. */
19 #define AUDIO_LIST_LOCK_NAME L"Global\\AudioDeviceListLock"
20
21 /* ...and this is where the device list will be available */
22 #define AUDIO_LIST_NAME L"Global\\AudioDeviceList"
23
24 /* Amount of shared memory to allocate */
25 #define AUDIO_LIST_MAX_SIZE 65536
26
27 typedef struct
28 {
29 DWORD enabled;
30 WCHAR path[]; /* The device object path (excluded from sizeof) */
31 } PnP_AudioDevice;
32
33 typedef struct
34 {
35 DWORD size; /* Size of the shared mem */
36 DWORD max_size; /* Amount of mem available */
37 DWORD device_count; /* Number of devices */
38 PnP_AudioDevice *first_device;
39 } PnP_AudioHeader;
40
41
42 /* Calculate amount of memory consumed by a wide string - this includes the
43 terminating NULL. */
44
45 #define WideStringSize(str) \
46 ( (lstrlenW(str) + 1) * sizeof(WCHAR) )
47
48 BOOL
49 InitializeAudioDeviceListLock(VOID);
50
51 VOID
52 KillAudioDeviceListLock(VOID);
53
54 VOID
55 LockAudioDeviceList(VOID);
56
57 VOID
58 UnlockAudioDeviceList(VOID);
59
60 #endif