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
ed7a3662
Commit
ed7a3662
authored
Jan 27, 2010
by
Jörg Höhle
Committed by
Alexandre Julliard
Feb 01, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
midimap: Perform stricter error-checking.
parent
c43c2a28
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
4 deletions
+17
-4
midimap.c
dlls/midimap/midimap.c
+17
-4
No files found.
dlls/midimap/midimap.c
View file @
ed7a3662
...
...
@@ -318,8 +318,14 @@ static DWORD modLongData(MIDIMAPDATA* mom, LPMIDIHDR lpMidiHdr, DWORD_PTR dwPara
if
(
MIDIMAP_IsBadData
(
mom
))
return
MMSYSERR_ERROR
;
if
(
!
(
lpMidiHdr
->
dwFlags
&
MHDR_PREPARED
))
return
MIDIERR_UNPREPARED
;
if
(
lpMidiHdr
->
dwFlags
&
MHDR_INQUEUE
)
return
MIDIERR_STILLPLAYING
;
mh
=
*
lpMidiHdr
;
lpMidiHdr
->
dwFlags
&=
~
MHDR_DONE
;
lpMidiHdr
->
dwFlags
|=
MHDR_INQUEUE
;
for
(
chn
=
0
;
chn
<
16
;
chn
++
)
{
if
(
mom
->
ChannelMap
[
chn
]
&&
mom
->
ChannelMap
[
chn
]
->
loaded
>
0
)
...
...
@@ -327,10 +333,15 @@ static DWORD modLongData(MIDIMAPDATA* mom, LPMIDIHDR lpMidiHdr, DWORD_PTR dwPara
mh
.
dwFlags
=
0
;
midiOutPrepareHeader
(
mom
->
ChannelMap
[
chn
]
->
hMidi
,
&
mh
,
sizeof
(
mh
));
ret
=
midiOutLongMsg
(
mom
->
ChannelMap
[
chn
]
->
hMidi
,
&
mh
,
sizeof
(
mh
));
/* As of 2009, wineXYZ.drv's LongData handlers are synchronous */
if
(
!
ret
&&
!
(
mh
.
dwFlags
&
MHDR_DONE
))
FIXME
(
"wait until MHDR_DONE
\n
"
);
midiOutUnprepareHeader
(
mom
->
ChannelMap
[
chn
]
->
hMidi
,
&
mh
,
sizeof
(
mh
));
if
(
ret
!=
MMSYSERR_NOERROR
)
break
;
}
}
lpMidiHdr
->
dwFlags
&=
~
MHDR_INQUEUE
;
lpMidiHdr
->
dwFlags
|=
MHDR_DONE
;
return
ret
;
}
...
...
@@ -397,21 +408,23 @@ static DWORD modData(MIDIMAPDATA* mom, DWORD_PTR dwParam)
return
ret
;
}
static
DWORD
modPrepare
(
MIDIMAPDATA
*
mom
,
LPMIDIHDR
lpMidiHdr
,
DWORD_PTR
dw
Param2
)
static
DWORD
modPrepare
(
MIDIMAPDATA
*
mom
,
LPMIDIHDR
lpMidiHdr
,
DWORD_PTR
dw
Size
)
{
if
(
MIDIMAP_IsBadData
(
mom
))
return
MMSYSERR_ERROR
;
if
(
lpMidiHdr
->
dwFlags
&
(
MHDR_ISSTRM
|
MHDR_PREPARED
))
if
(
dwSize
<
sizeof
(
MIDIHDR
)
||
lpMidiHdr
==
0
||
lpMidiHdr
->
lpData
==
0
||
(
lpMidiHdr
->
dwFlags
&
MHDR_INQUEUE
))
return
MMSYSERR_INVALPARAM
;
lpMidiHdr
->
dwFlags
|=
MHDR_PREPARED
;
lpMidiHdr
->
dwFlags
&=
~
MHDR_DONE
;
return
MMSYSERR_NOERROR
;
}
static
DWORD
modUnprepare
(
MIDIMAPDATA
*
mom
,
LPMIDIHDR
lpMidiHdr
,
DWORD_PTR
dwParam2
)
{
if
(
MIDIMAP_IsBadData
(
mom
))
return
MMSYSERR_ERROR
;
if
(
(
lpMidiHdr
->
dwFlags
&
MHDR_ISSTRM
)
||
!
(
lpMidiHdr
->
dwFlags
&
MHDR_PREPARED
))
return
MMSYSERR_INVALPARAM
;
if
(
!
(
lpMidiHdr
->
dwFlags
&
MHDR_PREPARED
))
return
MIDIERR_UNPREPARED
;
if
(
lpMidiHdr
->
dwFlags
&
MHDR_INQUEUE
)
return
MIDIERR_STILLPLAYING
;
lpMidiHdr
->
dwFlags
&=
~
MHDR_PREPARED
;
return
MMSYSERR_NOERROR
;
...
...
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