winmm: Move the 16bit management of mixer driver type to the new 16=>32 thunking scheme.

This commit is contained in:
Eric Pouech 2009-10-22 22:09:52 +02:00 committed by Alexandre Julliard
parent beeac41595
commit 8aa64672de
4 changed files with 57 additions and 25 deletions

View File

@ -123,17 +123,17 @@ static void CALLBACK MMDRV_Aux_Callback(HDRVR hDev, UINT uMsg, DWORD_PTR dwInst
* ================================= */
/**************************************************************************
* xMMDRV_Mixer_Map16To32W [internal]
* MMSYSTDRV_Mixer_Map16To32W [internal]
*/
static WINMM_MapType MMDRV_Mixer_Map16To32W (UINT wMsg, DWORD_PTR *lpdwUser, DWORD_PTR* lpParam1, DWORD_PTR* lpParam2)
static MMSYSTEM_MapType MMSYSTDRV_Mixer_Map16To32W (UINT wMsg, DWORD_PTR* lpParam1, DWORD_PTR* lpParam2)
{
return WINMM_MAP_MSGERROR;
return MMSYSTEM_MAP_MSGERROR;
}
/**************************************************************************
* MMDRV_Mixer_UnMap16To32W [internal]
* MMSYSTDRV_Mixer_UnMap16To32W [internal]
*/
static WINMM_MapType MMDRV_Mixer_UnMap16To32W(UINT wMsg, DWORD_PTR *lpdwUser, DWORD_PTR* lpParam1, DWORD_PTR* lpParam2, MMRESULT fn_ret)
static MMSYSTEM_MapType MMSYSTDRV_Mixer_UnMap16To32W(UINT wMsg, DWORD_PTR* lpParam1, DWORD_PTR* lpParam2, MMRESULT fn_ret)
{
#if 0
MIXERCAPSA micA;
@ -149,7 +149,7 @@ static WINMM_MapType MMDRV_Mixer_UnMap16To32W(UINT wMsg, DWORD_PTR *lpdwUser, D
}
return ret;
#endif
return WINMM_MAP_MSGERROR;
return MMSYSTEM_MAP_MSGERROR;
}
/**************************************************************************
@ -179,6 +179,14 @@ static void CALLBACK MMDRV_Mixer_Callback(HDRVR hDev, UINT uMsg, DWORD_PTR dwIn
MMDRV_Callback(mld, hDev, uMsg, dwParam1, dwParam2);
}
/**************************************************************************
* MMSYSTDRV_Mixer_MapCB
*/
static void MMSYSTDRV_Mixer_MapCB(DWORD uMsg, DWORD_PTR* dwUser, DWORD_PTR* dwParam1, DWORD_PTR* dwParam2)
{
FIXME("NIY\n");
}
/* =================================
* M I D I I N M A P P E R S
* ================================= */
@ -2525,6 +2533,18 @@ static WINMM_MapType MCI_UnMapMsg32WTo16(WORD uDevType, WORD wMsg, DWORD dwFlag
return MCI_MsgMapper32WTo16_Destroy((void*)lParam, size, map, kept);
}
/* temporary hack */
static WINMM_MapType MMDRV_Map16To32W (UINT wMsg, DWORD_PTR *lpdwUser, DWORD_PTR* lpParam1, DWORD_PTR* lpParam2)
{
return WINMM_MAP_MSGERROR;
}
static WINMM_MapType MMDRV_UnMap16To32W(UINT wMsg, DWORD_PTR *lpdwUser, DWORD_PTR* lpParam1, DWORD_PTR* lpParam2, MMRESULT fn_ret)
{
return WINMM_MAP_MSGERROR;
}
#define MMDRV_Mixer_Map16To32W MMDRV_Map16To32W
#define MMDRV_Mixer_UnMap16To32W MMDRV_UnMap16To32W
void MMDRV_Init16(void)
{
#define A(_x,_y) MMDRV_InstallMap(_x, \
@ -2579,6 +2599,7 @@ static struct MMSYSTDRV_Type
MMSYSTDRV_MAPCB mapcb;
} MMSYSTEM_DriversType[MMSYSTDRV_MAX] =
{
{MMSYSTDRV_Mixer_Map16To32W, MMSYSTDRV_Mixer_UnMap16To32W, MMSYSTDRV_Mixer_MapCB},
};
/******************************************************************

View File

@ -248,11 +248,26 @@ UINT16 WINAPI mixerGetDevCaps16(UINT16 uDeviceID, LPMIXERCAPS16 lpCaps,
UINT16 WINAPI mixerOpen16(LPHMIXER16 lphmix, UINT16 uDeviceID, DWORD dwCallback,
DWORD dwInstance, DWORD fdwOpen)
{
HMIXER hmix;
UINT ret;
HMIXER hmix;
UINT ret;
struct mmsystdrv_thunk* thunk;
ret = MIXER_Open(&hmix, uDeviceID, dwCallback, dwInstance, fdwOpen, FALSE);
if (lphmix) *lphmix = HMIXER_16(hmix);
if (!(thunk = MMSYSTDRV_AddThunk(dwCallback, MMSYSTDRV_MIXER)))
{
return MMSYSERR_NOMEM;
}
if ((fdwOpen & CALLBACK_TYPEMASK) == CALLBACK_FUNCTION)
{
dwCallback = (DWORD)thunk;
}
ret = mixerOpen(&hmix, uDeviceID, dwCallback, dwInstance, fdwOpen);
if (ret == MMSYSERR_NOERROR)
{
if (lphmix) *lphmix = HMIXER_16(hmix);
if (thunk) MMSYSTDRV_SetHandle(thunk, hmix);
}
else MMSYSTDRV_DeleteThunk(thunk);
return ret;
}
@ -261,7 +276,11 @@ UINT16 WINAPI mixerOpen16(LPHMIXER16 lphmix, UINT16 uDeviceID, DWORD dwCallback,
*/
UINT16 WINAPI mixerClose16(HMIXER16 hMix)
{
return mixerClose(HMIXER_32(hMix));
UINT ret = mixerClose(HMIXER_32(hMix));
if (ret == MMSYSERR_NOERROR)
MMSYSTDRV_CloseHandle((void*)HMIXER_32(hMix));
return ret;
}
/**************************************************************************

View File

@ -203,8 +203,6 @@ LPSTR MCI_strdupWtoA(LPCWSTR str);
BOOL WINMM_CheckForMMSystem(void);
const char* WINMM_ErrorToString(MMRESULT error);
UINT MIXER_Open(LPHMIXER lphMix, UINT uDeviceID, DWORD_PTR dwCallback,
DWORD_PTR dwInstance, DWORD fdwOpen, BOOL bFrom32);
UINT MIDI_OutOpen(HMIDIOUT* lphMidiOut, UINT uDeviceID, DWORD_PTR dwCallback,
DWORD_PTR dwInstance, DWORD dwFlags, BOOL bFrom32);
UINT MIDI_InOpen(HMIDIIN* lphMidiIn, UINT uDeviceID, DWORD_PTR dwCallback,

View File

@ -325,8 +325,11 @@ static void CALLBACK MIXER_WCallback(HMIXEROBJ hmx, UINT uMsg, DWORD_PTR dwInsta
PostMessageW(hWnd, uMsg, (WPARAM)hmx, (LPARAM)dwParam);
}
UINT MIXER_Open(LPHMIXER lphMix, UINT uDeviceID, DWORD_PTR dwCallback,
DWORD_PTR dwInstance, DWORD fdwOpen, BOOL bFrom32)
/**************************************************************************
* mixerOpen [WINMM.@]
*/
UINT WINAPI mixerOpen(LPHMIXER lphMix, UINT uDeviceID, DWORD_PTR dwCallback,
DWORD_PTR dwInstance, DWORD fdwOpen)
{
HANDLE hMix;
LPWINE_MLD wmld;
@ -361,7 +364,7 @@ UINT MIXER_Open(LPHMIXER lphMix, UINT uDeviceID, DWORD_PTR dwCallback,
}
wmld = MMDRV_Alloc(sizeof(WINE_MIXER), MMDRV_MIXER, &hMix, &fdwOpen,
&dwCallback, &dwInstance, bFrom32);
&dwCallback, &dwInstance, TRUE);
wmld->uDeviceID = uDeviceID;
mod.hmx = hMix;
@ -377,15 +380,6 @@ UINT MIXER_Open(LPHMIXER lphMix, UINT uDeviceID, DWORD_PTR dwCallback,
return dwRet;
}
/**************************************************************************
* mixerOpen [WINMM.@]
*/
UINT WINAPI mixerOpen(LPHMIXER lphMix, UINT uDeviceID, DWORD_PTR dwCallback,
DWORD_PTR dwInstance, DWORD fdwOpen)
{
return MIXER_Open(lphMix, uDeviceID, dwCallback, dwInstance, fdwOpen, TRUE);
}
/**************************************************************************
* mixerClose [WINMM.@]
*/