ReactOS 0.4.15-dev-7942-gd23573b
pnp_list_lock.c
Go to the documentation of this file.
1/*
2 * PROJECT: ReactOS
3 * LICENSE: GPL - See COPYING in the top level directory
4 * PURPOSE: Audio Service Plug and Play list locking mechanism
5 * COPYRIGHT: Copyright 2007 Andrew Greenwood
6 */
7
8#include "audiosrv.h"
9
10#include <assert.h>
11
13
14BOOL
16{
17 /* The security stuff is to make sure the mutex can be grabbed by
18 other processes - is this the best idea though ??? */
19
20 SECURITY_DESCRIPTOR security_descriptor;
22
24 SetSecurityDescriptorDacl(&security_descriptor, TRUE, 0, FALSE);
25
26 security.nLength = sizeof(SECURITY_ATTRIBUTES);
27 security.lpSecurityDescriptor = &security_descriptor;
28 security.bInheritHandle = FALSE;
29
31 FALSE,
33
34 return (audio_device_list_lock != NULL);
35}
36
37VOID
39{
42}
43
44VOID
46{
49}
50
51VOID
53{
56}
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
BOOL WINAPI InitializeSecurityDescriptor(PSECURITY_DESCRIPTOR pSecurityDescriptor, DWORD dwRevision)
Definition: security.c:929
#define CloseHandle
Definition: compat.h:739
struct _SECURITY_ATTRIBUTES SECURITY_ATTRIBUTES
#define assert(x)
Definition: debug.h:53
#define INFINITE
Definition: serial.h:102
unsigned int BOOL
Definition: ntddk_ex.h:94
BOOL InitializeAudioDeviceListLock(VOID)
Definition: pnp_list_lock.c:15
VOID LockAudioDeviceList(VOID)
Definition: pnp_list_lock.c:45
static HANDLE audio_device_list_lock
Definition: pnp_list_lock.c:12
VOID KillAudioDeviceListLock(VOID)
Definition: pnp_list_lock.c:38
VOID UnlockAudioDeviceList(VOID)
Definition: pnp_list_lock.c:52
#define AUDIO_LIST_LOCK_NAME
Definition: audiosrv.h:19
BOOL WINAPI SetSecurityDescriptorDacl(PSECURITY_DESCRIPTOR pSecurityDescriptor, BOOL bDaclPresent, PACL pDacl, BOOL bDaclDefaulted)
Definition: sec.c:262
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Definition: synch.c:82
BOOL WINAPI DECLSPEC_HOTPATCH ReleaseMutex(IN HANDLE hMutex)
Definition: synch.c:618
#define CreateMutex
Definition: winbase.h:3756
#define SECURITY_DESCRIPTOR_REVISION
Definition: setypes.h:58