sox_ng/test/waveaudio-teardown
barstoolbluz 3963ad5864 waveaudio: keep WAVEHDR storage alive if device close fails
The driver can return MMSYSERR_STILLPLAYING when closing a device. The
old stop function ignores that result; format teardown then releases
ft->priv even though its embedded WAVEHDRs can remain driver-owned.

Check reset, unprepare and close results on both input and output. On a
failed device close, detach the private allocation from ft so the generic
format cleanup cannot release the live headers, data or callback event.
On successful close, release them normally. The failure path intentionally
retains storage for the remaining process lifetime instead of risking
use-after-free.

Extend the WinMM teardown simulation to cover close refusal, reset and
wait failures, header unprepare failures, timer rollover and the input
close path. Actual Windows device playback remains unverified.
2026-10-24 16:29:32 -04:00
..
run waveaudio: keep WAVEHDR storage alive if device close fails 2026-10-24 16:29:32 -04:00
winmm-driver.c waveaudio: keep WAVEHDR storage alive if device close fails 2026-10-24 16:29:32 -04:00