Sync to Wine-20040309:

Jason Edmeades <us@the-edmeades.demon.co.uk>
- Handle playing of files containing a '+' as part of the filename.
Robert Reif <reif@earthlink.net>
- Cleanup prepare/unprepare header parameter checking.
- Fix midiInGetDevCapsW.
Sean Young <sean@mess.org>
- Check uSize parameter in waveOutUnprepareHeader and
waveOutPrepareHeader.
Christian Costa <titan.costa@wanadoo.fr>
- Fixed waveInGetDevCapsW.

svn path=/trunk/; revision=8672
This commit is contained in:
Gé van Geldorp 2004-03-12 21:20:53 +00:00
parent 5ceefba3a3
commit ceabe25983
3 changed files with 88 additions and 42 deletions

View file

@ -389,41 +389,47 @@ static LRESULT send_message(struct IOProcList* ioProc, LPMMIOINFO mmioinfo,
*/
static FOURCC MMIO_ParseExtA(LPCSTR szFileName)
{
/* Filenames are of the form file.ext+ABC
FIXME: What if a '+' is part of the file name?
For now, we take the last '+' present */
/* Filenames are of the form file.ext{+ABC}
For now, we take the last '+' if present */
FOURCC ret = 0;
/* Note that ext{Start,End} point to the . and + respectively */
LPSTR extEnd;
LPSTR extStart;
TRACE("(%s)\n", debugstr_a(szFileName));
if (!szFileName)
return ret;
extEnd = strrchr(szFileName,'+');
if (extEnd) {
/* Need to parse to find the extension */
LPSTR extStart;
extStart = extEnd;
while (extStart >= szFileName && extStart[0] != '.') {
extStart--;
}
/* Find the last '.' */
extStart = strrchr(szFileName,'.');
if (extStart < szFileName) {
ERR("+ but no . in szFileName: %s\n", debugstr_a(szFileName));
} else {
CHAR ext[5];
if (!extStart) {
ERR("No . in szFileName: %s\n", debugstr_a(szFileName));
} else {
CHAR ext[5];
if (extEnd - extStart - 1 > 4)
WARN("Extension length > 4\n");
lstrcpynA(ext, extStart + 1, min(extEnd-extStart,5));
TRACE("Got extension: %s\n", debugstr_a(ext));
/* FOURCC codes identifying file-extensions must be uppercase */
ret = mmioStringToFOURCCA(ext, MMIO_TOUPPER);
}
/* Find the '+' afterwards */
extEnd = strchr(extStart,'+');
if (extEnd) {
if (extEnd - extStart - 1 > 4)
WARN("Extension length > 4\n");
lstrcpynA(ext, extStart + 1, min(extEnd-extStart,5));
} else {
/* No + so just an extension */
if (strlen(extStart) > 4) {
WARN("Extension length > 4\n");
}
lstrcpynA(ext, extStart + 1, 5);
}
TRACE("Got extension: %s\n", debugstr_a(ext));
/* FOURCC codes identifying file-extensions must be uppercase */
ret = mmioStringToFOURCCA(ext, MMIO_TOUPPER);
}
return ret;
}

View file

@ -1,6 +1,10 @@
diff -u /c/source/wine/dlls/winmm/lolvldrv.c winmm/lolvldrv.c
--- /c/source/wine/dlls/winmm/lolvldrv.c Wed Feb 25 18:47:36 2004
+++ winmm/lolvldrv.c Tue Feb 17 01:15:52 2004
Index: lolvldrv.c
===================================================================
RCS file: /home/wine/wine/dlls/winmm/lolvldrv.c,v
retrieving revision 1.55
diff -u -r1.55 lolvldrv.c
--- lolvldrv.c 31 Dec 2003 23:49:45 -0000 1.55
+++ lolvldrv.c 12 Mar 2004 21:27:34 -0000
@@ -497,10 +497,12 @@
case DRV_QUERYDEVICEINTERFACESIZE:
return MMDRV_Message(mld, uMsg, dwParam1, dwParam2, TRUE);
@ -14,21 +18,34 @@ diff -u /c/source/wine/dlls/winmm/lolvldrv.c winmm/lolvldrv.c
default:
WARN("Unknown call %04x\n", uMsg);
@@ -741,8 +743,9 @@
@@ -741,11 +743,18 @@
static BOOL MMDRV_InitHardcoded(void)
{
/* first load hardware drivers */
+#ifndef __REACTOS__
MMDRV_Install("wineoss.drv", "wineoss.drv", FALSE);
-
+#endif /* __REACTOS__ */
/* finish with mappers */
MMDRV_Install("wavemapper", "msacm.drv", TRUE);
MMDRV_Install("midimapper", "midimap.drv", TRUE);
+
+#ifdef __REACTOS__
+ // AG: TESTING:
+ MMDRV_Install("mmdrv.dll", "mmdrv.dll", FALSE);
+#endif
diff -u /c/source/wine/dlls/winmm/time.c winmm/time.c
--- /c/source/wine/dlls/winmm/time.c Mon Jan 12 16:03:10 2004
+++ winmm/time.c Sun Feb 15 16:55:10 2004
/* finish with mappers */
- MMDRV_Install("wavemapper", "msacm.drv", TRUE);
- MMDRV_Install("midimapper", "midimap.drv", TRUE);
+ MMDRV_Install("wavemapper", "msacm32.dll", TRUE);
+ MMDRV_Install("midimapper", "midimap.dll", TRUE);
return TRUE;
}
Index: time.c
===================================================================
RCS file: /home/wine/wine/dlls/winmm/time.c,v
retrieving revision 1.26
diff -u -r1.26 time.c
--- time.c 12 Jan 2004 21:03:10 -0000 1.26
+++ time.c 12 Mar 2004 21:27:34 -0000
@@ -175,14 +175,19 @@
volatile HANDLE *pActive = (volatile HANDLE *)&TIME_hMMTimer;
DWORD last_time, cur_time;
@ -49,10 +66,13 @@ diff -u /c/source/wine/dlls/winmm/time.c winmm/time.c
}
return 0;
}
diff -u /c/source/wine/dlls/winmm/winmm.c winmm/winmm.c
--- /c/source/wine/dlls/winmm/winmm.c Wed Feb 25 14:28:52 2004
+++ winmm/winmm.c Sun Feb 15 22:58:58 2004
Index: winmm.c
===================================================================
RCS file: /home/wine/wine/dlls/winmm/winmm.c,v
retrieving revision 1.33
diff -u -r1.33 winmm.c
--- winmm.c 27 Feb 2004 21:29:32 -0000 1.33
+++ winmm.c 12 Mar 2004 21:27:36 -0000
@@ -125,10 +125,12 @@
loaded = -1;
if (h)

View file

@ -1371,6 +1371,9 @@ UINT WINAPI midiOutPrepareHeader(HMIDIOUT hMidiOut,
TRACE("(%p, %p, %d)\n", hMidiOut, lpMidiOutHdr, uSize);
if (lpMidiOutHdr == NULL || uSize < sizeof (MIDIHDR))
return MMSYSERR_INVALPARAM;
if ((wmld = MMDRV_Get(hMidiOut, MMDRV_MIDIOUT, FALSE)) == NULL)
return MMSYSERR_INVALHANDLE;
@ -1387,6 +1390,9 @@ UINT WINAPI midiOutUnprepareHeader(HMIDIOUT hMidiOut,
TRACE("(%p, %p, %d)\n", hMidiOut, lpMidiOutHdr, uSize);
if (lpMidiOutHdr == NULL || uSize < sizeof (MIDIHDR))
return MMSYSERR_INVALPARAM;
if (!(lpMidiOutHdr->dwFlags & MHDR_PREPARED)) {
return MMSYSERR_NOERROR;
}
@ -1556,7 +1562,7 @@ UINT WINAPI midiInGetNumDevs(void)
UINT WINAPI midiInGetDevCapsW(UINT_PTR uDeviceID, LPMIDIINCAPSW lpCaps, UINT uSize)
{
MIDIINCAPSA micA;
UINT ret = midiInGetDevCapsA(uDeviceID, &micA, uSize);
UINT ret = midiInGetDevCapsA(uDeviceID, &micA, sizeof(micA));
if (ret == MMSYSERR_NOERROR) {
MIDIINCAPSW micW;
@ -1681,6 +1687,9 @@ UINT WINAPI midiInPrepareHeader(HMIDIIN hMidiIn,
TRACE("(%p, %p, %d)\n", hMidiIn, lpMidiInHdr, uSize);
if (lpMidiInHdr == NULL || uSize < sizeof (MIDIHDR))
return MMSYSERR_INVALPARAM;
if ((wmld = MMDRV_Get(hMidiIn, MMDRV_MIDIIN, FALSE)) == NULL)
return MMSYSERR_INVALHANDLE;
@ -1697,6 +1706,9 @@ UINT WINAPI midiInUnprepareHeader(HMIDIIN hMidiIn,
TRACE("(%p, %p, %d)\n", hMidiIn, lpMidiInHdr, uSize);
if (lpMidiInHdr == NULL || uSize < sizeof (MIDIHDR))
return MMSYSERR_INVALPARAM;
if (!(lpMidiInHdr->dwFlags & MHDR_PREPARED)) {
return MMSYSERR_NOERROR;
}
@ -2609,7 +2621,8 @@ UINT WINAPI waveOutPrepareHeader(HWAVEOUT hWaveOut,
TRACE("(%p, %p, %u);\n", hWaveOut, lpWaveOutHdr, uSize);
if (lpWaveOutHdr == NULL) return MMSYSERR_INVALPARAM;
if (lpWaveOutHdr == NULL || uSize < sizeof (WAVEHDR))
return MMSYSERR_INVALPARAM;
if ((wmld = MMDRV_Get(hWaveOut, MMDRV_WAVEOUT, FALSE)) == NULL)
return MMSYSERR_INVALHANDLE;
@ -2627,6 +2640,9 @@ UINT WINAPI waveOutUnprepareHeader(HWAVEOUT hWaveOut,
TRACE("(%p, %p, %u);\n", hWaveOut, lpWaveOutHdr, uSize);
if (lpWaveOutHdr == NULL || uSize < sizeof (WAVEHDR))
return MMSYSERR_INVALPARAM;
if (!(lpWaveOutHdr->dwFlags & WHDR_PREPARED)) {
return MMSYSERR_NOERROR;
}
@ -2867,7 +2883,7 @@ UINT WINAPI waveInGetNumDevs(void)
UINT WINAPI waveInGetDevCapsW(UINT_PTR uDeviceID, LPWAVEINCAPSW lpCaps, UINT uSize)
{
WAVEINCAPSA wicA;
UINT ret = waveInGetDevCapsA(uDeviceID, &wicA, uSize);
UINT ret = waveInGetDevCapsA(uDeviceID, &wicA, sizeof(wicA));
if (ret == MMSYSERR_NOERROR) {
WAVEINCAPSW wicW;
@ -2961,7 +2977,9 @@ UINT WINAPI waveInPrepareHeader(HWAVEIN hWaveIn, WAVEHDR* lpWaveInHdr,
TRACE("(%p, %p, %u);\n", hWaveIn, lpWaveInHdr, uSize);
if (lpWaveInHdr == NULL) return MMSYSERR_INVALPARAM;
if (lpWaveInHdr == NULL || uSize < sizeof (WAVEHDR))
return MMSYSERR_INVALPARAM;
if ((wmld = MMDRV_Get(hWaveIn, MMDRV_WAVEIN, FALSE)) == NULL)
return MMSYSERR_INVALHANDLE;
@ -2980,7 +2998,9 @@ UINT WINAPI waveInUnprepareHeader(HWAVEIN hWaveIn, WAVEHDR* lpWaveInHdr,
TRACE("(%p, %p, %u);\n", hWaveIn, lpWaveInHdr, uSize);
if (lpWaveInHdr == NULL) return MMSYSERR_INVALPARAM;
if (lpWaveInHdr == NULL || uSize < sizeof (WAVEHDR))
return MMSYSERR_INVALPARAM;
if (!(lpWaveInHdr->dwFlags & WHDR_PREPARED)) {
return MMSYSERR_NOERROR;
}