From b756bd674e2b766091716b95416b1e5368c9a33d Mon Sep 17 00:00:00 2001 From: David Reid Date: Sun, 30 Dec 2018 14:20:59 +1000 Subject: [PATCH] DSound: Return error in get_device_info() if share mode not supported. --- mini_al.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mini_al.h b/mini_al.h index f50d6c19..b5ba6334 100644 --- a/mini_al.h +++ b/mini_al.h @@ -7767,7 +7767,10 @@ BOOL CALLBACK mal_context_get_device_info_callback__dsound(LPGUID lpGuid, LPCSTR mal_result mal_context_get_device_info__dsound(mal_context* pContext, mal_device_type deviceType, const mal_device_id* pDeviceID, mal_share_mode shareMode, mal_device_info* pDeviceInfo) { - (void)shareMode; + /* Exclusive mode and capture not supported with DirectSound. */ + if (deviceType == mal_device_type_capture && shareMode == mal_share_mode_exclusive) { + return MAL_SHARE_MODE_NOT_SUPPORTED; + } if (pDeviceID != NULL) { // ID.