DirectSound device enumeration is racy
ReloadDirectXDevices() calls DirectSoundEnumerate() multiple times. It assumes that each calls will provide the same audio device list.
This is (probably) not always true. The device list should be subject to asynchronous changes due to hot-plugging.