Signed-off-by: Andrew Eikum aeikum@codeweavers.com
On Tue, Apr 26, 2022 at 07:28:02AM +0100, Huw Davies wrote:
Signed-off-by: Huw Davies huw@codeweavers.com
dlls/wineoss.drv/midi.c | 38 -------------------------------------- dlls/wineoss.drv/ossmidi.c | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 38 deletions(-)
diff --git a/dlls/wineoss.drv/midi.c b/dlls/wineoss.drv/midi.c index 4f9e6b3c6f9..e796c9a7085 100644 --- a/dlls/wineoss.drv/midi.c +++ b/dlls/wineoss.drv/midi.c @@ -490,42 +490,6 @@ static DWORD midClose(WORD wDevID) return ret; }
-/**************************************************************************
midAddBuffer [internal]
- */
-static DWORD midAddBuffer(WORD wDevID, LPMIDIHDR lpMidiHdr, DWORD dwSize) -{
- TRACE("(%04X, %p, %d);\n", wDevID, lpMidiHdr, dwSize);
- if (wDevID >= MIDM_NumDevs) return MMSYSERR_BADDEVICEID;
- if (MidiInDev[wDevID].state == -1) return MIDIERR_NODEVICE;
- if (lpMidiHdr == NULL) return MMSYSERR_INVALPARAM;
- if (dwSize < offsetof(MIDIHDR,dwOffset)) return MMSYSERR_INVALPARAM;
- if (lpMidiHdr->dwBufferLength == 0) return MMSYSERR_INVALPARAM;
- if (lpMidiHdr->dwFlags & MHDR_INQUEUE) return MIDIERR_STILLPLAYING;
- if (!(lpMidiHdr->dwFlags & MHDR_PREPARED)) return MIDIERR_UNPREPARED;
- in_buffer_lock();
- lpMidiHdr->dwFlags &= ~WHDR_DONE;
- lpMidiHdr->dwFlags |= MHDR_INQUEUE;
- lpMidiHdr->dwBytesRecorded = 0;
- lpMidiHdr->lpNext = 0;
- if (MidiInDev[wDevID].lpQueueHdr == 0) {
- MidiInDev[wDevID].lpQueueHdr = lpMidiHdr;
- } else {
- LPMIDIHDR ptr;
- for (ptr = MidiInDev[wDevID].lpQueueHdr;
ptr->lpNext != 0;
ptr = ptr->lpNext);
- ptr->lpNext = lpMidiHdr;
- }
- in_buffer_unlock();
- return MMSYSERR_NOERROR;
-}
/**************************************************************************
midReset [internal]
*/ @@ -604,8 +568,6 @@ DWORD WINAPI OSS_midMessage(UINT wDevID, UINT wMsg, DWORD_PTR dwUser, return midOpen(wDevID, (LPMIDIOPENDESC)dwParam1, dwParam2); case MIDM_CLOSE: return midClose(wDevID);
- case MIDM_ADDBUFFER:
- return midAddBuffer(wDevID, (LPMIDIHDR)dwParam1, dwParam2); case MIDM_RESET: return midReset(wDevID); case MIDM_START:
diff --git a/dlls/wineoss.drv/ossmidi.c b/dlls/wineoss.drv/ossmidi.c index 2f75c4aa773..8fca6e32c41 100644 --- a/dlls/wineoss.drv/ossmidi.c +++ b/dlls/wineoss.drv/ossmidi.c @@ -1120,6 +1120,38 @@ static UINT midi_out_reset(WORD dev_id) return MMSYSERR_NOERROR; }
+static UINT midi_in_add_buffer(WORD dev_id, MIDIHDR *hdr, UINT hdr_size) +{
- struct midi_src *src;
- MIDIHDR **next;
- TRACE("(%04X, %p, %d);\n", dev_id, hdr, hdr_size);
- if (dev_id >= num_srcs) return MMSYSERR_BADDEVICEID;
- src = srcs + dev_id;
- if (src->state == -1) return MIDIERR_NODEVICE;
- if (!hdr || hdr_size < offsetof(MIDIHDR, dwOffset) || !hdr->dwBufferLength)
return MMSYSERR_INVALPARAM;
- if (hdr->dwFlags & MHDR_INQUEUE) return MIDIERR_STILLPLAYING;
- if (!(hdr->dwFlags & MHDR_PREPARED)) return MIDIERR_UNPREPARED;
- in_buffer_lock();
- hdr->dwFlags &= ~WHDR_DONE;
- hdr->dwFlags |= MHDR_INQUEUE;
- hdr->dwBytesRecorded = 0;
- hdr->lpNext = NULL;
- next = &src->lpQueueHdr;
- while (*next) next = &(*next)->lpNext;
- *next = hdr;
- in_buffer_unlock();
- return MMSYSERR_NOERROR;
+}
static UINT midi_in_prepare(WORD dev_id, MIDIHDR *hdr, UINT hdr_size) { TRACE("(%04X, %p, %d);\n", dev_id, hdr, hdr_size); @@ -1229,6 +1261,9 @@ NTSTATUS midi_in_message(void *args) /* FIXME: Pretend this is supported */ *params->err = MMSYSERR_NOERROR; break;
- case MIDM_ADDBUFFER:
*params->err = midi_in_add_buffer(params->dev_id, (MIDIHDR *)params->param_1, params->param_2);
case MIDM_PREPARE: *params->err = midi_in_prepare(params->dev_id, (MIDIHDR *)params->param_1, params->param_2); break;break;
-- 2.25.1