[DSOUND] Improvements to DirectSound(Capture)EnumerateW (#3899) 3899/head
authorOleg Dubinskiy <oleg.dubinskij2013@yandex.ua>
Wed, 11 Aug 2021 18:36:52 +0000 (21:36 +0300)
committerStanislav Motylkov <x86corez@gmail.com>
Sat, 4 Sep 2021 12:58:42 +0000 (15:58 +0300)
commitd7b2280c5c7fbc681efe9c0942fd0a11f82e09d2
tree9734b85fac48a3ab949c19864405e13bd15b081f
parentd6002f9475b951c74a4f4deabb64c5d7fb320592
[DSOUND] Improvements to DirectSound(Capture)EnumerateW (#3899)

Fix and improve DirectSoundEnumerateW and DirectSoundCaptureEnumerateW implementations in our dsound.

Use the Windows-compatible way to get the device name and pass it to callback.
- Don't use Wine-specific DSDRIVERDESC structure and DRV_QUERYDSOUNDDESC message, declared in sdk/include/dxsdk/dsdriver.h, whose are obsolete even in Wine for now.
- Instead, declare a new WAVEINCAPSW and WAVEOUTCAPSW structures (for input and output appropriately), call waveInGetDevCapsW and WaveOutGetDevCapsW for enumerated device ID and store retieved device name in these structures.
- Then pass them to a lpDSEnumCallbackW as well, without Ansi to Unicode conversion (since the retrieved string is Unicode already).
- Do this both for capture and playback functions.
- Addtionally, add MMSYSERR_BADDEVICEID status code to mmErr macro, because it also might be returned by waveIn/OutGetDevCapsW as well, in case of failure.
- And mark our dosund as forked, because it definitely will not be synced at least until we'll retarget to Vista or newer. Add an appropriate comment.

This fixes incorrect detection of DirectSound audio input and output devices, so now a lot of apps are able to detect it correctly, and can play the sound properly (e.g. AIMP 2.61 and IcyTower from RAPPS).

CORE-7535 CORE-10907 CORE-15324 CORE-15533 CORE-16340
dll/directx/wine/dsound/dsound_main.c
media/doc/WINESYNC.txt