winecoreaudio: Do not access MIDIHDR past notification callback.
This commit is contained in:
parent
a1a2de1853
commit
c0d6db3944
|
@ -694,8 +694,8 @@ static DWORD MIDIIn_AddBuffer(WORD wDevID, LPMIDIHDR lpMidiHdr, DWORD dwSize)
|
||||||
LPMIDIHDR ptr;
|
LPMIDIHDR ptr;
|
||||||
for (ptr = sources[wDevID].lpQueueHdr;
|
for (ptr = sources[wDevID].lpQueueHdr;
|
||||||
ptr->lpNext != 0;
|
ptr->lpNext != 0;
|
||||||
ptr = (LPMIDIHDR)ptr->lpNext);
|
ptr = ptr->lpNext);
|
||||||
ptr->lpNext = (struct midihdr_tag*)lpMidiHdr;
|
ptr->lpNext = lpMidiHdr;
|
||||||
}
|
}
|
||||||
LeaveCriticalSection(&midiInLock);
|
LeaveCriticalSection(&midiInLock);
|
||||||
|
|
||||||
|
@ -806,11 +806,12 @@ static DWORD MIDIIn_Reset(WORD wDevID)
|
||||||
|
|
||||||
EnterCriticalSection(&midiInLock);
|
EnterCriticalSection(&midiInLock);
|
||||||
while (sources[wDevID].lpQueueHdr) {
|
while (sources[wDevID].lpQueueHdr) {
|
||||||
sources[wDevID].lpQueueHdr->dwFlags &= ~MHDR_INQUEUE;
|
LPMIDIHDR lpMidiHdr = sources[wDevID].lpQueueHdr;
|
||||||
sources[wDevID].lpQueueHdr->dwFlags |= MHDR_DONE;
|
sources[wDevID].lpQueueHdr = lpMidiHdr->lpNext;
|
||||||
|
lpMidiHdr->dwFlags &= ~MHDR_INQUEUE;
|
||||||
|
lpMidiHdr->dwFlags |= MHDR_DONE;
|
||||||
/* FIXME: when called from 16 bit, lpQueueHdr needs to be a segmented ptr */
|
/* FIXME: when called from 16 bit, lpQueueHdr needs to be a segmented ptr */
|
||||||
MIDI_NotifyClient(wDevID, MIM_LONGDATA, (DWORD)sources[wDevID].lpQueueHdr, dwTime);
|
MIDI_NotifyClient(wDevID, MIM_LONGDATA, (DWORD)lpMidiHdr, dwTime);
|
||||||
sources[wDevID].lpQueueHdr = (LPMIDIHDR)sources[wDevID].lpQueueHdr->lpNext;
|
|
||||||
}
|
}
|
||||||
LeaveCriticalSection(&midiInLock);
|
LeaveCriticalSection(&midiInLock);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue