Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
64b6287e
Commit
64b6287e
authored
Feb 16, 2010
by
Jörg Höhle
Committed by
Alexandre Julliard
Feb 22, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winmm: Accept the ancient, smaller MIDIHDR.
parent
a8f1d2eb
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
23 additions
and
22 deletions
+23
-22
midimap.c
dlls/midimap/midimap.c
+1
-1
midi.c
dlls/winealsa.drv/midi.c
+5
-5
midi.c
dlls/winecoreaudio.drv/midi.c
+6
-6
midi.c
dlls/wineoss.drv/midi.c
+5
-5
winmm.c
dlls/winmm/winmm.c
+5
-5
mmsystem.h
include/mmsystem.h
+1
-0
No files found.
dlls/midimap/midimap.c
View file @
64b6287e
...
...
@@ -425,7 +425,7 @@ static DWORD modData(MIDIMAPDATA* mom, DWORD_PTR dwParam)
static
DWORD
modPrepare
(
MIDIMAPDATA
*
mom
,
LPMIDIHDR
lpMidiHdr
,
DWORD_PTR
dwSize
)
{
if
(
MIDIMAP_IsBadData
(
mom
))
return
MMSYSERR_ERROR
;
if
(
dwSize
<
sizeof
(
MIDIHDR
)
||
lpMidiHdr
==
0
||
if
(
dwSize
<
offsetof
(
MIDIHDR
,
dwOffset
)
||
lpMidiHdr
==
0
||
lpMidiHdr
->
lpData
==
0
||
(
lpMidiHdr
->
dwFlags
&
MHDR_INQUEUE
))
return
MMSYSERR_INVALPARAM
;
...
...
dlls/winealsa.drv/midi.c
View file @
64b6287e
...
...
@@ -567,7 +567,7 @@ static DWORD midAddBuffer(WORD wDevID, LPMIDIHDR lpMidiHdr, DWORD dwSize)
if
(
MidiInDev
[
wDevID
].
state
==
-
1
)
return
MIDIERR_NODEVICE
;
if
(
lpMidiHdr
==
NULL
)
return
MMSYSERR_INVALPARAM
;
if
(
sizeof
(
MIDIHDR
)
>
dwSize
)
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
;
...
...
@@ -598,7 +598,7 @@ static DWORD midPrepare(WORD wDevID, LPMIDIHDR lpMidiHdr, DWORD dwSize)
{
TRACE
(
"(%04X, %p, %08X);
\n
"
,
wDevID
,
lpMidiHdr
,
dwSize
);
if
(
dwSize
<
sizeof
(
MIDIHDR
)
||
lpMidiHdr
==
0
||
if
(
dwSize
<
offsetof
(
MIDIHDR
,
dwOffset
)
||
lpMidiHdr
==
0
||
lpMidiHdr
->
lpData
==
0
||
(
lpMidiHdr
->
dwFlags
&
MHDR_INQUEUE
)
!=
0
)
return
MMSYSERR_INVALPARAM
;
...
...
@@ -619,7 +619,7 @@ static DWORD midUnprepare(WORD wDevID, LPMIDIHDR lpMidiHdr, DWORD dwSize)
if
(
wDevID
>=
MIDM_NumDevs
)
return
MMSYSERR_BADDEVICEID
;
if
(
MidiInDev
[
wDevID
].
state
==
-
1
)
return
MIDIERR_NODEVICE
;
if
(
dwSize
<
sizeof
(
MIDIHDR
)
||
lpMidiHdr
==
0
||
if
(
dwSize
<
offsetof
(
MIDIHDR
,
dwOffset
)
||
lpMidiHdr
==
0
||
lpMidiHdr
->
lpData
==
0
)
return
MMSYSERR_INVALPARAM
;
...
...
@@ -1032,7 +1032,7 @@ static DWORD modPrepare(WORD wDevID, LPMIDIHDR lpMidiHdr, DWORD dwSize)
* asks to prepare MIDIHDR which dwFlags != 0.
* So at least check for the inqueue flag
*/
if
(
dwSize
<
sizeof
(
MIDIHDR
)
||
lpMidiHdr
==
0
||
if
(
dwSize
<
offsetof
(
MIDIHDR
,
dwOffset
)
||
lpMidiHdr
==
0
||
lpMidiHdr
->
lpData
==
0
||
(
lpMidiHdr
->
dwFlags
&
MHDR_INQUEUE
)
!=
0
)
{
WARN
(
"%p %p %08x %d
\n
"
,
lpMidiHdr
,
lpMidiHdr
?
lpMidiHdr
->
lpData
:
NULL
,
lpMidiHdr
?
lpMidiHdr
->
dwFlags
:
0
,
dwSize
);
...
...
@@ -1057,7 +1057,7 @@ static DWORD modUnprepare(WORD wDevID, LPMIDIHDR lpMidiHdr, DWORD dwSize)
return
MMSYSERR_NOTENABLED
;
}
if
(
dwSize
<
sizeof
(
MIDIHDR
)
||
lpMidiHdr
==
0
)
if
(
dwSize
<
offsetof
(
MIDIHDR
,
dwOffset
)
||
lpMidiHdr
==
0
)
return
MMSYSERR_INVALPARAM
;
if
(
lpMidiHdr
->
dwFlags
&
MHDR_INQUEUE
)
return
MIDIERR_STILLPLAYING
;
...
...
dlls/winecoreaudio.drv/midi.c
View file @
64b6287e
...
...
@@ -463,10 +463,10 @@ static DWORD MIDIOut_Prepare(WORD wDevID, LPMIDIHDR lpMidiHdr, DWORD dwSize)
* asks to prepare MIDIHDR which dwFlags != 0.
* So at least check for the inqueue flag
*/
if
(
dwSize
<
sizeof
(
MIDIHDR
)
||
lpMidiHdr
==
0
||
if
(
dwSize
<
offsetof
(
MIDIHDR
,
dwOffset
)
||
lpMidiHdr
==
0
||
lpMidiHdr
->
lpData
==
0
||
(
lpMidiHdr
->
dwFlags
&
MHDR_INQUEUE
)
!=
0
)
{
WARN
(
"%p %p %08x %lu/%d
\n
"
,
lpMidiHdr
,
lpMidiHdr
->
lpData
,
lpMidiHdr
->
dwFlags
,
sizeof
(
MIDIHDR
),
dwSize
);
lpMidiHdr
->
dwFlags
,
offsetof
(
MIDIHDR
,
dwOffset
),
dwSize
);
return
MMSYSERR_INVALPARAM
;
}
...
...
@@ -487,7 +487,7 @@ static DWORD MIDIOut_Unprepare(WORD wDevID, LPMIDIHDR lpMidiHdr, DWORD dwSize)
WARN
(
"bad device ID : %d
\n
"
,
wDevID
);
return
MMSYSERR_BADDEVICEID
;
}
if
(
dwSize
<
sizeof
(
MIDIHDR
)
||
lpMidiHdr
==
0
)
if
(
dwSize
<
offsetof
(
MIDIHDR
,
dwOffset
)
||
lpMidiHdr
==
0
)
return
MMSYSERR_INVALPARAM
;
if
(
lpMidiHdr
->
dwFlags
&
MHDR_INQUEUE
)
return
MIDIERR_STILLPLAYING
;
...
...
@@ -666,7 +666,7 @@ static DWORD MIDIIn_AddBuffer(WORD wDevID, LPMIDIHDR lpMidiHdr, DWORD dwSize)
WARN
(
"Invalid Parameter
\n
"
);
return
MMSYSERR_INVALPARAM
;
}
if
(
sizeof
(
MIDIHDR
)
>
dwSize
)
{
if
(
dwSize
<
offsetof
(
MIDIHDR
,
dwOffset
)
)
{
WARN
(
"Invalid Parameter
\n
"
);
return
MMSYSERR_INVALPARAM
;
}
...
...
@@ -714,7 +714,7 @@ static DWORD MIDIIn_Prepare(WORD wDevID, LPMIDIHDR lpMidiHdr, DWORD dwSize)
* asks to prepare MIDIHDR which dwFlags != 0.
* So at least check for the inqueue flag
*/
if
(
dwSize
<
sizeof
(
MIDIHDR
)
||
lpMidiHdr
==
0
||
if
(
dwSize
<
offsetof
(
MIDIHDR
,
dwOffset
)
||
lpMidiHdr
==
0
||
lpMidiHdr
->
lpData
==
0
||
(
lpMidiHdr
->
dwFlags
&
MHDR_INQUEUE
)
!=
0
)
{
WARN
(
"Invalid parameter %p %p %08x %d
\n
"
,
lpMidiHdr
,
lpMidiHdr
->
lpData
,
lpMidiHdr
->
dwFlags
,
dwSize
);
...
...
@@ -734,7 +734,7 @@ static DWORD MIDIIn_Unprepare(WORD wDevID, LPMIDIHDR lpMidiHdr, DWORD dwSize)
WARN
(
"bad device ID : %d
\n
"
,
wDevID
);
return
MMSYSERR_BADDEVICEID
;
}
if
(
dwSize
<
sizeof
(
MIDIHDR
)
||
lpMidiHdr
==
0
)
{
if
(
dwSize
<
offsetof
(
MIDIHDR
,
dwOffset
)
||
lpMidiHdr
==
0
)
{
WARN
(
"Invalid Parameter
\n
"
);
return
MMSYSERR_INVALPARAM
;
}
...
...
dlls/wineoss.drv/midi.c
View file @
64b6287e
...
...
@@ -829,7 +829,7 @@ static DWORD midAddBuffer(WORD wDevID, LPMIDIHDR lpMidiHdr, DWORD dwSize)
if
(
MidiInDev
[
wDevID
].
state
==
-
1
)
return
MIDIERR_NODEVICE
;
if
(
lpMidiHdr
==
NULL
)
return
MMSYSERR_INVALPARAM
;
if
(
sizeof
(
MIDIHDR
)
>
dwSize
)
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
;
...
...
@@ -861,7 +861,7 @@ static DWORD midPrepare(WORD wDevID, LPMIDIHDR lpMidiHdr, DWORD dwSize)
{
TRACE
(
"(%04X, %p, %08X);
\n
"
,
wDevID
,
lpMidiHdr
,
dwSize
);
if
(
dwSize
<
sizeof
(
MIDIHDR
)
||
lpMidiHdr
==
0
||
if
(
dwSize
<
offsetof
(
MIDIHDR
,
dwOffset
)
||
lpMidiHdr
==
0
||
lpMidiHdr
->
lpData
==
0
||
(
lpMidiHdr
->
dwFlags
&
MHDR_INQUEUE
)
!=
0
)
return
MMSYSERR_INVALPARAM
;
...
...
@@ -882,7 +882,7 @@ static DWORD midUnprepare(WORD wDevID, LPMIDIHDR lpMidiHdr, DWORD dwSize)
if
(
wDevID
>=
MIDM_NumDevs
)
return
MMSYSERR_BADDEVICEID
;
if
(
MidiInDev
[
wDevID
].
state
==
-
1
)
return
MIDIERR_NODEVICE
;
if
(
dwSize
<
sizeof
(
MIDIHDR
)
||
lpMidiHdr
==
0
||
if
(
dwSize
<
offsetof
(
MIDIHDR
,
dwOffset
)
||
lpMidiHdr
==
0
||
lpMidiHdr
->
lpData
==
0
)
return
MMSYSERR_INVALPARAM
;
...
...
@@ -1595,7 +1595,7 @@ static DWORD modPrepare(WORD wDevID, LPMIDIHDR lpMidiHdr, DWORD dwSize)
* asks to prepare MIDIHDR which dwFlags != 0.
* So at least check for the inqueue flag
*/
if
(
dwSize
<
sizeof
(
MIDIHDR
)
||
lpMidiHdr
==
0
||
if
(
dwSize
<
offsetof
(
MIDIHDR
,
dwOffset
)
||
lpMidiHdr
==
0
||
lpMidiHdr
->
lpData
==
0
||
(
lpMidiHdr
->
dwFlags
&
MHDR_INQUEUE
)
!=
0
)
{
WARN
(
"%p %p %08x %d
\n
"
,
lpMidiHdr
,
lpMidiHdr
?
lpMidiHdr
->
lpData
:
NULL
,
lpMidiHdr
?
lpMidiHdr
->
dwFlags
:
0
,
dwSize
);
...
...
@@ -1620,7 +1620,7 @@ static DWORD modUnprepare(WORD wDevID, LPMIDIHDR lpMidiHdr, DWORD dwSize)
return
MMSYSERR_NOTENABLED
;
}
if
(
dwSize
<
sizeof
(
MIDIHDR
)
||
lpMidiHdr
==
0
)
if
(
dwSize
<
offsetof
(
MIDIHDR
,
dwOffset
)
||
lpMidiHdr
==
0
)
return
MMSYSERR_INVALPARAM
;
if
(
lpMidiHdr
->
dwFlags
&
MHDR_INQUEUE
)
return
MIDIERR_STILLPLAYING
;
...
...
dlls/winmm/winmm.c
View file @
64b6287e
...
...
@@ -964,7 +964,7 @@ UINT WINAPI midiOutPrepareHeader(HMIDIOUT hMidiOut,
TRACE
(
"(%p, %p, %d)
\n
"
,
hMidiOut
,
lpMidiOutHdr
,
uSize
);
if
(
lpMidiOutHdr
==
NULL
||
uSize
<
sizeof
(
MIDIHDR
))
if
(
lpMidiOutHdr
==
NULL
||
uSize
<
offsetof
(
MIDIHDR
,
dwOffset
))
return
MMSYSERR_INVALPARAM
;
if
((
wmld
=
MMDRV_Get
(
hMidiOut
,
MMDRV_MIDIOUT
,
FALSE
))
==
NULL
)
...
...
@@ -984,7 +984,7 @@ UINT WINAPI midiOutUnprepareHeader(HMIDIOUT hMidiOut,
TRACE
(
"(%p, %p, %d)
\n
"
,
hMidiOut
,
lpMidiOutHdr
,
uSize
);
if
(
lpMidiOutHdr
==
NULL
||
uSize
<
sizeof
(
MIDIHDR
))
if
(
lpMidiOutHdr
==
NULL
||
uSize
<
offsetof
(
MIDIHDR
,
dwOffset
))
return
MMSYSERR_INVALPARAM
;
if
(
!
(
lpMidiOutHdr
->
dwFlags
&
MHDR_PREPARED
))
{
...
...
@@ -1258,7 +1258,7 @@ UINT WINAPI midiInPrepareHeader(HMIDIIN hMidiIn,
TRACE
(
"(%p, %p, %d)
\n
"
,
hMidiIn
,
lpMidiInHdr
,
uSize
);
if
(
lpMidiInHdr
==
NULL
||
uSize
<
sizeof
(
MIDIHDR
))
if
(
lpMidiInHdr
==
NULL
||
uSize
<
offsetof
(
MIDIHDR
,
dwOffset
))
return
MMSYSERR_INVALPARAM
;
if
((
wmld
=
MMDRV_Get
(
hMidiIn
,
MMDRV_MIDIIN
,
FALSE
))
==
NULL
)
...
...
@@ -1277,7 +1277,7 @@ UINT WINAPI midiInUnprepareHeader(HMIDIIN hMidiIn,
TRACE
(
"(%p, %p, %d)
\n
"
,
hMidiIn
,
lpMidiInHdr
,
uSize
);
if
(
lpMidiInHdr
==
NULL
||
uSize
<
sizeof
(
MIDIHDR
))
if
(
lpMidiInHdr
==
NULL
||
uSize
<
offsetof
(
MIDIHDR
,
dwOffset
))
return
MMSYSERR_INVALPARAM
;
if
(
!
(
lpMidiInHdr
->
dwFlags
&
MHDR_PREPARED
))
{
...
...
@@ -1819,7 +1819,7 @@ MMRESULT WINAPI midiStreamOut(HMIDISTRM hMidiStrm, LPMIDIHDR lpMidiHdr,
TRACE
(
"(%p, %p, %u)!
\n
"
,
hMidiStrm
,
lpMidiHdr
,
cbMidiHdr
);
if
(
cbMidiHdr
<
sizeof
(
MIDIHDR
)
||
!
lpMidiHdr
||
!
lpMidiHdr
->
lpData
if
(
cbMidiHdr
<
offsetof
(
MIDIHDR
,
dwOffset
)
||
!
lpMidiHdr
||
!
lpMidiHdr
->
lpData
||
lpMidiHdr
->
dwBufferLength
<
lpMidiHdr
->
dwBytesRecorded
)
return
MMSYSERR_INVALPARAM
;
/* FIXME: Native additionaly checks if the MIDIEVENTs in lpData
...
...
include/mmsystem.h
View file @
64b6287e
...
...
@@ -718,6 +718,7 @@ typedef struct midihdr_tag {
DWORD
dwFlags
;
struct
midihdr_tag
*
lpNext
;
DWORD_PTR
reserved
;
/* Win 32 extended the structure with these 2 fields */
DWORD
dwOffset
;
DWORD_PTR
dwReserved
[
8
];
}
MIDIHDR
,
*
LPMIDIHDR
;
...
...
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