ChangeLog: - internal renaming (no longer using MMSYSTEM prefixes for WINMM only functions) - moved time 16/32 conversions functions to 16 bit source files - final Makefile changes (16 bit part can now really be not compiled when -disable-win16 is requested) A+
--- winmm_13/joystick.c Sat Oct 26 15:06:40 2002 +++ winmm_14/joystick.c Tue Oct 29 15:20:36 2002 @@ -40,7 +40,6 @@ #include "wingdi.h" #include "winuser.h" -#include "wine/mmsystem16.h" #include "winemm.h" #include "wine/debug.h" --- winmm_13/mmsystem.c Tue Oct 29 14:20:42 2002 +++ winmm_14/mmsystem.c Tue Oct 29 15:13:32 2002 @@ -230,8 +230,7 @@ HMIXER hmix; UINT ret; - ret = MMSYSTEM_mixerOpen(&hmix, uDeviceID, - dwCallback, dwInstance, fdwOpen, FALSE); + ret = MIXER_Open(&hmix, uDeviceID, dwCallback, dwInstance, fdwOpen, FALSE); if (lphmix) *lphmix = HMIXER_16(hmix); return ret; } @@ -715,8 +714,7 @@ HMIDIOUT hmo; UINT ret; - ret = MMSYSTEM_midiOutOpen(&hmo, uDeviceID, dwCallback, dwInstance, - dwFlags, FALSE); + ret = MIDI_OutOpen(&hmo, uDeviceID, dwCallback, dwInstance, dwFlags, FALSE); if (lphMidiOut != NULL) *lphMidiOut = HMIDIOUT_16(hmo); return ret; @@ -931,8 +929,7 @@ HMIDIIN xhmid; UINT ret; - ret = MMSYSTEM_midiInOpen(&xhmid, uDeviceID, dwCallback, dwInstance, - dwFlags, FALSE); + ret = MIDI_InOpen(&xhmid, uDeviceID, dwCallback, dwInstance, dwFlags, FALSE); if (lphMidiIn) *lphMidiIn = HMIDIIN_16(xhmid); return ret; @@ -1099,8 +1096,8 @@ if (!phMidiStrm || !devid) return MMSYSERR_INVALPARAM; devid32 = *devid; - ret = MMSYSTEM_MidiStream_Open(&hMidiStrm32, &devid32, cMidi, dwCallback, - dwInstance, fdwOpen, FALSE); + ret = MIDI_StreamOpen(&hMidiStrm32, &devid32, cMidi, dwCallback, + dwInstance, fdwOpen, FALSE); *phMidiStrm = HMIDISTRM_16(hMidiStrm32); *devid = devid32; return ret; @@ -1225,8 +1222,8 @@ * however, we need to promote correctly the wave mapper id * (0xFFFFFFFF and not 0x0000FFFF) */ - ret = MMSYSTEM_waveOpen(&hWaveOut, (uDeviceID == (UINT16)-1) ? (UINT)-1 : uDeviceID, - MMDRV_WAVEOUT, lpFormat, dwCallback, dwInstance, dwFlags, FALSE); + ret = WAVE_Open(&hWaveOut, (uDeviceID == (UINT16)-1) ? (UINT)-1 : uDeviceID, + MMDRV_WAVEOUT, lpFormat, dwCallback, dwInstance, dwFlags, FALSE); if (lphWaveOut != NULL) *lphWaveOut = HWAVEOUT_16(hWaveOut); return ret; @@ -1519,8 +1516,8 @@ * however, we need to promote correctly the wave mapper id * (0xFFFFFFFF and not 0x0000FFFF) */ - ret = MMSYSTEM_waveOpen(&hWaveIn, (uDeviceID == (UINT16)-1) ? (UINT)-1 : uDeviceID, - MMDRV_WAVEIN, lpFormat, dwCallback, dwInstance, dwFlags, FALSE); + ret = WAVE_Open(&hWaveIn, (uDeviceID == (UINT16)-1) ? (UINT)-1 : uDeviceID, + MMDRV_WAVEIN, lpFormat, dwCallback, dwInstance, dwFlags, FALSE); if (lphWaveIn != NULL) *lphWaveIn = HWAVEIN_16(hWaveIn); return ret; @@ -2433,6 +2430,34 @@ * # TIME # * ################################################### */ + +/****************************************************************** + * MMSYSTEM_MMTIME32to16 + * + * + */ +void MMSYSTEM_MMTIME32to16(LPMMTIME16 mmt16, const MMTIME* mmt32) +{ + mmt16->wType = mmt32->wType; + /* layout of rest is the same for 32/16, + * Note: mmt16->u is 2 bytes smaller than mmt32->u, which has padding + */ + memcpy(&(mmt16->u), &(mmt32->u), sizeof(mmt16->u)); +} + +/****************************************************************** + * MMSYSTEM_MMTIME16to32 + * + * + */ +void MMSYSTEM_MMTIME16to32(LPMMTIME mmt32, const MMTIME16* mmt16) +{ + mmt32->wType = mmt16->wType; + /* layout of rest is the same for 32/16, + * Note: mmt16->u is 2 bytes smaller than mmt32->u, which has padding + */ + memcpy(&(mmt32->u), &(mmt16->u), sizeof(mmt16->u)); +} /************************************************************************** * timeGetSystemTime [MMSYSTEM.601] --- winmm_13/winemm.h Tue Oct 29 16:09:45 2002 +++ winmm_14/winemm.h Tue Oct 29 16:09:48 2002 @@ -259,21 +259,18 @@ BOOL WINMM_CheckForMMSystem(void); -void MMSYSTEM_MMTIME16to32(LPMMTIME mmt32, const MMTIME16* mmt16); -void MMSYSTEM_MMTIME32to16(LPMMTIME16 mmt16, const MMTIME* mmt32); - -UINT MMSYSTEM_mixerOpen(LPHMIXER lphMix, UINT uDeviceID, DWORD dwCallback, - DWORD dwInstance, DWORD fdwOpen, BOOL bFrom32); -UINT MMSYSTEM_midiOutOpen(HMIDIOUT* lphMidiOut, UINT uDeviceID, DWORD dwCallback, - DWORD dwInstance, DWORD dwFlags, BOOL bFrom32); -UINT MMSYSTEM_midiInOpen(HMIDIIN* lphMidiIn, UINT uDeviceID, DWORD dwCallback, - DWORD dwInstance, DWORD dwFlags, BOOL bFrom32); -MMRESULT MMSYSTEM_MidiStream_Open(HMIDISTRM* lphMidiStrm, LPUINT lpuDeviceID, - DWORD cMidi, DWORD dwCallback, - DWORD dwInstance, DWORD fdwOpen, BOOL bFrom32); -UINT MMSYSTEM_waveOpen(HANDLE* lphndl, UINT uDeviceID, UINT uType, - const LPWAVEFORMATEX lpFormat, DWORD dwCallback, - DWORD dwInstance, DWORD dwFlags, BOOL bFrom32); +UINT MIXER_Open(LPHMIXER lphMix, UINT uDeviceID, DWORD dwCallback, + DWORD dwInstance, DWORD fdwOpen, BOOL bFrom32); +UINT MIDI_OutOpen(HMIDIOUT* lphMidiOut, UINT uDeviceID, DWORD dwCallback, + DWORD dwInstance, DWORD dwFlags, BOOL bFrom32); +UINT MIDI_InOpen(HMIDIIN* lphMidiIn, UINT uDeviceID, DWORD dwCallback, + DWORD dwInstance, DWORD dwFlags, BOOL bFrom32); +MMRESULT MIDI_StreamOpen(HMIDISTRM* lphMidiStrm, LPUINT lpuDeviceID, + DWORD cMidi, DWORD dwCallback, + DWORD dwInstance, DWORD fdwOpen, BOOL bFrom32); +UINT WAVE_Open(HANDLE* lphndl, UINT uDeviceID, UINT uType, + const LPWAVEFORMATEX lpFormat, DWORD dwCallback, + DWORD dwInstance, DWORD dwFlags, BOOL bFrom32); HMMIO MMIO_Open(LPSTR szFileName, MMIOINFO* refmminfo, DWORD dwOpenFlags, enum mmioProcType type); @@ -283,8 +280,6 @@ LPARAM lParam2, enum mmioProcType type); LPWINE_MMIO MMIO_Get(HMMIO h); -BOOL MULTIMEDIA_PlaySound(const void* pszSound, HMODULE hmod, DWORD fdwSound, BOOL bUnicode); - WORD TIME_SetEventInternal(UINT wDelay, UINT wResol, FARPROC16 lpFunc, DWORD dwUser, UINT wFlags); void TIME_MMTimeStart(void); @@ -308,8 +303,10 @@ extern unsigned (*pFnLoadMMDrvFunc16)(LPCSTR,LPWINE_DRIVER, LPWINE_MM_DRIVER); extern LRESULT (*pFnMmioCallback16)(SEGPTR,LPMMIOINFO,UINT,LPARAM,LPARAM); -/* mmsystem only functions */ +/* mmsystem (16 bit files) only functions */ void MMDRV_Init16(void); +void MMSYSTEM_MMTIME16to32(LPMMTIME mmt32, const MMTIME16* mmt16); +void MMSYSTEM_MMTIME32to16(LPMMTIME16 mmt16, const MMTIME* mmt32); /* HANDLE16 -> HANDLE conversions */ #define HDRVR_32(h16) ((HDRVR)(ULONG_PTR)(h16)) --- winmm_13/winmm.c Tue Oct 29 14:25:26 2002 +++ winmm_14/winmm.c Tue Oct 29 15:13:44 2002 @@ -1,7 +1,7 @@ /* -*- tab-width: 8; c-basic-offset: 4 -*- */ /* - * MMSYTEM functions + * WINMM functions * * Copyright 1993 Martin Ayotte * 1998-2002 Eric Pouech @@ -32,10 +32,7 @@ #include "mmsystem.h" #include "winbase.h" -#include "wingdi.h" - -#include "winuser.h" -#include "wine/winuser16.h" /* FIXME: should be removed */ +#include "wine/winuser16.h" /* FIXME: should be removed, only used for UserYield16 */ #include "heap.h" #include "winternl.h" #include "winemm.h" @@ -45,30 +42,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(winmm); /* ======================================================================== - * T I M E C O N V E R S I O N F U N C T I O N S - * ========================================================================*/ - -/* FIXME: should be in mmsystem.c */ - -void MMSYSTEM_MMTIME32to16(LPMMTIME16 mmt16, const MMTIME* mmt32) -{ - mmt16->wType = mmt32->wType; - /* layout of rest is the same for 32/16, - * Note: mmt16->u is 2 bytes smaller than mmt32->u, which has padding - */ - memcpy(&(mmt16->u), &(mmt32->u), sizeof(mmt16->u)); -} - -void MMSYSTEM_MMTIME16to32(LPMMTIME mmt32, const MMTIME16* mmt16) -{ - mmt32->wType = mmt16->wType; - /* layout of rest is the same for 32/16, - * Note: mmt16->u is 2 bytes smaller than mmt32->u, which has padding - */ - memcpy(&(mmt32->u), &(mmt16->u), sizeof(mmt16->u)); -} - -/* ======================================================================== * G L O B A L S E T T I N G S * ========================================================================*/ @@ -256,8 +229,8 @@ return ret; } -UINT MMSYSTEM_mixerOpen(LPHMIXER lphMix, UINT uDeviceID, DWORD dwCallback, - DWORD dwInstance, DWORD fdwOpen, BOOL bFrom32) +UINT MIXER_Open(LPHMIXER lphMix, UINT uDeviceID, DWORD dwCallback, + DWORD dwInstance, DWORD fdwOpen, BOOL bFrom32) { HMIXER hMix; LPWINE_MLD wmld; @@ -293,8 +266,7 @@ UINT WINAPI mixerOpen(LPHMIXER lphMix, UINT uDeviceID, DWORD dwCallback, DWORD dwInstance, DWORD fdwOpen) { - return MMSYSTEM_mixerOpen(lphMix, uDeviceID, - dwCallback, dwInstance, fdwOpen, TRUE); + return MIXER_Open(lphMix, uDeviceID, dwCallback, dwInstance, fdwOpen, TRUE); } /************************************************************************** @@ -1058,8 +1030,8 @@ return lpwm; } -UINT MMSYSTEM_midiOutOpen(HMIDIOUT* lphMidiOut, UINT uDeviceID, DWORD dwCallback, - DWORD dwInstance, DWORD dwFlags, BOOL bFrom32) +UINT MIDI_OutOpen(HMIDIOUT* lphMidiOut, UINT uDeviceID, DWORD dwCallback, + DWORD dwInstance, DWORD dwFlags, BOOL bFrom32) { HMIDIOUT hMidiOut; LPWINE_MIDI lpwm; @@ -1078,8 +1050,7 @@ lpwm->mld.uDeviceID = uDeviceID; - dwRet = MMDRV_Open((LPWINE_MLD)lpwm, MODM_OPEN, (DWORD)&lpwm->mod, - dwFlags); + dwRet = MMDRV_Open((LPWINE_MLD)lpwm, MODM_OPEN, (DWORD)&lpwm->mod, dwFlags); if (dwRet != MMSYSERR_NOERROR) { MMDRV_Free(hMidiOut, (LPWINE_MLD)lpwm); @@ -1098,8 +1069,7 @@ UINT WINAPI midiOutOpen(HMIDIOUT* lphMidiOut, UINT uDeviceID, DWORD dwCallback, DWORD dwInstance, DWORD dwFlags) { - return MMSYSTEM_midiOutOpen(lphMidiOut, uDeviceID, dwCallback, - dwInstance, dwFlags, TRUE); + return MIDI_OutOpen(lphMidiOut, uDeviceID, dwCallback, dwInstance, dwFlags, TRUE); } /************************************************************************** @@ -1365,8 +1335,8 @@ return MIDI_GetErrorText(uError, lpText, uSize); } -UINT MMSYSTEM_midiInOpen(HMIDIIN* lphMidiIn, UINT uDeviceID, DWORD dwCallback, - DWORD dwInstance, DWORD dwFlags, BOOL bFrom32) +UINT MIDI_InOpen(HMIDIIN* lphMidiIn, UINT uDeviceID, DWORD dwCallback, + DWORD dwInstance, DWORD dwFlags, BOOL bFrom32) { HMIDIIN hMidiIn; LPWINE_MIDI lpwm; @@ -1406,8 +1376,7 @@ UINT WINAPI midiInOpen(HMIDIIN* lphMidiIn, UINT uDeviceID, DWORD dwCallback, DWORD dwInstance, DWORD dwFlags) { - return MMSYSTEM_midiInOpen(lphMidiIn, uDeviceID, dwCallback, - dwInstance, dwFlags, TRUE); + return MIDI_InOpen(lphMidiIn, uDeviceID, dwCallback, dwInstance, dwFlags, TRUE); } /************************************************************************** @@ -1907,9 +1876,9 @@ /************************************************************************** * MMSYSTEM_MidiStream_Open [internal] */ -MMRESULT MMSYSTEM_MidiStream_Open(HMIDISTRM* lphMidiStrm, LPUINT lpuDeviceID, - DWORD cMidi, DWORD dwCallback, - DWORD dwInstance, DWORD fdwOpen, BOOL bFrom32) +MMRESULT MIDI_StreamOpen(HMIDISTRM* lphMidiStrm, LPUINT lpuDeviceID, DWORD cMidi, + DWORD dwCallback, DWORD dwInstance, DWORD fdwOpen, + BOOL bFrom32) { WINE_MIDIStream* lpMidiStrm; MMRESULT ret; @@ -1980,8 +1949,8 @@ DWORD cMidi, DWORD dwCallback, DWORD dwInstance, DWORD fdwOpen) { - return MMSYSTEM_MidiStream_Open(lphMidiStrm, lpuDeviceID, cMidi, dwCallback, - dwInstance, fdwOpen, TRUE); + return MIDI_StreamOpen(lphMidiStrm, lpuDeviceID, cMidi, dwCallback, + dwInstance, fdwOpen, TRUE); } /************************************************************************** @@ -2161,9 +2130,9 @@ return ret; } -UINT MMSYSTEM_waveOpen(HANDLE* lphndl, UINT uDeviceID, UINT uType, - const LPWAVEFORMATEX lpFormat, DWORD dwCallback, - DWORD dwInstance, DWORD dwFlags, BOOL bFrom32) +UINT WAVE_Open(HANDLE* lphndl, UINT uDeviceID, UINT uType, + const LPWAVEFORMATEX lpFormat, DWORD dwCallback, + DWORD dwInstance, DWORD dwFlags, BOOL bFrom32) { HANDLE handle; LPWINE_MLD wmld; @@ -2194,6 +2163,8 @@ wod.dwInstance = dwInstance; wod.dnDevNode = 0L; + TRACE("cb=%08lx\n", wod.dwCallback); + for (;;) { if (dwFlags & WAVE_MAPPED) { wod.uMappedDeviceID = uDeviceID; @@ -2334,8 +2305,8 @@ const LPWAVEFORMATEX lpFormat, DWORD dwCallback, DWORD dwInstance, DWORD dwFlags) { - return MMSYSTEM_waveOpen(lphWaveOut, uDeviceID, MMDRV_WAVEOUT, lpFormat, - dwCallback, dwInstance, dwFlags, TRUE); + return WAVE_Open(lphWaveOut, uDeviceID, MMDRV_WAVEOUT, lpFormat, + dwCallback, dwInstance, dwFlags, TRUE); } /************************************************************************** @@ -2683,8 +2654,8 @@ const LPWAVEFORMATEX lpFormat, DWORD dwCallback, DWORD dwInstance, DWORD dwFlags) { - return MMSYSTEM_waveOpen(lphWaveIn, uDeviceID, MMDRV_WAVEIN, lpFormat, - dwCallback, dwInstance, dwFlags, TRUE); + return WAVE_Open(lphWaveIn, uDeviceID, MMDRV_WAVEIN, lpFormat, + dwCallback, dwInstance, dwFlags, TRUE); } /************************************************************************** @@ -2860,3 +2831,4 @@ return MMDRV_Message(wmld, uMessage, dwParam1, dwParam2, TRUE); } + --- winmm_13/Makefile.in Tue Oct 29 09:54:08 2002 +++ winmm_14/Makefile.in Tue Oct 29 15:17:11 2002 @@ -15,19 +15,19 @@ joystick.c \ lolvldrv.c \ mci.c \ - message16.c \ mmio.c \ playsound.c \ time.c \ winmm.c C_SRCS16 = \ + message16.c \ mmsystem.c \ sound16.c RC_SRCS = winmm_res.rc -EXTRA_OBJS = $(MODULE).glue.o +EXTRA_OBJS16 = $(MODULE).glue.o @MAKE_DLL_RULES@