Page 1 of 1

CALLBACK_EVENT with no valid address in dwCallback

Posted: 12-01-19 6:56 pm
by KaleidonKep99
Hi Nicholas.

I noticed that Synthesia asks the driver to use an event callback (SetEvent) by setting the CALLBACK_EVENT flag in dwParam2, when initializing with midiOutOpen, but no valid address is given in dwCallback.

Code: Select all

02-12-2019 00:48:43.910 - Stage <<MODM_OPEN>> | HMIDI: 05CFDA48 - dwCallback: 00000000 - dwInstance: 00000000 - dwUser: 05CFDA50 - OMFlags: 00000005
This causes my driver to crash when it tries to set the event.

Code: Select all

02-12-2019 00:48:44.269 - Stage <<MODM_OPEN>> | Sending callback data to app. if needed...
(Error at "DoCallbackSE", Code 0x00000006) - Fatal error during the execution of the driver.
I can add a workaround that checks if the given address is valid, but since it looks like you're not using the callback at all, you should remove the flag in the next version of Synthesia.

Re: CALLBACK_EVENT with no valid address in dwCallback

Posted: 12-03-19 1:10 pm
by Nicholas
How curious.

I just tracked it back to a commit from Aug-2007(!) where I appear to have been following the instructions on this Microsoft page to the letter in an effort to add SysEx message sending. Notice there, they just say to change the dwFlags parameter but not to actually pass in the event during midiOutOpen.

Well... let's also pass in the event during open and see what happens! :lol:

(On my machine it still seems to be able to send SysEx messages just fine after the "fix". I wonder if that will remain the case out in the wild.)