[Media_api] bug(?) in winmm_in_callback

Julien Pommier pommier at pianoteq.com
Wed Apr 25 00:47:36 PDT 2007


Hi there,

I have spent some time tracking a crash occuring with "Virtual Midi 
Controller" ( http://www.soundcosoftware.com/vmc.htm )
Apparently, this virtual midi device is still calling the callback 
(once) after the stream has been closed, so I am not sure if portmidi is 
really the one to blame. The callback is called with wMsg==MIM_CLOSE , 
and it causes a crash because the callback is protected by a critical 
section which have been destroyed.

So I suggest patching winmm_in_callback with a "if (wMsg == MIM_CLOSE) 
return;" placed before the EnterCriticalSection code. At least it seems 
to work well here :)

btw, about pm_dll.dll : I don't use it in our host, and so far I have 
never experienced/heard of windows crashes so I would say it can safely 
be omitted, at least for winxp and vista.

Best regards,
Julien Pommier.


More information about the media_api mailing list