winecoreaudio: Switch midi_in_lock() away from a syscall prototype.
Signed-off-by: Huw Davies <huw@codeweavers.com> Signed-off-by: Andrew Eikum <aeikum@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
92f7c86f68
commit
61337a1d16
|
@ -136,13 +136,10 @@ static struct notify_context *notify_read, *notify_write;
|
||||||
|
|
||||||
#define MAX_MIDI_SYNTHS 1
|
#define MAX_MIDI_SYNTHS 1
|
||||||
|
|
||||||
NTSTATUS midi_in_lock(void *args)
|
static void midi_in_lock(BOOL lock)
|
||||||
{
|
{
|
||||||
BOOL lock = !!args;
|
|
||||||
|
|
||||||
if (lock) pthread_mutex_lock(&midi_in_mutex);
|
if (lock) pthread_mutex_lock(&midi_in_mutex);
|
||||||
else pthread_mutex_unlock(&midi_in_mutex);
|
else pthread_mutex_unlock(&midi_in_mutex);
|
||||||
return STATUS_SUCCESS;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void set_in_notify(struct notify_context *notify, struct midi_src *src, WORD dev_id, WORD msg,
|
static void set_in_notify(struct notify_context *notify, struct midi_src *src, WORD dev_id, WORD msg,
|
||||||
|
@ -228,7 +225,7 @@ static void process_sysex_packet(struct midi_src *src, MIDIPacket *packet)
|
||||||
|
|
||||||
src->state |= 2;
|
src->state |= 2;
|
||||||
|
|
||||||
midi_in_lock((void *)TRUE);
|
midi_in_lock(TRUE);
|
||||||
|
|
||||||
while (len)
|
while (len)
|
||||||
{
|
{
|
||||||
|
@ -253,7 +250,7 @@ static void process_sysex_packet(struct midi_src *src, MIDIPacket *packet)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
midi_in_lock((void *)FALSE);
|
midi_in_lock(FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void process_small_packet(struct midi_src *src, MIDIPacket *packet)
|
static void process_small_packet(struct midi_src *src, MIDIPacket *packet)
|
||||||
|
@ -981,13 +978,13 @@ static DWORD midi_in_add_buffer(WORD dev_id, MIDIHDR *hdr, DWORD hdr_size)
|
||||||
hdr->dwBytesRecorded = 0;
|
hdr->dwBytesRecorded = 0;
|
||||||
hdr->lpNext = NULL;
|
hdr->lpNext = NULL;
|
||||||
|
|
||||||
midi_in_lock((void *)TRUE);
|
midi_in_lock(TRUE);
|
||||||
|
|
||||||
next = &srcs[dev_id].lpQueueHdr;
|
next = &srcs[dev_id].lpQueueHdr;
|
||||||
while (*next) next = &(*next)->lpNext;
|
while (*next) next = &(*next)->lpNext;
|
||||||
*next = hdr;
|
*next = hdr;
|
||||||
|
|
||||||
midi_in_lock((void *)FALSE);
|
midi_in_lock(FALSE);
|
||||||
|
|
||||||
return MMSYSERR_NOERROR;
|
return MMSYSERR_NOERROR;
|
||||||
}
|
}
|
||||||
|
@ -1090,7 +1087,7 @@ static DWORD midi_in_reset(WORD dev_id, struct notify_context *notify)
|
||||||
}
|
}
|
||||||
src = srcs + dev_id;
|
src = srcs + dev_id;
|
||||||
|
|
||||||
midi_in_lock((void *)TRUE);
|
midi_in_lock(TRUE);
|
||||||
|
|
||||||
if (src->lpQueueHdr)
|
if (src->lpQueueHdr)
|
||||||
{
|
{
|
||||||
|
@ -1102,7 +1099,7 @@ static DWORD midi_in_reset(WORD dev_id, struct notify_context *notify)
|
||||||
if (src->lpQueueHdr) err = ERROR_RETRY; /* ask the client to call again */
|
if (src->lpQueueHdr) err = ERROR_RETRY; /* ask the client to call again */
|
||||||
}
|
}
|
||||||
|
|
||||||
midi_in_lock((void *)FALSE);
|
midi_in_lock(FALSE);
|
||||||
|
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue