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

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


Hi,

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.


XyzPrepare:
+    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.


Winmm:xyzPrepare:
-    if (lpMidiOutHdr == NULL || uSize < offsetof(MIDIHDR,dwOffset))
-	return MMSYSERR_INVALPARAM;
     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.

Regards,
    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: <http://www.winehq.org/pipermail/wine-patches/attachments/20130211/0cc6690c/attachment-0001.obj>


More information about the wine-patches mailing list