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
7b21da56
Commit
7b21da56
authored
Feb 27, 2013
by
Jörg Höhle
Committed by
Alexandre Julliard
Mar 05, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mmsystem: MIDIHDR.dwOffset exists since Win 32 only, not in 16 bit code.
parent
fe7a057a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
24 deletions
+14
-24
message16.c
dlls/mmsystem.dll16/message16.c
+14
-24
No files found.
dlls/mmsystem.dll16/message16.c
View file @
7b21da56
...
@@ -119,13 +119,11 @@ static void MMSYSTDRV_MidiIn_MapCB(UINT uMsg, DWORD_PTR* dwUser, DW
...
@@ -119,13 +119,11 @@ static void MMSYSTDRV_MidiIn_MapCB(UINT uMsg, DWORD_PTR* dwUser, DW
{
{
LPMIDIHDR
mh32
=
(
LPMIDIHDR
)(
*
dwParam1
);
LPMIDIHDR
mh32
=
(
LPMIDIHDR
)(
*
dwParam1
);
SEGPTR
segmh16
=
*
(
SEGPTR
*
)((
LPSTR
)
mh32
-
sizeof
(
LPMIDIHDR
));
SEGPTR
segmh16
=
*
(
SEGPTR
*
)((
LPSTR
)
mh32
-
sizeof
(
LPMIDIHDR
));
LPMIDIHDR
mh16
=
MapSL
(
segmh16
);
LPMIDIHDR
16
mh16
=
MapSL
(
segmh16
);
*
dwParam1
=
(
DWORD
)
segmh16
;
*
dwParam1
=
(
DWORD
)
segmh16
;
mh16
->
dwFlags
=
mh32
->
dwFlags
;
mh16
->
dwFlags
=
mh32
->
dwFlags
;
mh16
->
dwBytesRecorded
=
mh32
->
dwBytesRecorded
;
mh16
->
dwBytesRecorded
=
mh32
->
dwBytesRecorded
;
if
(
mh16
->
reserved
>=
sizeof
(
MIDIHDR
))
mh16
->
dwOffset
=
mh32
->
dwOffset
;
}
}
break
;
break
;
default:
default:
...
@@ -178,7 +176,7 @@ static MMSYSTEM_MapType MMSYSTDRV_MidiOut_Map16To32W (UINT wMsg, DWORD_PTR* lpP
...
@@ -178,7 +176,7 @@ static MMSYSTEM_MapType MMSYSTDRV_MidiOut_Map16To32W (UINT wMsg, DWORD_PTR* lpP
case
MODM_PREPARE
:
case
MODM_PREPARE
:
{
{
LPMIDIHDR
mh32
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
LPMIDIHDR
)
+
sizeof
(
MIDIHDR
));
LPMIDIHDR
mh32
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
LPMIDIHDR
)
+
sizeof
(
MIDIHDR
));
LPMIDIHDR
mh16
=
MapSL
(
*
lpParam1
);
LPMIDIHDR
16
mh16
=
MapSL
(
*
lpParam1
);
if
(
mh32
)
{
if
(
mh32
)
{
*
(
LPMIDIHDR
*
)
mh32
=
(
LPMIDIHDR
)
*
lpParam1
;
*
(
LPMIDIHDR
*
)
mh32
=
(
LPMIDIHDR
)
*
lpParam1
;
...
@@ -188,12 +186,9 @@ static MMSYSTEM_MapType MMSYSTDRV_MidiOut_Map16To32W (UINT wMsg, DWORD_PTR* lpP
...
@@ -188,12 +186,9 @@ static MMSYSTEM_MapType MMSYSTDRV_MidiOut_Map16To32W (UINT wMsg, DWORD_PTR* lpP
mh32
->
dwBytesRecorded
=
mh16
->
dwBytesRecorded
;
mh32
->
dwBytesRecorded
=
mh16
->
dwBytesRecorded
;
mh32
->
dwUser
=
mh16
->
dwUser
;
mh32
->
dwUser
=
mh16
->
dwUser
;
mh32
->
dwFlags
=
mh16
->
dwFlags
;
mh32
->
dwFlags
=
mh16
->
dwFlags
;
mh32
->
dwOffset
=
(
*
lpParam2
>=
sizeof
(
MIDIHDR
))
?
mh16
->
dwOffset
:
0
;
mh16
->
lpNext
=
(
MIDIHDR16
*
)
mh32
;
/* for reuse in unprepare and write */
mh16
->
lpNext
=
mh32
;
/* for reuse in unprepare and write */
/* store size of passed MIDIHDR?? structure to know if dwOffset is available or not */
mh16
->
reserved
=
*
lpParam2
;
*
lpParam1
=
(
DWORD
)
mh32
;
*
lpParam1
=
(
DWORD
)
mh32
;
*
lpParam2
=
sizeof
(
MIDIHDR
);
*
lpParam2
=
offsetof
(
MIDIHDR
,
dwOffset
);
/* old size, without dwOffset */
ret
=
MMSYSTEM_MAP_OKMEM
;
ret
=
MMSYSTEM_MAP_OKMEM
;
}
else
{
}
else
{
...
@@ -204,11 +199,11 @@ static MMSYSTEM_MapType MMSYSTDRV_MidiOut_Map16To32W (UINT wMsg, DWORD_PTR* lpP
...
@@ -204,11 +199,11 @@ static MMSYSTEM_MapType MMSYSTDRV_MidiOut_Map16To32W (UINT wMsg, DWORD_PTR* lpP
case
MODM_UNPREPARE
:
case
MODM_UNPREPARE
:
case
MODM_LONGDATA
:
case
MODM_LONGDATA
:
{
{
LPMIDIHDR
mh16
=
MapSL
(
*
lpParam1
);
LPMIDIHDR
16
mh16
=
MapSL
(
*
lpParam1
);
LPMIDIHDR
mh32
=
mh16
->
lpNext
;
LPMIDIHDR
mh32
=
(
MIDIHDR
*
)
mh16
->
lpNext
;
*
lpParam1
=
(
DWORD
)
mh32
;
*
lpParam1
=
(
DWORD
)
mh32
;
*
lpParam2
=
sizeof
(
MIDIHDR
);
*
lpParam2
=
offsetof
(
MIDIHDR
,
dwOffset
);
/* dwBufferLength can be reduced between prepare & write */
/* dwBufferLength can be reduced between prepare & write */
if
(
wMsg
==
MODM_LONGDATA
&&
mh32
->
dwBufferLength
<
mh16
->
dwBufferLength
)
{
if
(
wMsg
==
MODM_LONGDATA
&&
mh32
->
dwBufferLength
<
mh16
->
dwBufferLength
)
{
ERR
(
"Size of buffer has been increased from %d to %d, keeping initial value
\n
"
,
ERR
(
"Size of buffer has been increased from %d to %d, keeping initial value
\n
"
,
...
@@ -273,12 +268,10 @@ static MMSYSTEM_MapType MMSYSTDRV_MidiOut_UnMap16To32W(UINT wMsg, DWORD_PTR* lp
...
@@ -273,12 +268,10 @@ static MMSYSTEM_MapType MMSYSTDRV_MidiOut_UnMap16To32W(UINT wMsg, DWORD_PTR* lp
case
MODM_LONGDATA
:
case
MODM_LONGDATA
:
{
{
LPMIDIHDR
mh32
=
(
LPMIDIHDR
)(
*
lpParam1
);
LPMIDIHDR
mh32
=
(
LPMIDIHDR
)(
*
lpParam1
);
LPMIDIHDR
mh16
=
MapSL
(
*
(
SEGPTR
*
)((
LPSTR
)
mh32
-
sizeof
(
LPMIDIHDR
)));
LPMIDIHDR
16
mh16
=
MapSL
(
*
(
SEGPTR
*
)((
LPSTR
)
mh32
-
sizeof
(
LPMIDIHDR
)));
assert
(
mh16
->
lpNext
==
mh32
);
assert
(
(
MIDIHDR
*
)
mh16
->
lpNext
==
mh32
);
mh16
->
dwFlags
=
mh32
->
dwFlags
;
mh16
->
dwFlags
=
mh32
->
dwFlags
;
if
(
mh16
->
reserved
>=
sizeof
(
MIDIHDR
))
mh16
->
dwOffset
=
mh32
->
dwOffset
;
if
(
wMsg
==
MODM_UNPREPARE
&&
fn_ret
==
MMSYSERR_NOERROR
)
{
if
(
wMsg
==
MODM_UNPREPARE
&&
fn_ret
==
MMSYSERR_NOERROR
)
{
HeapFree
(
GetProcessHeap
(),
0
,
(
LPSTR
)
mh32
-
sizeof
(
LPMIDIHDR
));
HeapFree
(
GetProcessHeap
(),
0
,
(
LPSTR
)
mh32
-
sizeof
(
LPMIDIHDR
));
...
@@ -307,24 +300,21 @@ static void MMSYSTDRV_MidiOut_MapCB(UINT uMsg, DWORD_PTR* dwUser, DWORD_PTR* dw
...
@@ -307,24 +300,21 @@ static void MMSYSTDRV_MidiOut_MapCB(UINT uMsg, DWORD_PTR* dwUser, DWORD_PTR* dw
case
MOM_CLOSE
:
case
MOM_CLOSE
:
/* dwParam1 & dwParam2 are supposed to be 0, nothing to do */
/* dwParam1 & dwParam2 are supposed to be 0, nothing to do */
break
;
break
;
case
MOM_POSITIONCB
:
/* MIDIHDR.dwOffset exists since Win 32 only */
FIXME
(
"MOM_POSITIONCB/MEVT_F_CALLBACK wants MIDIHDR.dwOffset in 16 bit code
\n
"
);
/* fall through */
case
MOM_DONE
:
case
MOM_DONE
:
{
{
/* initial map is: 16 => 32 */
/* initial map is: 16 => 32 */
LPMIDIHDR
mh32
=
(
LPMIDIHDR
)(
*
dwParam1
);
LPMIDIHDR
mh32
=
(
LPMIDIHDR
)(
*
dwParam1
);
SEGPTR
segmh16
=
*
(
SEGPTR
*
)((
LPSTR
)
mh32
-
sizeof
(
LPMIDIHDR
));
SEGPTR
segmh16
=
*
(
SEGPTR
*
)((
LPSTR
)
mh32
-
sizeof
(
LPMIDIHDR
));
LPMIDIHDR
mh16
=
MapSL
(
segmh16
);
LPMIDIHDR
16
mh16
=
MapSL
(
segmh16
);
*
dwParam1
=
(
DWORD
)
segmh16
;
*
dwParam1
=
(
DWORD
)
segmh16
;
mh16
->
dwFlags
=
mh32
->
dwFlags
;
mh16
->
dwFlags
=
mh32
->
dwFlags
;
if
(
mh16
->
reserved
>=
sizeof
(
MIDIHDR
))
mh16
->
dwOffset
=
mh32
->
dwOffset
;
}
}
break
;
break
;
case
MOM_POSITIONCB
:
FIXME
(
"NIY
\n
"
);
/* FIXME: would require to recreate a 16bit MIDIHDR here */
*
dwParam1
=
*
dwParam2
=
0
;
break
;
default:
default:
ERR
(
"Unknown msg %u
\n
"
,
uMsg
);
ERR
(
"Unknown msg %u
\n
"
,
uMsg
);
}
}
...
...
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