mmsystem: MIDIHDR.dwOffset exists since Win 32 only, not in 16 bit code.

Joerg-Cyril.Hoehle at t-systems.com Joerg-Cyril.Hoehle at t-systems.com
Mon Mar 4 08:43:29 CST 2013


Hi,

The old code never had a working MOM_POSITIONCB and contained bogus assumptions
about the content of the message.  Actually dwParam1 points to the MIDIHDR...
-    case MOM_POSITIONCB:
-        FIXME("NIY\n");
-        /* FIXME: would require to recreate a 16bit MIDIHDR here */
-        *dwParam1 = *dwParam2 = 0;
So it's not as if I'm removing something that ever worked.

Remember that MOM_POSITIONCB is issued by midiStreamOut only, every time
the MEVT_F_CALLBACK bit is set in one of the events.  The current position
is then stored in the dwOffset field of the MIDIHDR.

Now please look up commit 64b6287e83c17f3c787060303a9fdcbec31d4c00
where I showed the difference between "old style" MIDIHDR and the new, larger
structure that contains a dwOffset field.  Back then my research was that
win 32 (WINVER >= 0x0400, i.e. w95 and NT4) introduced the larger header.

MIDIHDR16 knows no such field.  Let's use MIDIHDR16 everywhere in the
16 bit wrapper code and remove all references to dwOffset, with one note
left as a safe-guard:
+    case MOM_POSITIONCB:
+	/* MIDIHDR.dwOffset exists since Win 32 only */
+	FIXME("MOM_POSITIONCB/MEVT_F_CALLBACK wants MIDIHDR.dwOffset in 16 bit code\n");

Back then, somebody could have used the 32 bit SDK with dwOffset and compile a
16 bit app with it, couldn't they?  But would the 16 bit subsystem of w95
have known and delivered MOM_POSITIONCB when 3.11 didn't?  Let's assume it didn't.

An alternate patch would add dwOffset and some reserved[N strictly less than 8]
to MIDIHDR16 and fix the currently broken callback code.

Regards,
	Jörg Höhle
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-mmsystem-MIDIHDR.dwOffset-exists-since-Win-32-only.patch
Type: application/octet-stream
Size: 4685 bytes
Desc: 0001-mmsystem-MIDIHDR.dwOffset-exists-since-Win-32-only.patch
URL: <http://www.winehq.org/pipermail/wine-patches/attachments/20130304/b4db6685/attachment-0001.obj>


More information about the wine-patches mailing list