Commit 485390de authored by Christian Costa's avatar Christian Costa Committed by Alexandre Julliard

Added missing notifications to MIDI_NotifyClient.

Made checks less strict in midPrepare, only return an error for buffer in queue. Fixed time of input events in Alsa driver.
parent 64851e16
...@@ -173,6 +173,7 @@ static DWORD MIDI_NotifyClient(UINT wDevID, WORD wMsg, ...@@ -173,6 +173,7 @@ static DWORD MIDI_NotifyClient(UINT wDevID, WORD wMsg,
case MOM_OPEN: case MOM_OPEN:
case MOM_CLOSE: case MOM_CLOSE:
case MOM_DONE: case MOM_DONE:
case MOM_POSITIONCB:
if (wDevID > MODM_NumDevs) if (wDevID > MODM_NumDevs)
return MMSYSERR_BADDEVICEID; return MMSYSERR_BADDEVICEID;
...@@ -185,7 +186,10 @@ static DWORD MIDI_NotifyClient(UINT wDevID, WORD wMsg, ...@@ -185,7 +186,10 @@ static DWORD MIDI_NotifyClient(UINT wDevID, WORD wMsg,
case MIM_OPEN: case MIM_OPEN:
case MIM_CLOSE: case MIM_CLOSE:
case MIM_DATA: case MIM_DATA:
case MIM_LONGDATA:
case MIM_ERROR: case MIM_ERROR:
case MIM_LONGERROR:
case MIM_MOREDATA:
if (wDevID > MIDM_NumDevs) if (wDevID > MIDM_NumDevs)
return MMSYSERR_BADDEVICEID; return MMSYSERR_BADDEVICEID;
...@@ -361,8 +365,7 @@ static VOID WINAPI midTimeCallback(HWND hwnd, UINT msg, UINT id, DWORD dwTime) ...@@ -361,8 +365,7 @@ static VOID WINAPI midTimeCallback(HWND hwnd, UINT msg, UINT id, DWORD dwTime)
if (toSend != 0) { if (toSend != 0) {
TRACE("Sending event %08lx (from %d %d)\n", toSend, ev->source.client, ev->source.port); TRACE("Sending event %08lx (from %d %d)\n", toSend, ev->source.client, ev->source.port);
/* FIXME: Should use ev->time instead for better accuracy */ /* FIXME: Should use ev->time instead for better accuracy */
dwTime -= MidiInDev[wDevID].startTime; if (MIDI_NotifyClient(wDevID, MIM_DATA, toSend, dwTime-MidiInDev[wDevID].startTime) != MMSYSERR_NOERROR) {
if (MIDI_NotifyClient(wDevID, MIM_DATA, toSend, dwTime) != MMSYSERR_NOERROR) {
WARN("Couldn't notify client\n"); WARN("Couldn't notify client\n");
} }
} }
...@@ -547,7 +550,7 @@ static DWORD midPrepare(WORD wDevID, LPMIDIHDR lpMidiHdr, DWORD dwSize) ...@@ -547,7 +550,7 @@ static DWORD midPrepare(WORD wDevID, LPMIDIHDR lpMidiHdr, DWORD dwSize)
TRACE("(%04X, %p, %08lX);\n", wDevID, lpMidiHdr, dwSize); TRACE("(%04X, %p, %08lX);\n", wDevID, lpMidiHdr, dwSize);
if (dwSize < sizeof(MIDIHDR) || lpMidiHdr == 0 || if (dwSize < sizeof(MIDIHDR) || lpMidiHdr == 0 ||
lpMidiHdr->lpData == 0 || lpMidiHdr->dwFlags != 0 || lpMidiHdr->lpData == 0 || (lpMidiHdr->dwFlags & MHDR_INQUEUE) != 0 ||
lpMidiHdr->dwBufferLength >= 0x10000ul) lpMidiHdr->dwBufferLength >= 0x10000ul)
return MMSYSERR_INVALPARAM; return MMSYSERR_INVALPARAM;
......
...@@ -348,6 +348,7 @@ static DWORD MIDI_NotifyClient(UINT wDevID, WORD wMsg, ...@@ -348,6 +348,7 @@ static DWORD MIDI_NotifyClient(UINT wDevID, WORD wMsg,
case MOM_OPEN: case MOM_OPEN:
case MOM_CLOSE: case MOM_CLOSE:
case MOM_DONE: case MOM_DONE:
case MOM_POSITIONCB:
if (wDevID > MODM_NumDevs) if (wDevID > MODM_NumDevs)
return MMSYSERR_BADDEVICEID; return MMSYSERR_BADDEVICEID;
...@@ -360,7 +361,10 @@ static DWORD MIDI_NotifyClient(UINT wDevID, WORD wMsg, ...@@ -360,7 +361,10 @@ static DWORD MIDI_NotifyClient(UINT wDevID, WORD wMsg,
case MIM_OPEN: case MIM_OPEN:
case MIM_CLOSE: case MIM_CLOSE:
case MIM_DATA: case MIM_DATA:
case MIM_LONGDATA:
case MIM_ERROR: case MIM_ERROR:
case MIM_LONGERROR:
case MIM_MOREDATA:
if (wDevID > MIDM_NumDevs) if (wDevID > MIDM_NumDevs)
return MMSYSERR_BADDEVICEID; return MMSYSERR_BADDEVICEID;
...@@ -771,7 +775,7 @@ static DWORD midPrepare(WORD wDevID, LPMIDIHDR lpMidiHdr, DWORD dwSize) ...@@ -771,7 +775,7 @@ static DWORD midPrepare(WORD wDevID, LPMIDIHDR lpMidiHdr, DWORD dwSize)
TRACE("(%04X, %p, %08lX);\n", wDevID, lpMidiHdr, dwSize); TRACE("(%04X, %p, %08lX);\n", wDevID, lpMidiHdr, dwSize);
if (dwSize < sizeof(MIDIHDR) || lpMidiHdr == 0 || if (dwSize < sizeof(MIDIHDR) || lpMidiHdr == 0 ||
lpMidiHdr->lpData == 0 || lpMidiHdr->dwFlags != 0 || lpMidiHdr->lpData == 0 || (lpMidiHdr->dwFlags & MHDR_INQUEUE) != 0 ||
lpMidiHdr->dwBufferLength >= 0x10000ul) lpMidiHdr->dwBufferLength >= 0x10000ul)
return MMSYSERR_INVALPARAM; return MMSYSERR_INVALPARAM;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment