https://bugs.winehq.org/show_bug.cgi?id=3930
--- Comment #81 from Dmitry Timoshkov dmitry@baikal.ru --- (In reply to Damjan Jovanovic from comment #80)
In other words, Windows probably checks something like "if emulating Windows 9x and the WINMM callback is located in a file called WAIL32.DLL", then it runs the callback in a separate thread. (I say that because Windows does not use a separate callback thread when you set Windows 95 compatibility and call waveOutOpen() directly, but does use it when WAIL32.DLL calls it.)
So that's why HOMM works on recent Windows versions, but doesn't work on Wine: Windows has application-specific workarounds :-(.
What happens if you rename WAIL32.DLL to something else?