http://bugs.winehq.org/show_bug.cgi?id=3930
--- Comment #35 from Jörg Höhle hoehle@users.sourceforge.net 2010-02-18 04:28:30 --- Knowing what to look for, I found a trace where
A) midiOutUnprepare + HeapFree() is called from within the MOM_DONE function callback. I have a patch in my queue that supports this kind of useage.
B) midiStreamClose is called from the MOM_DONE callback. This causes Wine to hang because it calls midiStreamRestart; ResumeThread; midiStreamStop and waits for the STOP message to be returned. Alas, it's already operating on the player thread, so it's waiting for itself... This one looks like it's only going to ever work with a separate thread.
MSDN says "... as doing so can cause a deadlock" Indeed, yet apps do this (or did this at least in Win9X times).