Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
96291a4b
Commit
96291a4b
authored
Dec 18, 2008
by
Christian Costa
Committed by
Alexandre Julliard
Dec 20, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winealsa.drv: Handle midi sysex greater than a buffer.
parent
2afc8fcd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
10 deletions
+17
-10
midi.c
dlls/winealsa.drv/midi.c
+17
-10
No files found.
dlls/winealsa.drv/midi.c
View file @
96291a4b
...
...
@@ -374,27 +374,34 @@ static DWORD WINAPI midRecThread(LPVOID arg)
break
;
case
SND_SEQ_EVENT_SYSEX
:
{
int
pos
=
0
;
int
len
=
ev
->
data
.
ext
.
len
;
LPBYTE
ptr
=
(
BYTE
*
)
ev
->
data
.
ext
.
ptr
;
LPMIDIHDR
lpMidiHdr
;
/* FIXME: Should handle sysex greater than lpMidiHdr->dwBufferLength */
EnterCriticalSection
(
&
crit_sect
);
if
((
lpMidiHdr
=
MidiInDev
[
wDevID
].
lpQueueHdr
)
!=
NULL
)
{
if
(
lpMidiHdr
->
dwBytesRecorded
+
len
<=
lpMidiHdr
->
dwBufferLength
)
{
memcpy
(
lpMidiHdr
->
lpData
+
lpMidiHdr
->
dwBytesRecorded
,
ptr
,
len
);
lpMidiHdr
->
dwBytesRecorded
+=
len
;
if
(
*
(
ptr
+
(
len
-
1
))
==
0xF7
)
{
while
(
len
)
{
if
((
lpMidiHdr
=
MidiInDev
[
wDevID
].
lpQueueHdr
)
!=
NULL
)
{
int
copylen
=
min
(
len
,
lpMidiHdr
->
dwBufferLength
-
lpMidiHdr
->
dwBytesRecorded
);
memcpy
(
lpMidiHdr
->
lpData
+
lpMidiHdr
->
dwBytesRecorded
,
ptr
+
pos
,
copylen
);
lpMidiHdr
->
dwBytesRecorded
+=
copylen
;
len
-=
copylen
;
pos
+=
copylen
;
/* We check if we reach the end of buffer or the end of sysex before notifying
* to handle the case where ALSA splitted the sysex into several events */
if
((
lpMidiHdr
->
dwBytesRecorded
==
lpMidiHdr
->
dwBufferLength
)
||
(
*
(
BYTE
*
)(
lpMidiHdr
->
lpData
+
lpMidiHdr
->
dwBytesRecorded
-
1
)
==
0xF7
))
{
lpMidiHdr
->
dwFlags
&=
~
MHDR_INQUEUE
;
lpMidiHdr
->
dwFlags
|=
MHDR_DONE
;
MidiInDev
[
wDevID
].
lpQueueHdr
=
(
LPMIDIHDR
)
lpMidiHdr
->
lpNext
;
if
(
MIDI_NotifyClient
(
wDevID
,
MIM_LONGDATA
,
(
DWORD_PTR
)
lpMidiHdr
,
dwTime
)
!=
MMSYSERR_NOERROR
)
WARN
(
"Couldn't notify client
\n
"
);
}
}
else
FIXME
(
"No enough space in the buffer to store sysex!
\n
"
);
}
else
FIXME
(
"Sysex received but no buffer to store it!
\n
"
);
}
else
{
FIXME
(
"Sysex data received but no buffer to store it!
\n
"
);
break
;
}
}
LeaveCriticalSection
(
&
crit_sect
);
}
break
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment