On Thu May 22 18:50:27 2025 +0000, Bernhard Übelacker wrote:
Sorry for the delay. Before only the `DRV_FREE` case contained the call to `MIDI_CALL( midi_release, NULL );`, whis is causes the thread leave its loop. But in this failure case through `CloseDriver` just the `DRV_CLOSE` case is reached, so I put both together. If we just wait in the `DRV_CLOSE` case the thread never leaves its loop. I can make the close case distinct with a second line midi_release and the wait, and not touching `DRV_FREE` if this is desired?
actually (from winmm.dll standpoint):
- `DRV_LOAD/DRV_FREE` are paired (first is sent when DLL containing driver is loaded, and second when it's about to be unloaded) - `DRV_OPEN/DRV_CLOSE` are paired: a driver can support different instances (eg. with different parameters), and they are used to create/destroy such an instance
so it makes no sense to do something on `DRV_LOAD` and its counterpart on `DRV_CLOSE` (even if for mmdevapi it's likely we only have one instance created)
did you investigate why the `DRV_FREE` message wasn't sent from `winmm.CloseDriver()`?