From: Jon Koops <jonkoops@gmail.com> With device sharing removed, the global DSOUND_renderers list is no longer used for lookups. Devices were still added to and removed from the list, but nothing read from it. Remove the list, the critical section protecting it, and the entry field from DirectSoundDevice. Signed-off-by: Jon Koops <jonkoops@gmail.com> --- dlls/dsound/dsound.c | 11 ----------- dlls/dsound/dsound_main.c | 11 ----------- dlls/dsound/dsound_private.h | 4 ---- 3 files changed, 26 deletions(-) diff --git a/dlls/dsound/dsound.c b/dlls/dsound/dsound.c index b5c53829a5b..032dff7bc48 100644 --- a/dlls/dsound/dsound.c +++ b/dlls/dsound/dsound.c @@ -203,10 +203,6 @@ static ULONG DirectSoundDevice_Release(DirectSoundDevice * device) if (device->mta_cookie) CoDecrementMTAUsage(device->mta_cookie); - EnterCriticalSection(&DSOUND_renderers_lock); - list_remove(&device->entry); - LeaveCriticalSection(&DSOUND_renderers_lock); - /* It is allowed to release this object even when buffers are playing */ if (device->buffers) { WARN("%d secondary buffers not released\n", device->nrofbuffers); @@ -272,13 +268,10 @@ static HRESULT DirectSoundDevice_Initialize(DirectSoundDevice ** ppDevice, LPCGU if(FAILED(hr)) return hr; - EnterCriticalSection(&DSOUND_renderers_lock); - hr = DirectSoundDevice_Create(&device); if(FAILED(hr)){ WARN("DirectSoundDevice_Create failed\n"); IMMDevice_Release(mmdevice); - LeaveCriticalSection(&DSOUND_renderers_lock); return hr; } @@ -291,7 +284,6 @@ static HRESULT DirectSoundDevice_Initialize(DirectSoundDevice ** ppDevice, LPCGU if (FAILED(hr)) { free(device); - LeaveCriticalSection(&DSOUND_renderers_lock); IMMDevice_Release(mmdevice); WARN("DSOUND_ReopenDevice failed: %08lx\n", hr); return hr; @@ -328,9 +320,6 @@ static HRESULT DirectSoundDevice_Initialize(DirectSoundDevice ** ppDevice, LPCGU SetThreadPriority(device->thread, THREAD_PRIORITY_TIME_CRITICAL); *ppDevice = device; - list_add_tail(&DSOUND_renderers, &device->entry); - - LeaveCriticalSection(&DSOUND_renderers_lock); return hr; } diff --git a/dlls/dsound/dsound_main.c b/dlls/dsound/dsound_main.c index 8936b437ba2..71f9d85083a 100644 --- a/dlls/dsound/dsound_main.c +++ b/dlls/dsound/dsound_main.c @@ -63,16 +63,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(dsound); -struct list DSOUND_renderers = LIST_INIT(DSOUND_renderers); -CRITICAL_SECTION DSOUND_renderers_lock; -static CRITICAL_SECTION_DEBUG DSOUND_renderers_lock_debug = -{ - 0, 0, &DSOUND_renderers_lock, - { &DSOUND_renderers_lock_debug.ProcessLocksList, &DSOUND_renderers_lock_debug.ProcessLocksList }, - 0, 0, { (DWORD_PTR)(__FILE__ ": DSOUND_renderers_lock") } -}; -CRITICAL_SECTION DSOUND_renderers_lock = { &DSOUND_renderers_lock_debug, -1, 0, 0, 0, 0 }; - /* Some applications expect the GUID pointers emitted from DirectSoundCaptureEnumerate to remain * valid at least until the next time DirectSoundCaptureEnumerate is called, so we store them in * these dynamically allocated arrays. */ @@ -790,7 +780,6 @@ BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpvReserved) break; case DLL_PROCESS_DETACH: if (lpvReserved) break; - DeleteCriticalSection(&DSOUND_renderers_lock); break; } return TRUE; diff --git a/dlls/dsound/dsound_private.h b/dlls/dsound/dsound_private.h index 75279dacf87..2fc37b0ef7e 100644 --- a/dlls/dsound/dsound_private.h +++ b/dlls/dsound/dsound_private.h @@ -106,7 +106,6 @@ struct DirectSoundDevice IAudioRenderClient *render; HANDLE sleepev, thread; - struct list entry; }; /* reference counted buffer memory for duplicated buffer memory */ @@ -251,9 +250,6 @@ HRESULT IDirectSoundCaptureImpl_Create(IUnknown *outer_unk, REFIID riid, void ** #define STATE_CAPTURING 2 #define STATE_STOPPING 3 -extern CRITICAL_SECTION DSOUND_renderers_lock; -extern struct list DSOUND_renderers; - extern GUID *DSOUND_renderer_guids; extern GUID *DSOUND_capture_guids; -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10886