Commit 4f1604e9 authored by Jörg Höhle's avatar Jörg Höhle Committed by Alexandre Julliard

wineoss: Ignore failure to notify MIDI clients.

parent 44478b53
...@@ -398,7 +398,7 @@ LRESULT OSS_MidiExit(void) ...@@ -398,7 +398,7 @@ LRESULT OSS_MidiExit(void)
/************************************************************************** /**************************************************************************
* MIDI_NotifyClient [internal] * MIDI_NotifyClient [internal]
*/ */
static DWORD MIDI_NotifyClient(UINT wDevID, WORD wMsg, static void MIDI_NotifyClient(UINT wDevID, WORD wMsg,
DWORD dwParam1, DWORD dwParam2) DWORD dwParam1, DWORD dwParam2)
{ {
DWORD dwCallBack; DWORD dwCallBack;
...@@ -414,8 +414,7 @@ static DWORD MIDI_NotifyClient(UINT wDevID, WORD wMsg, ...@@ -414,8 +414,7 @@ static DWORD MIDI_NotifyClient(UINT wDevID, WORD wMsg,
case MOM_CLOSE: case MOM_CLOSE:
case MOM_DONE: case MOM_DONE:
case MOM_POSITIONCB: case MOM_POSITIONCB:
if (wDevID > MODM_NumDevs) if (wDevID > MODM_NumDevs) return;
return MMSYSERR_BADDEVICEID;
dwCallBack = MidiOutDev[wDevID].midiDesc.dwCallback; dwCallBack = MidiOutDev[wDevID].midiDesc.dwCallback;
uFlags = MidiOutDev[wDevID].wFlags; uFlags = MidiOutDev[wDevID].wFlags;
...@@ -430,8 +429,7 @@ static DWORD MIDI_NotifyClient(UINT wDevID, WORD wMsg, ...@@ -430,8 +429,7 @@ static DWORD MIDI_NotifyClient(UINT wDevID, WORD wMsg,
case MIM_ERROR: case MIM_ERROR:
case MIM_LONGERROR: case MIM_LONGERROR:
case MIM_MOREDATA: case MIM_MOREDATA:
if (wDevID > MIDM_NumDevs) if (wDevID > MIDM_NumDevs) return;
return MMSYSERR_BADDEVICEID;
dwCallBack = MidiInDev[wDevID].midiDesc.dwCallback; dwCallBack = MidiInDev[wDevID].midiDesc.dwCallback;
uFlags = MidiInDev[wDevID].wFlags; uFlags = MidiInDev[wDevID].wFlags;
...@@ -439,12 +437,11 @@ static DWORD MIDI_NotifyClient(UINT wDevID, WORD wMsg, ...@@ -439,12 +437,11 @@ static DWORD MIDI_NotifyClient(UINT wDevID, WORD wMsg,
dwInstance = MidiInDev[wDevID].midiDesc.dwInstance; dwInstance = MidiInDev[wDevID].midiDesc.dwInstance;
break; break;
default: default:
WARN("Unsupported MSW-MIDI message %u\n", wMsg); ERR("Unsupported MSW-MIDI message %u\n", wMsg);
return MMSYSERR_ERROR; return;
} }
return DriverCallback(dwCallBack, uFlags, hDev, wMsg, dwInstance, dwParam1, dwParam2) ? DriverCallback(dwCallBack, uFlags, hDev, wMsg, dwInstance, dwParam1, dwParam2);
0 : MMSYSERR_ERROR;
} }
static int midi_warn = 1; static int midi_warn = 1;
...@@ -569,9 +566,7 @@ static void midReceiveChar(WORD wDevID, unsigned char value, DWORD dwTime) ...@@ -569,9 +566,7 @@ static void midReceiveChar(WORD wDevID, unsigned char value, DWORD dwTime)
lpMidiHdr->dwFlags &= ~MHDR_INQUEUE; lpMidiHdr->dwFlags &= ~MHDR_INQUEUE;
lpMidiHdr->dwFlags |= MHDR_DONE; lpMidiHdr->dwFlags |= MHDR_DONE;
MidiInDev[wDevID].lpQueueHdr = lpMidiHdr->lpNext; MidiInDev[wDevID].lpQueueHdr = lpMidiHdr->lpNext;
if (MIDI_NotifyClient(wDevID, MIM_LONGDATA, (DWORD_PTR)lpMidiHdr, dwTime) != MMSYSERR_NOERROR) { MIDI_NotifyClient(wDevID, MIM_LONGDATA, (DWORD_PTR)lpMidiHdr, dwTime);
WARN("Couldn't notify client\n");
}
} }
LeaveCriticalSection(&crit_sect); LeaveCriticalSection(&crit_sect);
return; return;
...@@ -637,9 +632,7 @@ static void midReceiveChar(WORD wDevID, unsigned char value, DWORD dwTime) ...@@ -637,9 +632,7 @@ static void midReceiveChar(WORD wDevID, unsigned char value, DWORD dwTime)
TRACE("Sending event %08x\n", toSend); TRACE("Sending event %08x\n", toSend);
MidiInDev[wDevID].incLen = 0; MidiInDev[wDevID].incLen = 0;
dwTime -= MidiInDev[wDevID].startTime; dwTime -= MidiInDev[wDevID].startTime;
if (MIDI_NotifyClient(wDevID, MIM_DATA, toSend, dwTime) != MMSYSERR_NOERROR) { MIDI_NotifyClient(wDevID, MIM_DATA, toSend, dwTime);
WARN("Couldn't notify client\n");
}
} }
} }
...@@ -779,10 +772,7 @@ static DWORD midOpen(WORD wDevID, LPMIDIOPENDESC lpDesc, DWORD dwFlags) ...@@ -779,10 +772,7 @@ static DWORD midOpen(WORD wDevID, LPMIDIOPENDESC lpDesc, DWORD dwFlags)
MidiInDev[wDevID].incLen = 0; MidiInDev[wDevID].incLen = 0;
MidiInDev[wDevID].startTime = 0; MidiInDev[wDevID].startTime = 0;
if (MIDI_NotifyClient(wDevID, MIM_OPEN, 0L, 0L) != MMSYSERR_NOERROR) { MIDI_NotifyClient(wDevID, MIM_OPEN, 0L, 0L);
WARN("can't notify client !\n");
return MMSYSERR_INVALPARAM;
}
return MMSYSERR_NOERROR; return MMSYSERR_NOERROR;
} }
...@@ -823,10 +813,7 @@ static DWORD midClose(WORD wDevID) ...@@ -823,10 +813,7 @@ static DWORD midClose(WORD wDevID)
midiCloseSeq(); midiCloseSeq();
MidiInDev[wDevID].bufsize = 0; MidiInDev[wDevID].bufsize = 0;
if (MIDI_NotifyClient(wDevID, MIM_CLOSE, 0L, 0L) != MMSYSERR_NOERROR) { MIDI_NotifyClient(wDevID, MIM_CLOSE, 0L, 0L);
WARN("can't notify client !\n");
ret = MMSYSERR_INVALPARAM;
}
MidiInDev[wDevID].midiDesc.hMidi = 0; MidiInDev[wDevID].midiDesc.hMidi = 0;
return ret; return ret;
} }
...@@ -924,10 +911,8 @@ static DWORD midReset(WORD wDevID) ...@@ -924,10 +911,8 @@ static DWORD midReset(WORD wDevID)
MidiInDev[wDevID].lpQueueHdr->dwFlags &= ~MHDR_INQUEUE; MidiInDev[wDevID].lpQueueHdr->dwFlags &= ~MHDR_INQUEUE;
MidiInDev[wDevID].lpQueueHdr->dwFlags |= MHDR_DONE; MidiInDev[wDevID].lpQueueHdr->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 */
if (MIDI_NotifyClient(wDevID, MIM_LONGDATA, MIDI_NotifyClient(wDevID, MIM_LONGDATA,
(DWORD_PTR)MidiInDev[wDevID].lpQueueHdr, dwTime) != MMSYSERR_NOERROR) { (DWORD_PTR)MidiInDev[wDevID].lpQueueHdr, dwTime);
WARN("Couldn't notify client\n");
}
MidiInDev[wDevID].lpQueueHdr = MidiInDev[wDevID].lpQueueHdr->lpNext; MidiInDev[wDevID].lpQueueHdr = MidiInDev[wDevID].lpQueueHdr->lpNext;
} }
LeaveCriticalSection(&crit_sect); LeaveCriticalSection(&crit_sect);
...@@ -1174,10 +1159,7 @@ static DWORD modOpen(WORD wDevID, LPMIDIOPENDESC lpDesc, DWORD dwFlags) ...@@ -1174,10 +1159,7 @@ static DWORD modOpen(WORD wDevID, LPMIDIOPENDESC lpDesc, DWORD dwFlags)
MidiOutDev[wDevID].bufsize = 0x3FFF; MidiOutDev[wDevID].bufsize = 0x3FFF;
MidiOutDev[wDevID].midiDesc = *lpDesc; MidiOutDev[wDevID].midiDesc = *lpDesc;
if (MIDI_NotifyClient(wDevID, MOM_OPEN, 0L, 0L) != MMSYSERR_NOERROR) { MIDI_NotifyClient(wDevID, MOM_OPEN, 0L, 0L);
WARN("can't notify client !\n");
return MMSYSERR_INVALPARAM;
}
TRACE("Successful !\n"); TRACE("Successful !\n");
return MMSYSERR_NOERROR; return MMSYSERR_NOERROR;
} }
...@@ -1219,10 +1201,7 @@ static DWORD modClose(WORD wDevID) ...@@ -1219,10 +1201,7 @@ static DWORD modClose(WORD wDevID)
MidiOutDev[wDevID].lpExtra = 0; MidiOutDev[wDevID].lpExtra = 0;
MidiOutDev[wDevID].bufsize = 0; MidiOutDev[wDevID].bufsize = 0;
if (MIDI_NotifyClient(wDevID, MOM_CLOSE, 0L, 0L) != MMSYSERR_NOERROR) { MIDI_NotifyClient(wDevID, MOM_CLOSE, 0L, 0L);
WARN("can't notify client !\n");
ret = MMSYSERR_INVALPARAM;
}
MidiOutDev[wDevID].midiDesc.hMidi = 0; MidiOutDev[wDevID].midiDesc.hMidi = 0;
return ret; return ret;
} }
...@@ -1596,10 +1575,7 @@ static DWORD modLongData(WORD wDevID, LPMIDIHDR lpMidiHdr, DWORD dwSize) ...@@ -1596,10 +1575,7 @@ static DWORD modLongData(WORD wDevID, LPMIDIHDR lpMidiHdr, DWORD dwSize)
lpMidiHdr->dwFlags &= ~MHDR_INQUEUE; lpMidiHdr->dwFlags &= ~MHDR_INQUEUE;
lpMidiHdr->dwFlags |= MHDR_DONE; lpMidiHdr->dwFlags |= MHDR_DONE;
if (MIDI_NotifyClient(wDevID, MOM_DONE, (DWORD_PTR)lpMidiHdr, 0L) != MMSYSERR_NOERROR) { MIDI_NotifyClient(wDevID, MOM_DONE, (DWORD_PTR)lpMidiHdr, 0L);
WARN("can't notify client !\n");
return MMSYSERR_INVALPARAM;
}
return MMSYSERR_NOERROR; return MMSYSERR_NOERROR;
} }
......
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