Commit in reactos/lib/winmm on MAIN
mmio.c+29-231.1 -> 1.2
winehq2ros.patch+35-151.1 -> 1.2
winmm.c+25-51.3 -> 1.4
+89-43
3 modified files
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.

reactos/lib/winmm
mmio.c 1.1 -> 1.2
diff -u -r1.1 -r1.2
--- mmio.c	15 Dec 2003 20:20:34 -0000	1.1
+++ mmio.c	12 Mar 2004 21:20:53 -0000	1.2
@@ -389,41 +389,47 @@
  */
 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--;
-	}
 
-	if (extStart < szFileName) {
-	    ERR("+ but no . in szFileName: %s\n", debugstr_a(szFileName));
-	} else {
-	    CHAR ext[5];
+    /* Find the last '.' */
+    extStart = strrchr(szFileName,'.');
 
-	    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);
-	}
+    if (!extStart) {
+         ERR("No . in szFileName: %s\n", debugstr_a(szFileName));
+    } else {
+        CHAR ext[5];
+
+        /* 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;
 }

reactos/lib/winmm
winehq2ros.patch 1.1 -> 1.2
diff -u -r1.1 -r1.2
--- winehq2ros.patch	25 Feb 2004 23:50:28 -0000	1.1
+++ winehq2ros.patch	12 Mar 2004 21:20:53 -0000	1.2
@@ -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 @@
  
      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__ */
++
++#ifdef __REACTOS__
++    // AG: TESTING:
++    MMDRV_Install("mmdrv.dll", "mmdrv.dll", FALSE);
++#endif
+ 
      /* finish with mappers */
-     MMDRV_Install("wavemapper",	   	"msacm.drv",	TRUE);
-     MMDRV_Install("midimapper",   	"midimap.drv",	TRUE);
-
-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
+-    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 @@
      }
      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)

reactos/lib/winmm
winmm.c 1.3 -> 1.4
diff -u -r1.3 -r1.4
--- winmm.c	25 Feb 2004 20:00:42 -0000	1.3
+++ winmm.c	12 Mar 2004 21:20:53 -0000	1.4
@@ -1371,6 +1371,9 @@
 
     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 @@
 
     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 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 @@
 
     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 @@
 
     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 @@
 
     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 @@
 
     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 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 @@
 
     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 @@
 
     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;
     }
CVSspam 0.2.8