*sigh* On Fri, Aug 02, 2002 at 01:18:49AM +0200, Michael Stefaniuc wrote: > this is the next patch in the series "Close bug #90". > During the makings of this patch I observed that i missed some > HMIDI{IN,OUT}16 conversions to HANDLE's (due to HANDLE still being an > UINT) and i included them in this patch. Oh, and I also found a nasty > small bug. > > License: LGPL, X11 > Changelog: > Michael Stefaniuc <mstefani@redhat.com> > - Converted HWAVE, HWAVEIN, HWAVEOUT to void* > - fixed some HMIDI{IN,OUT}16 to HANDLE conversions > - midiOutCacheDrumPatches16 called itself recursively in an infinite > loop > > bye > michael -- Michael Stefaniuc Tel.: +49-711-96437-199 System Administration Fax.: +49-711-96437-111 Red Hat GmbH Email: mstefani@redhat.com Hauptstaetterstr. 58 http://www.redhat.de/ D-70178 Stuttgart
Index: dlls/dsound/dsound_main.c =================================================================== RCS file: /home/wine/wine/dlls/dsound/dsound_main.c,v retrieving revision 1.61 diff -u -r1.61 dsound_main.c --- dlls/dsound/dsound_main.c 5 Jul 2002 01:28:10 -0000 1.61 +++ dlls/dsound/dsound_main.c 1 Aug 2002 22:59:40 -0000 @@ -603,7 +603,7 @@ /* Get output device caps */ waveOutGetDevCapsA(wod, &wcaps, sizeof(wcaps)); /* DRV_QUERYDSOUNDIFACE is a "Wine extension" to get the DSound interface */ - waveOutMessage(wod, DRV_QUERYDSOUNDIFACE, (DWORD)&drv, 0); + waveOutMessage((HWAVEOUT)wod, DRV_QUERYDSOUNDIFACE, (DWORD)&drv, 0); /* Allocate memory */ *ippDS = (IDirectSoundImpl*)HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(IDirectSoundImpl)); Index: dlls/winmm/lolvldrv.c =================================================================== RCS file: /home/wine/wine/dlls/winmm/lolvldrv.c,v retrieving revision 1.30 diff -u -r1.30 lolvldrv.c --- dlls/winmm/lolvldrv.c 1 Aug 2002 18:17:51 -0000 1.30 +++ dlls/winmm/lolvldrv.c 1 Aug 2002 22:59:41 -0000 @@ -1070,7 +1070,7 @@ *(LPDWORD)((char*)ptr + sizeof(LPWAVEOPENDESC)) = *lpdwUser; wod16 = (LPWAVEOPENDESC16)((LPSTR)ptr + sizeof(LPWAVEOPENDESC) + 2*sizeof(DWORD)); - wod16->hWave = wod32->hWave; + wod16->hWave = HWAVE_16(wod32->hWave); wod16->lpFormat = (LPWAVEFORMATEX)(seg_ptr + sizeof(LPWAVEOPENDESC) + 2*sizeof(DWORD) + sizeof(WAVEOPENDESC16)); memcpy(wod16 + 1, wod32->lpFormat, sz); @@ -1629,7 +1629,7 @@ *(LPDWORD)((char*)ptr + sizeof(LPWAVEOPENDESC)) = *lpdwUser; wod16 = (LPWAVEOPENDESC16)((LPSTR)ptr + sizeof(LPWAVEOPENDESC) + 2*sizeof(DWORD)); - wod16->hWave = wod32->hWave; + wod16->hWave = HWAVE_16(wod32->hWave); wod16->lpFormat = (LPWAVEFORMATEX)(seg_ptr + sizeof(LPWAVEOPENDESC) + 2*sizeof(DWORD) + sizeof(WAVEOPENDESC16)); memcpy(wod16 + 1, wod32->lpFormat, sz); Index: dlls/winmm/mmsystem.c =================================================================== RCS file: /home/wine/wine/dlls/winmm/mmsystem.c,v retrieving revision 1.64 diff -u -r1.64 mmsystem.c --- dlls/winmm/mmsystem.c 1 Aug 2002 18:17:51 -0000 1.64 +++ dlls/winmm/mmsystem.c 1 Aug 2002 22:59:43 -0000 @@ -431,7 +431,7 @@ MMCKINFO ckMainRIFF; MMCKINFO mmckInfo; LPWAVEFORMATEX lpWaveFormat = NULL; - HWAVE hWave = 0; + HWAVEOUT hWave = 0; LPWAVEHDR waveHdr = NULL; INT count, bufsize, left, index; struct playsound_data s; @@ -2313,7 +2313,7 @@ TRACE("(%04X, %08lx, %d)\n", hMidiOut, lpsegMidiOutHdr, uSize); - if ((wmld = MMDRV_Get(hMidiOut, MMDRV_MIDIOUT, FALSE)) == NULL) + if ((wmld = MMDRV_Get(HMIDIOUT_32(hMidiOut), MMDRV_MIDIOUT, FALSE)) == NULL) return MMSYSERR_INVALHANDLE; return MMDRV_Message(wmld, MODM_PREPARE, lpsegMidiOutHdr, uSize, FALSE); @@ -2355,7 +2355,7 @@ return MMSYSERR_NOERROR; } - if ((wmld = MMDRV_Get(hMidiOut, MMDRV_MIDIOUT, FALSE)) == NULL) + if ((wmld = MMDRV_Get(HMIDIOUT_32(hMidiOut), MMDRV_MIDIOUT, FALSE)) == NULL) return MMSYSERR_INVALHANDLE; return MMDRV_Message(wmld, MODM_UNPREPARE, (DWORD)lpsegMidiOutHdr, uSize, FALSE); @@ -2411,7 +2411,7 @@ TRACE("(%04X, %p, %d)\n", hMidiOut, lpsegMidiOutHdr, uSize); - if ((wmld = MMDRV_Get(hMidiOut, MMDRV_MIDIOUT, FALSE)) == NULL) + if ((wmld = MMDRV_Get(HMIDIOUT_32(hMidiOut), MMDRV_MIDIOUT, FALSE)) == NULL) return MMSYSERR_INVALHANDLE; return MMDRV_Message(wmld, MODM_LONGDATA, (DWORD)lpsegMidiOutHdr, uSize, FALSE); @@ -2523,7 +2523,7 @@ UINT16 WINAPI midiOutCacheDrumPatches16(HMIDIOUT16 hMidiOut, UINT16 uPatch, WORD* lpwKeyArray, UINT16 uFlags) { - return midiOutCacheDrumPatches16(hMidiOut, uPatch, lpwKeyArray, uFlags); + return midiOutCacheDrumPatches(HMIDIOUT_32(hMidiOut), uPatch, lpwKeyArray, uFlags); } /************************************************************************** @@ -2553,7 +2553,7 @@ TRACE("(%04X, %p)\n", hMidiOut, lpuDeviceID); if (lpuDeviceID == NULL) return MMSYSERR_INVALPARAM; - if ((wmld = MMDRV_Get(hMidiOut, MMDRV_MIDIOUT, FALSE)) == NULL) + if ((wmld = MMDRV_Get(HMIDIOUT_32(hMidiOut), MMDRV_MIDIOUT, FALSE)) == NULL) return MMSYSERR_INVALHANDLE; *lpuDeviceID = wmld->uDeviceID; @@ -2601,7 +2601,7 @@ TRACE("(%04X, %04X, %08lX, %08lX)\n", hMidiOut, uMessage, dwParam1, dwParam2); - if ((wmld = MMDRV_Get(hMidiOut, MMDRV_MIDIOUT, FALSE)) == NULL) + if ((wmld = MMDRV_Get(HMIDIOUT_32(hMidiOut), MMDRV_MIDIOUT, FALSE)) == NULL) return MMSYSERR_INVALHANDLE; switch (uMessage) { @@ -2836,7 +2836,7 @@ TRACE("(%04X, %08lx, %d)\n", hMidiIn, lpsegMidiInHdr, uSize); - if ((wmld = MMDRV_Get(hMidiIn, MMDRV_MIDIIN, FALSE)) == NULL) + if ((wmld = MMDRV_Get(HMIDIIN_32(hMidiIn), MMDRV_MIDIIN, FALSE)) == NULL) return MMSYSERR_INVALHANDLE; return MMDRV_Message(wmld, MIDM_PREPARE, (DWORD)lpsegMidiInHdr, uSize, FALSE); @@ -2878,7 +2878,7 @@ return MMSYSERR_NOERROR; } - if ((wmld = MMDRV_Get(hMidiIn, MMDRV_MIDIIN, FALSE)) == NULL) + if ((wmld = MMDRV_Get(HMIDIIN_32(hMidiIn), MMDRV_MIDIIN, FALSE)) == NULL) return MMSYSERR_INVALHANDLE; return MMDRV_Message(wmld, MIDM_UNPREPARE, (DWORD)lpsegMidiInHdr, uSize, FALSE); @@ -2911,7 +2911,7 @@ TRACE("(%04X, %p, %d)\n", hMidiIn, lpsegMidiInHdr, uSize); - if ((wmld = MMDRV_Get(hMidiIn, MMDRV_MIDIIN, FALSE)) == NULL) + if ((wmld = MMDRV_Get(HMIDIIN_32(hMidiIn), MMDRV_MIDIIN, FALSE)) == NULL) return MMSYSERR_INVALHANDLE; return MMDRV_Message(wmld, MIDM_ADDBUFFER, (DWORD)lpsegMidiInHdr, uSize, FALSE); @@ -3016,7 +3016,7 @@ if (lpuDeviceID == NULL) return MMSYSERR_INVALPARAM; - if ((wmld = MMDRV_Get(hMidiIn, MMDRV_MIDIIN, TRUE)) == NULL) + if ((wmld = MMDRV_Get(HMIDIIN_32(hMidiIn), MMDRV_MIDIIN, TRUE)) == NULL) return MMSYSERR_INVALHANDLE; *lpuDeviceID = wmld->uDeviceID; @@ -3072,7 +3072,7 @@ return midiInAddBuffer16(hMidiIn, MapSL(dwParam1), dwParam2); } - if ((wmld = MMDRV_Get(hMidiIn, MMDRV_MIDIIN, FALSE)) == NULL) + if ((wmld = MMDRV_Get(HMIDIIN_32(hMidiIn), MMDRV_MIDIIN, FALSE)) == NULL) return MMSYSERR_INVALHANDLE; return MMDRV_Message(wmld, uMessage, dwParam1, dwParam2, FALSE); @@ -3981,7 +3981,7 @@ ret = MMSYSTEM_waveOpen(&hWaveOut, (uDeviceID == (UINT16)-1) ? (UINT)-1 : uDeviceID, MMDRV_WAVEOUT, lpFormat, dwCallback, dwInstance, dwFlags, FALSE); - if (lphWaveOut != NULL) *lphWaveOut = hWaveOut; + if (lphWaveOut != NULL) *lphWaveOut = HWAVEOUT_16(hWaveOut); return ret; } @@ -4013,7 +4013,7 @@ UINT16 ret; ReleaseThunkLock(&level); - ret = waveOutClose(hWaveOut); + ret = waveOutClose(HWAVEOUT_32(hWaveOut)); RestoreThunkLock(level); return ret; } @@ -4050,7 +4050,7 @@ if (lpWaveOutHdr == NULL) return MMSYSERR_INVALPARAM; - if ((wmld = MMDRV_Get(hWaveOut, MMDRV_WAVEOUT, FALSE)) == NULL) + if ((wmld = MMDRV_Get(HWAVEOUT_32(hWaveOut), MMDRV_WAVEOUT, FALSE)) == NULL) return MMSYSERR_INVALHANDLE; return MMDRV_Message(wmld, WODM_PREPARE, (DWORD)lpsegWaveOutHdr, uSize, FALSE); @@ -4092,7 +4092,7 @@ return MMSYSERR_NOERROR; } - if ((wmld = MMDRV_Get(hWaveOut, MMDRV_WAVEOUT, FALSE)) == NULL) + if ((wmld = MMDRV_Get(HWAVEOUT_32(hWaveOut), MMDRV_WAVEOUT, FALSE)) == NULL) return MMSYSERR_INVALHANDLE; return MMDRV_Message(wmld, WODM_UNPREPARE, (DWORD)lpsegWaveOutHdr, uSize, FALSE); @@ -4125,7 +4125,7 @@ TRACE("(%04X, %p, %u);\n", hWaveOut, lpsegWaveOutHdr, uSize); - if ((wmld = MMDRV_Get(hWaveOut, MMDRV_WAVEOUT, FALSE)) == NULL) + if ((wmld = MMDRV_Get(HWAVEOUT_32(hWaveOut), MMDRV_WAVEOUT, FALSE)) == NULL) return MMSYSERR_INVALHANDLE; return MMDRV_Message(wmld, WODM_WRITE, (DWORD)lpsegWaveOutHdr, uSize, FALSE); @@ -4154,7 +4154,7 @@ UINT16 ret; ReleaseThunkLock(&level); - ret = waveOutBreakLoop(hWaveOut16); + ret = waveOutBreakLoop(HWAVEOUT_32(hWaveOut16)); RestoreThunkLock(level); return ret; } @@ -4182,7 +4182,7 @@ UINT16 ret; ReleaseThunkLock(&level); - ret = waveOutPause(hWaveOut16); + ret = waveOutPause(HWAVEOUT_32(hWaveOut16)); RestoreThunkLock(level); return ret; } @@ -4210,7 +4210,7 @@ UINT16 ret; ReleaseThunkLock(&level); - ret = waveOutReset(hWaveOut16); + ret = waveOutReset(HWAVEOUT_32(hWaveOut16)); RestoreThunkLock(level); return ret; } @@ -4238,7 +4238,7 @@ UINT16 ret; ReleaseThunkLock(&level); - ret = waveOutRestart(hWaveOut16); + ret = waveOutRestart(HWAVEOUT_32(hWaveOut16)); RestoreThunkLock(level); return ret; } @@ -4269,7 +4269,7 @@ MMTIME mmt; mmt.wType = lpTime->wType; - ret = waveOutGetPosition(hWaveOut, &mmt, sizeof(mmt)); + ret = waveOutGetPosition(HWAVEOUT_32(hWaveOut), &mmt, sizeof(mmt)); MMSYSTEM_MMTIME32to16(lpTime, &mmt); return ret; } @@ -4293,7 +4293,7 @@ */ UINT16 WINAPI waveOutGetPitch16(HWAVEOUT16 hWaveOut16, LPDWORD lpdw) { - return waveOutGetPitch(hWaveOut16, lpdw); + return waveOutGetPitch(HWAVEOUT_32(hWaveOut16), lpdw); } /************************************************************************** @@ -4315,7 +4315,7 @@ */ UINT16 WINAPI waveOutSetPitch16(HWAVEOUT16 hWaveOut16, DWORD dw) { - return waveOutSetPitch(hWaveOut16, dw); + return waveOutSetPitch(HWAVEOUT_32(hWaveOut16), dw); } /************************************************************************** @@ -4337,7 +4337,7 @@ */ UINT16 WINAPI waveOutGetPlaybackRate16(HWAVEOUT16 hWaveOut16, LPDWORD lpdw) { - return waveOutGetPlaybackRate(hWaveOut16, lpdw); + return waveOutGetPlaybackRate(HWAVEOUT_32(hWaveOut16), lpdw); } /************************************************************************** @@ -4359,7 +4359,7 @@ */ UINT16 WINAPI waveOutSetPlaybackRate16(HWAVEOUT16 hWaveOut16, DWORD dw) { - return waveOutSetPlaybackRate(hWaveOut16, dw); + return waveOutSetPlaybackRate(HWAVEOUT_32(hWaveOut16), dw); } /************************************************************************** @@ -4437,7 +4437,7 @@ if (lpuDeviceID == NULL) return MMSYSERR_INVALHANDLE; - if ((wmld = MMDRV_Get(hWaveOut, MMDRV_WAVEOUT, FALSE)) == NULL) + if ((wmld = MMDRV_Get(HWAVEOUT_32(hWaveOut), MMDRV_WAVEOUT, FALSE)) == NULL) return MMSYSERR_INVALHANDLE; *lpuDeviceID = wmld->uDeviceID; @@ -4478,8 +4478,8 @@ TRACE("(%04x, %u, %ld, %ld)\n", hWaveOut, uMessage, dwParam1, dwParam2); - if ((wmld = MMDRV_Get(hWaveOut, MMDRV_WAVEOUT, FALSE)) == NULL) { - if ((wmld = MMDRV_Get(hWaveOut, MMDRV_WAVEOUT, TRUE)) != NULL) { + if ((wmld = MMDRV_Get(HWAVEOUT_32(hWaveOut), MMDRV_WAVEOUT, FALSE)) == NULL) { + if ((wmld = MMDRV_Get(HWAVEOUT_32(hWaveOut), MMDRV_WAVEOUT, TRUE)) != NULL) { return MMDRV_PhysicalFeatures(wmld, uMessage, dwParam1, dwParam2); } return MMSYSERR_INVALHANDLE; @@ -4624,7 +4624,7 @@ ret = MMSYSTEM_waveOpen(&hWaveIn, (uDeviceID == (UINT16)-1) ? (UINT)-1 : uDeviceID, MMDRV_WAVEIN, lpFormat, dwCallback, dwInstance, dwFlags, FALSE); - if (lphWaveIn != NULL) *lphWaveIn = hWaveIn; + if (lphWaveIn != NULL) *lphWaveIn = HWAVEIN_16(hWaveIn); return ret; } @@ -4655,7 +4655,7 @@ UINT16 ret; ReleaseThunkLock(&level); - ret = waveInClose(hWaveIn); + ret = waveInClose(HWAVEIN_32(hWaveIn)); RestoreThunkLock(level); return ret; } @@ -4693,7 +4693,7 @@ TRACE("(%04X, %p, %u);\n", hWaveIn, lpWaveInHdr, uSize); if (lpWaveInHdr == NULL) return MMSYSERR_INVALHANDLE; - if ((wmld = MMDRV_Get(hWaveIn, MMDRV_WAVEIN, FALSE)) == NULL) + if ((wmld = MMDRV_Get(HWAVEIN_32(hWaveIn), MMDRV_WAVEIN, FALSE)) == NULL) return MMSYSERR_INVALHANDLE; lpWaveInHdr->dwBytesRecorded = 0; @@ -4741,7 +4741,7 @@ return MMSYSERR_NOERROR; } - if ((wmld = MMDRV_Get(hWaveIn, MMDRV_WAVEIN, FALSE)) == NULL) + if ((wmld = MMDRV_Get(HWAVEIN_32(hWaveIn), MMDRV_WAVEIN, FALSE)) == NULL) return MMSYSERR_INVALHANDLE; return MMDRV_Message(wmld, WIDM_UNPREPARE, (DWORD)lpsegWaveInHdr, uSize, FALSE); @@ -4776,7 +4776,7 @@ TRACE("(%04X, %p, %u);\n", hWaveIn, lpsegWaveInHdr, uSize); if (lpsegWaveInHdr == NULL) return MMSYSERR_INVALPARAM; - if ((wmld = MMDRV_Get(hWaveIn, MMDRV_WAVEIN, FALSE)) == NULL) + if ((wmld = MMDRV_Get(HWAVEIN_32(hWaveIn), MMDRV_WAVEIN, FALSE)) == NULL) return MMSYSERR_INVALHANDLE; return MMDRV_Message(wmld, WIDM_ADDBUFFER, (DWORD)lpsegWaveInHdr, uSize, FALSE); @@ -4806,7 +4806,7 @@ UINT16 ret; ReleaseThunkLock(&level); - ret = waveInReset(hWaveIn16); + ret = waveInReset(HWAVEIN_32(hWaveIn16)); RestoreThunkLock(level); return ret; } @@ -4835,7 +4835,7 @@ UINT16 ret; ReleaseThunkLock(&level); - ret = waveInStart(hWaveIn16); + ret = waveInStart(HWAVEIN_32(hWaveIn16)); RestoreThunkLock(level); return ret; } @@ -4864,7 +4864,7 @@ UINT16 ret; ReleaseThunkLock(&level); - ret = waveInStop(hWaveIn16); + ret = waveInStop(HWAVEIN_32(hWaveIn16)); RestoreThunkLock(level); return ret; } @@ -4895,7 +4895,7 @@ MMTIME mmt; mmt.wType = lpTime->wType; - ret = waveInGetPosition(hWaveIn, &mmt, sizeof(mmt)); + ret = waveInGetPosition(HWAVEIN_32(hWaveIn), &mmt, sizeof(mmt)); MMSYSTEM_MMTIME32to16(lpTime, &mmt); return ret; } @@ -4929,7 +4929,7 @@ if (lpuDeviceID == NULL) return MMSYSERR_INVALHANDLE; - if ((wmld = MMDRV_Get(hWaveIn, MMDRV_WAVEIN, FALSE)) == NULL) + if ((wmld = MMDRV_Get(HWAVEIN_32(hWaveIn), MMDRV_WAVEIN, FALSE)) == NULL) return MMSYSERR_INVALHANDLE; *lpuDeviceID = wmld->uDeviceID; @@ -4970,7 +4970,7 @@ if (uMessage < DRVM_IOCTL || (uMessage >= DRVM_IOCTL_LAST && uMessage < DRVM_MAPPER)) return MMSYSERR_INVALPARAM; - if ((wmld = MMDRV_Get(hWaveIn, MMDRV_WAVEIN, FALSE)) == NULL) + if ((wmld = MMDRV_Get(HWAVEIN_32(hWaveIn), MMDRV_WAVEIN, FALSE)) == NULL) return MMSYSERR_INVALHANDLE; return MMDRV_Message(wmld, uMessage, dwParam1, dwParam2, TRUE); Index: dlls/winmm/winemm.h =================================================================== RCS file: /home/wine/wine/dlls/winmm/winemm.h,v retrieving revision 1.16 diff -u -r1.16 winemm.h --- dlls/winmm/winemm.h 1 Aug 2002 18:17:51 -0000 1.16 +++ dlls/winmm/winemm.h 1 Aug 2002 22:59:43 -0000 @@ -232,8 +232,15 @@ #define HMIDIIN_32(h16) ((HMIDIIN)(ULONG_PTR)(h16)) #define HMIDIOUT_32(h16) ((HMIDIOUT)(ULONG_PTR)(h16)) #define HMIDISTRM_32(h16) ((HMIDISTRM)(ULONG_PTR)(h16)) +#define HWAVE_32(h16) ((HWAVE)(ULONG_PTR)(h16)) +#define HWAVEIN_32(h16) ((HWAVEIN)(ULONG_PTR)(h16)) +#define HWAVEOUT_32(h16) ((HWAVEOUT)(ULONG_PTR)(h16)) + /* HANDLE -> HANDLE16 conversions */ #define HMIDI_16(h32) (LOWORD(h32)) #define HMIDIIN_16(h32) (LOWORD(h32)) #define HMIDIOUT_16(h32) (LOWORD(h32)) #define HMIDISTRM_16(h32) (LOWORD(h32)) +#define HWAVE_16(h32) (LOWORD(h32)) +#define HWAVEIN_16(h32) (LOWORD(h32)) +#define HWAVEOUT_16(h32) (LOWORD(h32)) Index: include/mmsystem.h =================================================================== RCS file: /home/wine/wine/include/mmsystem.h,v retrieving revision 1.52 diff -u -r1.52 mmsystem.h --- include/mmsystem.h 1 Aug 2002 18:17:51 -0000 1.52 +++ include/mmsystem.h 1 Aug 2002 22:59:44 -0000 @@ -31,9 +31,9 @@ typedef LPCSTR HPCSTR; /* a huge version of LPCSTR */ DECLARE_OLD_HANDLE(HDRVR); -DECLARE_OLD_HANDLE(HWAVE); -DECLARE_OLD_HANDLE(HWAVEIN); -DECLARE_OLD_HANDLE(HWAVEOUT); +DECLARE_HANDLE(HWAVE); +DECLARE_HANDLE(HWAVEIN); +DECLARE_HANDLE(HWAVEOUT); DECLARE_HANDLE(HMIDI); DECLARE_HANDLE(HMIDIIN); DECLARE_HANDLE(HMIDIOUT);
Attachment:
pgp00026.pgp
Description: PGP signature