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
80b079e0
Commit
80b079e0
authored
Oct 22, 2009
by
Eric Pouech
Committed by
Alexandre Julliard
Oct 23, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winmm: Move the 16bit management of midi out driver type to the new 16=>32 thunking scheme.
parent
84efa19e
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
79 additions
and
58 deletions
+79
-58
message16.c
dlls/winmm/message16.c
+46
-15
mmsystem.c
dlls/winmm/mmsystem.c
+27
-29
winemm.h
dlls/winmm/winemm.h
+0
-2
winmm.c
dlls/winmm/winmm.c
+6
-12
No files found.
dlls/winmm/message16.c
View file @
80b079e0
...
...
@@ -314,18 +314,18 @@ static void MMSYSTDRV_MidiIn_MapCB(UINT uMsg, DWORD_PTR* dwUser, DW
* ================================= */
/**************************************************************************
* MMDRV_MidiOut_Map16To32W [internal]
* MM
SYST
DRV_MidiOut_Map16To32W [internal]
*/
static
WINMM_MapType
MMDRV_MidiOut_Map16To32W
(
UINT
wMsg
,
DWORD_PTR
*
lpdwUser
,
DWORD_PTR
*
lpParam1
,
DWORD_PTR
*
lpParam2
)
static
MMSYSTEM_MapType
MMSYSTDRV_MidiOut_Map16To32W
(
UINT
wMsg
,
DWORD_PTR
*
lpParam1
,
DWORD_PTR
*
lpParam2
)
{
WINMM_MapType
ret
=
WINM
M_MAP_MSGERROR
;
MMSYSTEM_MapType
ret
=
MMSYSTE
M_MAP_MSGERROR
;
switch
(
wMsg
)
{
case
MODM_GETNUMDEVS
:
case
MODM_DATA
:
case
MODM_RESET
:
case
MODM_SETVOLUME
:
ret
=
WINM
M_MAP_OK
;
ret
=
MMSYSTE
M_MAP_OK
;
break
;
case
MODM_OPEN
:
...
...
@@ -345,9 +345,9 @@ static WINMM_MapType MMDRV_MidiOut_Map16To32W (UINT wMsg, DWORD_PTR *lpdwUser,
*
lpParam1
=
(
DWORD
)
moc32
;
*
lpParam2
=
sizeof
(
MIDIOUTCAPSW
);
ret
=
WINM
M_MAP_OKMEM
;
ret
=
MMSYSTE
M_MAP_OKMEM
;
}
else
{
ret
=
WINM
M_MAP_NOMEM
;
ret
=
MMSYSTE
M_MAP_NOMEM
;
}
}
break
;
...
...
@@ -373,9 +373,9 @@ static WINMM_MapType MMDRV_MidiOut_Map16To32W (UINT wMsg, DWORD_PTR *lpdwUser,
*
lpParam1
=
(
DWORD
)
mh32
;
*
lpParam2
=
sizeof
(
MIDIHDR
);
ret
=
WINM
M_MAP_OKMEM
;
ret
=
MMSYSTE
M_MAP_OKMEM
;
}
else
{
ret
=
WINM
M_MAP_NOMEM
;
ret
=
MMSYSTE
M_MAP_NOMEM
;
}
}
break
;
...
...
@@ -393,7 +393,7 @@ static WINMM_MapType MMDRV_MidiOut_Map16To32W (UINT wMsg, DWORD_PTR *lpdwUser,
mh32
->
dwBufferLength
,
mh16
->
dwBufferLength
);
}
else
mh32
->
dwBufferLength
=
mh16
->
dwBufferLength
;
ret
=
WINM
M_MAP_OKMEM
;
ret
=
MMSYSTE
M_MAP_OKMEM
;
}
break
;
...
...
@@ -407,18 +407,18 @@ static WINMM_MapType MMDRV_MidiOut_Map16To32W (UINT wMsg, DWORD_PTR *lpdwUser,
}
/**************************************************************************
* MMDRV_MidiOut_UnMap16To32W [internal]
* MM
SYST
DRV_MidiOut_UnMap16To32W [internal]
*/
static
WINMM_MapType
MMDRV_MidiOut_UnMap16To32W
(
UINT
wMsg
,
DWORD_PTR
*
lpdwUser
,
DWORD_PTR
*
lpParam1
,
DWORD_PTR
*
lpParam2
,
MMRESULT
fn_ret
)
static
MMSYSTEM_MapType
MMSYSTDRV_MidiOut_UnMap16To32W
(
UINT
wMsg
,
DWORD_PTR
*
lpParam1
,
DWORD_PTR
*
lpParam2
,
MMRESULT
fn_ret
)
{
WINMM_MapType
ret
=
WINM
M_MAP_MSGERROR
;
MMSYSTEM_MapType
ret
=
MMSYSTE
M_MAP_MSGERROR
;
switch
(
wMsg
)
{
case
MODM_GETNUMDEVS
:
case
MODM_DATA
:
case
MODM_RESET
:
case
MODM_SETVOLUME
:
ret
=
WINM
M_MAP_OK
;
ret
=
MMSYSTE
M_MAP_OK
;
break
;
case
MODM_OPEN
:
...
...
@@ -443,7 +443,7 @@ static WINMM_MapType MMDRV_MidiOut_UnMap16To32W(UINT wMsg, DWORD_PTR *lpdwUser,
moc16
->
wChannelMask
=
moc32
->
wChannelMask
;
moc16
->
dwSupport
=
moc32
->
dwSupport
;
HeapFree
(
GetProcessHeap
(),
0
,
(
LPSTR
)
moc32
-
sizeof
(
LPMIDIOUTCAPS16
));
ret
=
WINM
M_MAP_OK
;
ret
=
MMSYSTE
M_MAP_OK
;
}
break
;
case
MODM_PREPARE
:
...
...
@@ -465,7 +465,7 @@ static WINMM_MapType MMDRV_MidiOut_UnMap16To32W(UINT wMsg, DWORD_PTR *lpdwUser,
HeapFree
(
GetProcessHeap
(),
0
,
(
LPSTR
)
mh32
-
sizeof
(
LPMIDIHDR
));
mh16
->
lpNext
=
0
;
}
ret
=
WINM
M_MAP_OK
;
ret
=
MMSYSTE
M_MAP_OK
;
}
break
;
...
...
@@ -739,6 +739,34 @@ static void CALLBACK MMDRV_MidiOut_Callback(HDRVR hDev, UINT uMsg, DWORD_PTR dw
MMDRV_Callback
(
mld
,
hDev
,
uMsg
,
dwParam1
,
dwParam2
);
}
/******************************************************************
* MMSYSTDRV_MidiOut_MapCB
*/
static
void
MMSYSTDRV_MidiOut_MapCB
(
UINT
uMsg
,
DWORD_PTR
*
dwUser
,
DWORD_PTR
*
dwParam1
,
DWORD_PTR
*
dwParam2
)
{
switch
(
uMsg
)
{
case
MOM_OPEN
:
case
MOM_CLOSE
:
/* dwParam1 & dwParam2 are supposed to be 0, nothing to do */
break
;
case
MOM_DONE
:
{
/* initial map is: 16 => 32 */
LPMIDIHDR
mh32
=
(
LPMIDIHDR
)(
*
dwParam1
);
SEGPTR
segmh16
=
*
(
SEGPTR
*
)((
LPSTR
)
mh32
-
sizeof
(
LPMIDIHDR
));
LPMIDIHDR
mh16
=
MapSL
(
segmh16
);
*
dwParam1
=
(
DWORD
)
segmh16
;
mh16
->
dwFlags
=
mh32
->
dwFlags
;
if
(
mh16
->
reserved
>=
sizeof
(
MIDIHDR
))
mh16
->
dwOffset
=
mh32
->
dwOffset
;
}
break
;
default:
ERR
(
"Unknown msg %u
\n
"
,
uMsg
);
}
}
/* =================================
* W A V E I N M A P P E R S
* ================================= */
...
...
@@ -2580,6 +2608,8 @@ static WINMM_MapType MMDRV_UnMap16To32W(UINT wMsg, DWORD_PTR *lpdwUser, DWORD_P
#define MMDRV_Mixer_UnMap16To32W MMDRV_UnMap16To32W
#define MMDRV_MidiIn_Map16To32W MMDRV_Map16To32W
#define MMDRV_MidiIn_UnMap16To32W MMDRV_UnMap16To32W
#define MMDRV_MidiOut_Map16To32W MMDRV_Map16To32W
#define MMDRV_MidiOut_UnMap16To32W MMDRV_UnMap16To32W
void
MMDRV_Init16
(
void
)
{
...
...
@@ -2637,6 +2667,7 @@ static struct MMSYSTDRV_Type
{
{
MMSYSTDRV_Mixer_Map16To32W
,
MMSYSTDRV_Mixer_UnMap16To32W
,
MMSYSTDRV_Mixer_MapCB
},
{
MMSYSTDRV_MidiIn_Map16To32W
,
MMSYSTDRV_MidiIn_UnMap16To32W
,
MMSYSTDRV_MidiIn_MapCB
},
{
MMSYSTDRV_MidiOut_Map16To32W
,
MMSYSTDRV_MidiOut_UnMap16To32W
,
MMSYSTDRV_MidiOut_MapCB
},
};
/******************************************************************
...
...
dlls/winmm/mmsystem.c
View file @
80b079e0
...
...
@@ -595,12 +595,25 @@ UINT16 WINAPI midiOutGetErrorText16(UINT16 uError, LPSTR lpText, UINT16 uSize)
UINT16
WINAPI
midiOutOpen16
(
HMIDIOUT16
*
lphMidiOut
,
UINT16
uDeviceID
,
DWORD
dwCallback
,
DWORD
dwInstance
,
DWORD
dwFlags
)
{
HMIDIOUT
hmo
;
UINT
ret
;
ret
=
MIDI_OutOpen
(
&
hmo
,
uDeviceID
,
dwCallback
,
dwInstance
,
dwFlags
,
FALSE
);
HMIDIOUT
hmo
;
UINT
ret
;
struct
mmsystdrv_thunk
*
thunk
;
if
(
lphMidiOut
!=
NULL
)
*
lphMidiOut
=
HMIDIOUT_16
(
hmo
);
if
(
!
(
thunk
=
MMSYSTDRV_AddThunk
(
dwCallback
,
MMSYSTDRV_MIDIOUT
)))
{
return
MMSYSERR_NOMEM
;
}
if
((
dwFlags
&
CALLBACK_TYPEMASK
)
==
CALLBACK_FUNCTION
)
{
dwCallback
=
(
DWORD
)
thunk
;
}
ret
=
midiOutOpen
(
&
hmo
,
uDeviceID
,
dwCallback
,
dwInstance
,
dwFlags
);
if
(
ret
==
MMSYSERR_NOERROR
)
{
if
(
lphMidiOut
!=
NULL
)
*
lphMidiOut
=
HMIDIOUT_16
(
hmo
);
MMSYSTDRV_SetHandle
(
thunk
,
(
void
*
)
hmo
);
}
else
MMSYSTDRV_DeleteThunk
(
thunk
);
return
ret
;
}
...
...
@@ -609,7 +622,11 @@ UINT16 WINAPI midiOutOpen16(HMIDIOUT16* lphMidiOut, UINT16 uDeviceID,
*/
UINT16
WINAPI
midiOutClose16
(
HMIDIOUT16
hMidiOut
)
{
return
midiOutClose
(
HMIDIOUT_32
(
hMidiOut
));
UINT
ret
=
midiOutClose
(
HMIDIOUT_32
(
hMidiOut
));
if
(
ret
==
MMSYSERR_NOERROR
)
MMSYSTDRV_CloseHandle
((
void
*
)
HMIDIOUT_32
(
hMidiOut
));
return
ret
;
}
/**************************************************************************
...
...
@@ -619,14 +636,9 @@ UINT16 WINAPI midiOutPrepareHeader16(HMIDIOUT16 hMidiOut, /* [in] */
SEGPTR
lpsegMidiOutHdr
,
/* [???] */
UINT16
uSize
)
/* [in] */
{
LPWINE_MLD
wmld
;
TRACE
(
"(%04X, %08x, %d)
\n
"
,
hMidiOut
,
lpsegMidiOutHdr
,
uSize
);
if
((
wmld
=
MMDRV_Get
(
HMIDIOUT_32
(
hMidiOut
),
MMDRV_MIDIOUT
,
FALSE
))
==
NULL
)
return
MMSYSERR_INVALHANDLE
;
return
MMDRV_Message
(
wmld
,
MODM_PREPARE
,
lpsegMidiOutHdr
,
uSize
,
FALSE
);
return
MMSYSTDRV_Message
(
HMIDIOUT_32
(
hMidiOut
),
MODM_PREPARE
,
lpsegMidiOutHdr
,
uSize
);
}
/**************************************************************************
...
...
@@ -636,7 +648,6 @@ UINT16 WINAPI midiOutUnprepareHeader16(HMIDIOUT16 hMidiOut, /* [in] */
SEGPTR
lpsegMidiOutHdr
,
/* [???] */
UINT16
uSize
)
/* [in] */
{
LPWINE_MLD
wmld
;
LPMIDIHDR16
lpMidiOutHdr
=
MapSL
(
lpsegMidiOutHdr
);
TRACE
(
"(%04X, %08x, %d)
\n
"
,
hMidiOut
,
lpsegMidiOutHdr
,
uSize
);
...
...
@@ -645,10 +656,7 @@ UINT16 WINAPI midiOutUnprepareHeader16(HMIDIOUT16 hMidiOut, /* [in] */
return
MMSYSERR_NOERROR
;
}
if
((
wmld
=
MMDRV_Get
(
HMIDIOUT_32
(
hMidiOut
),
MMDRV_MIDIOUT
,
FALSE
))
==
NULL
)
return
MMSYSERR_INVALHANDLE
;
return
MMDRV_Message
(
wmld
,
MODM_UNPREPARE
,
lpsegMidiOutHdr
,
uSize
,
FALSE
);
return
MMSYSTDRV_Message
(
HMIDIOUT_32
(
hMidiOut
),
MODM_UNPREPARE
,
lpsegMidiOutHdr
,
uSize
);
}
/**************************************************************************
...
...
@@ -666,14 +674,9 @@ UINT16 WINAPI midiOutLongMsg16(HMIDIOUT16 hMidiOut, /* [in] */
LPMIDIHDR16
lpsegMidiOutHdr
,
/* [???] NOTE: SEGPTR */
UINT16
uSize
)
/* [in] */
{
LPWINE_MLD
wmld
;
TRACE
(
"(%04X, %p, %d)
\n
"
,
hMidiOut
,
lpsegMidiOutHdr
,
uSize
);
if
((
wmld
=
MMDRV_Get
(
HMIDIOUT_32
(
hMidiOut
),
MMDRV_MIDIOUT
,
FALSE
))
==
NULL
)
return
MMSYSERR_INVALHANDLE
;
return
MMDRV_Message
(
wmld
,
MODM_LONGDATA
,
(
DWORD_PTR
)
lpsegMidiOutHdr
,
uSize
,
FALSE
);
return
MMSYSTDRV_Message
(
HMIDIOUT_32
(
hMidiOut
),
MODM_LONGDATA
,
(
DWORD_PTR
)
lpsegMidiOutHdr
,
uSize
);
}
/**************************************************************************
...
...
@@ -739,13 +742,8 @@ UINT16 WINAPI midiOutGetID16(HMIDIOUT16 hMidiOut, UINT16* lpuDeviceID)
DWORD
WINAPI
midiOutMessage16
(
HMIDIOUT16
hMidiOut
,
UINT16
uMessage
,
DWORD
dwParam1
,
DWORD
dwParam2
)
{
LPWINE_MLD
wmld
;
TRACE
(
"(%04X, %04X, %08X, %08X)
\n
"
,
hMidiOut
,
uMessage
,
dwParam1
,
dwParam2
);
if
((
wmld
=
MMDRV_Get
(
HMIDIOUT_32
(
hMidiOut
),
MMDRV_MIDIOUT
,
FALSE
))
==
NULL
)
return
MMSYSERR_INVALHANDLE
;
switch
(
uMessage
)
{
case
MODM_OPEN
:
case
MODM_CLOSE
:
...
...
@@ -762,7 +760,7 @@ DWORD WINAPI midiOutMessage16(HMIDIOUT16 hMidiOut, UINT16 uMessage,
case
MODM_UNPREPARE
:
return
midiOutUnprepareHeader16
(
hMidiOut
,
dwParam1
,
dwParam2
);
}
return
MM
DRV_Message
(
wmld
,
uMessage
,
dwParam1
,
dwParam2
,
TRUE
);
return
MM
SYSTDRV_Message
(
HMIDIOUT_32
(
hMidiOut
),
uMessage
,
dwParam1
,
dwParam2
);
}
/**************************************************************************
...
...
dlls/winmm/winemm.h
View file @
80b079e0
...
...
@@ -203,8 +203,6 @@ LPSTR MCI_strdupWtoA(LPCWSTR str);
BOOL
WINMM_CheckForMMSystem
(
void
);
const
char
*
WINMM_ErrorToString
(
MMRESULT
error
);
UINT
MIDI_OutOpen
(
HMIDIOUT
*
lphMidiOut
,
UINT
uDeviceID
,
DWORD_PTR
dwCallback
,
DWORD_PTR
dwInstance
,
DWORD
dwFlags
,
BOOL
bFrom32
);
MMRESULT
MIDI_StreamOpen
(
HMIDISTRM
*
lphMidiStrm
,
LPUINT
lpuDeviceID
,
DWORD
cMidi
,
DWORD_PTR
dwCallback
,
DWORD_PTR
dwInstance
,
DWORD
fdwOpen
,
BOOL
bFrom32
);
...
...
dlls/winmm/winmm.c
View file @
80b079e0
...
...
@@ -931,8 +931,11 @@ static LPWINE_MIDI MIDI_OutAlloc(HMIDIOUT* lphMidiOut, DWORD_PTR* lpdwCallback,
return
lpwm
;
}
UINT
MIDI_OutOpen
(
LPHMIDIOUT
lphMidiOut
,
UINT
uDeviceID
,
DWORD_PTR
dwCallback
,
DWORD_PTR
dwInstance
,
DWORD
dwFlags
,
BOOL
bFrom32
)
/**************************************************************************
* midiOutOpen [WINMM.@]
*/
UINT
WINAPI
midiOutOpen
(
LPHMIDIOUT
lphMidiOut
,
UINT
uDeviceID
,
DWORD_PTR
dwCallback
,
DWORD_PTR
dwInstance
,
DWORD
dwFlags
)
{
HMIDIOUT
hMidiOut
;
LPWINE_MIDI
lpwm
;
...
...
@@ -944,7 +947,7 @@ UINT MIDI_OutOpen(LPHMIDIOUT lphMidiOut, UINT uDeviceID, DWORD_PTR dwCallback,
if
(
lphMidiOut
!=
NULL
)
*
lphMidiOut
=
0
;
lpwm
=
MIDI_OutAlloc
(
&
hMidiOut
,
&
dwCallback
,
&
dwInstance
,
&
dwFlags
,
0
,
NULL
,
bFrom32
);
0
,
NULL
,
TRUE
);
if
(
lpwm
==
NULL
)
return
MMSYSERR_NOMEM
;
...
...
@@ -965,15 +968,6 @@ UINT MIDI_OutOpen(LPHMIDIOUT lphMidiOut, UINT uDeviceID, DWORD_PTR dwCallback,
}
/**************************************************************************
* midiOutOpen [WINMM.@]
*/
UINT
WINAPI
midiOutOpen
(
LPHMIDIOUT
lphMidiOut
,
UINT
uDeviceID
,
DWORD_PTR
dwCallback
,
DWORD_PTR
dwInstance
,
DWORD
dwFlags
)
{
return
MIDI_OutOpen
(
lphMidiOut
,
uDeviceID
,
dwCallback
,
dwInstance
,
dwFlags
,
TRUE
);
}
/**************************************************************************
* midiOutClose [WINMM.@]
*/
UINT
WINAPI
midiOutClose
(
HMIDIOUT
hMidiOut
)
...
...
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