Commit b6117b68 authored by Francois Gouget's avatar Francois Gouget Committed by Alexandre Julliard

wineoss.drv: Give a name to the mmdevapi critical sections, make them static and…

wineoss.drv: Give a name to the mmdevapi critical sections, make them static and delete them when unloading the dll.
parent 68dc1468
......@@ -155,6 +155,13 @@ typedef struct _SessionMgr {
static HANDLE g_timer_q;
static CRITICAL_SECTION g_sessions_lock;
static CRITICAL_SECTION_DEBUG g_sessions_lock_debug =
{
0, 0, &g_sessions_lock,
{ &g_sessions_lock_debug.ProcessLocksList, &g_sessions_lock_debug.ProcessLocksList },
0, 0, { (DWORD_PTR)(__FILE__ ": g_sessions_lock") }
};
static CRITICAL_SECTION g_sessions_lock = { &g_sessions_lock_debug, -1, 0, 0, 0, 0 };
static struct list g_sessions = LIST_INIT(g_sessions);
static AudioSessionWrapper *AudioSessionWrapper_Create(ACImpl *client);
......@@ -223,14 +230,18 @@ static inline SessionMgr *impl_from_IAudioSessionManager2(IAudioSessionManager2
BOOL WINAPI DllMain(HINSTANCE dll, DWORD reason, void *reserved)
{
if(reason == DLL_PROCESS_ATTACH){
switch (reason)
{
case DLL_PROCESS_ATTACH:
g_timer_q = CreateTimerQueue();
if(!g_timer_q)
return FALSE;
break;
InitializeCriticalSection(&g_sessions_lock);
case DLL_PROCESS_DETACH:
DeleteCriticalSection(&g_sessions_lock);
break;
}
return TRUE;
}
......@@ -527,6 +538,7 @@ HRESULT WINAPI AUDDRV_GetAudioEndpoint(char *devnode, IMMDevice *dev,
This->IAudioStreamVolume_iface.lpVtbl = &AudioStreamVolume_Vtbl;
InitializeCriticalSection(&This->lock);
This->lock.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": ACImpl.lock");
This->parent = dev;
IMMDevice_AddRef(This->parent);
......@@ -574,6 +586,7 @@ static ULONG WINAPI AudioClient_Release(IAudioClient *iface)
if(!ref){
IAudioClient_Stop(iface);
IMMDevice_Release(This->parent);
This->lock.DebugInfo->Spare[0] = 0;
DeleteCriticalSection(&This->lock);
close(This->fd);
if(This->initted){
......@@ -819,6 +832,7 @@ static AudioSession *create_session(const GUID *guid, IMMDevice *device,
list_add_head(&g_sessions, &ret->entry);
InitializeCriticalSection(&ret->lock);
ret->lock.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": AudioSession.lock");
session_init_vols(ret, num_channels);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment