winmm: More compatible midiIn/Out[Un]Prepare MHDR_* flag handling.

Joerg-Cyril.Hoehle at Joerg-Cyril.Hoehle at
Mon Feb 11 06:13:26 CST 2013


I had noticed that the 3 drivers handled flags differently so I was left
wondering which one was right. So I wrote some tests...

-    /* MS doc says that dwFlags must be set to zero, but (kinda funny) MS mciseq drivers
-     * asks to prepare MIDIHDR which dwFlags != 0.
-     * So at least check for the inqueue flag
-     */
I could not observe any behavior like that in my tests.

+    lpMidiHdr->dwFlags &= ~(MHDR_DONE|MHDR_INQUEUE); /* flags cleared since w2k */

I choose to implement the behavior since w2k. Hopefully this will not break some w9x app.

-    if (lpMidiOutHdr == NULL || uSize < offsetof(MIDIHDR,dwOffset))
     if ((wmld = MMDRV_Get(hMidiOut, MMDRV_MIDIOUT, FALSE)) == NULL)

IMHO calling named winmm:xyz functions should be equivalent to dispatching MM*
messages hence all checks should be performed after dispatching -- even if that
means replicating code across all wave and midi drivers...

Now all the winmm:midiXyz functions do nothing but dispatch using MMDRV_Message.

    Jörg Höhle
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-winmm-More-compatible-midiIn-Out-Un-Prepare-MHDR_.patch
Type: application/octet-stream
Size: 25435 bytes
Desc: 0001-winmm-More-compatible-midiIn-Out-Un-Prepare-MHDR_.patch
URL: <>

More information about the wine-patches mailing list