Fixes #55362.
From: Davide Beatrici git@davidebeatrici.dev
--- dlls/winepulse.drv/pulse.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-)
diff --git a/dlls/winepulse.drv/pulse.c b/dlls/winepulse.drv/pulse.c index 0e587033a6d..10730cf4a4d 100644 --- a/dlls/winepulse.drv/pulse.c +++ b/dlls/winepulse.drv/pulse.c @@ -2221,9 +2221,18 @@ static NTSTATUS pulse_is_format_supported(void *args) break; }
- /* This driver does not support exclusive mode. */ - if (exclusive && params->result == S_OK) - params->result = params->flow == eCapture ? AUDCLNT_E_UNSUPPORTED_FORMAT : AUDCLNT_E_EXCLUSIVE_MODE_NOT_ALLOWED; + if (exclusive) { + switch (params->result) { + case S_OK: + /* This driver does not support exclusive mode. */ + if (params->flow == eRender) { + params->result = AUDCLNT_E_EXCLUSIVE_MODE_NOT_ALLOWED; + break; + } + case S_FALSE: + params->result = AUDCLNT_E_UNSUPPORTED_FORMAT; + } + }
return STATUS_SUCCESS; }
Could you please add the `Wine-Bug:` tag to the commit message?
Huw Davies (@huw) commented about dlls/winepulse.drv/pulse.c:
break; }
- /* This driver does not support exclusive mode. */
- if (exclusive && params->result == S_OK)
params->result = params->flow == eCapture ? AUDCLNT_E_UNSUPPORTED_FORMAT : AUDCLNT_E_EXCLUSIVE_MODE_NOT_ALLOWED;
- if (exclusive) {
switch (params->result) {
case S_OK:
/* This driver does not support exclusive mode. */
if (params->flow == eRender) {
params->result = AUDCLNT_E_EXCLUSIVE_MODE_NOT_ALLOWED;
break;
}
case S_FALSE:
This fall-through is not very pleasant; please do this in a different way.