winmm: Do not access MIDIHDR past MOM_DONE DriverCallback.
This commit is contained in:
parent
e1cf94d9da
commit
63d0aeeafa
|
@ -1485,13 +1485,15 @@ static BOOL MMSYSTEM_MidiStream_MessageHandler(WINE_MIDIStream* lpMidiStrm, LPWI
|
||||||
/* this is not quite what MS doc says... */
|
/* this is not quite what MS doc says... */
|
||||||
midiOutReset(lpMidiStrm->hDevice);
|
midiOutReset(lpMidiStrm->hDevice);
|
||||||
/* empty list of already submitted buffers */
|
/* empty list of already submitted buffers */
|
||||||
for (lpMidiHdr = lpMidiStrm->lpMidiHdr; lpMidiHdr; lpMidiHdr = lpMidiHdr->lpNext) {
|
for (lpMidiHdr = lpMidiStrm->lpMidiHdr; lpMidiHdr; ) {
|
||||||
lpMidiHdr->dwFlags |= MHDR_DONE;
|
LPMIDIHDR lphdr = lpMidiHdr;
|
||||||
lpMidiHdr->dwFlags &= ~MHDR_INQUEUE;
|
lpMidiHdr = lpMidiHdr->lpNext;
|
||||||
|
lphdr->dwFlags |= MHDR_DONE;
|
||||||
|
lphdr->dwFlags &= ~MHDR_INQUEUE;
|
||||||
|
|
||||||
DriverCallback(lpwm->mod.dwCallback, lpMidiStrm->wFlags,
|
DriverCallback(lpwm->mod.dwCallback, lpMidiStrm->wFlags,
|
||||||
(HDRVR)lpMidiStrm->hDevice, MM_MOM_DONE,
|
(HDRVR)lpMidiStrm->hDevice, MM_MOM_DONE,
|
||||||
lpwm->mod.dwInstance, (DWORD_PTR)lpMidiHdr, 0);
|
lpwm->mod.dwInstance, (DWORD_PTR)lphdr, 0);
|
||||||
}
|
}
|
||||||
lpMidiStrm->lpMidiHdr = 0;
|
lpMidiStrm->lpMidiHdr = 0;
|
||||||
SetEvent(lpMidiStrm->hEvent);
|
SetEvent(lpMidiStrm->hEvent);
|
||||||
|
|
Loading…
Reference in New Issue