Commit in reactos/lib/winmm on MAIN
mci.c+53-81.2 -> 1.3
message16.c+171.1 -> 1.2
mmio.c+6-11.2 -> 1.3
winmm_res.rc+2-21.1 -> 1.2
+78-11
4 modified files
Sync to Wine-20040408
Eric Pouech <pouech-eric@wanadoo.fr>
- implemented MCI_SOUND command
- fixed MCI command table in resource
- added a TODO list on MCI handling
Christian Costa <titan.costa@wanadoo.fr>
- MCI strings are case insensitive.
- Fixed a returned error value.
- Default to FOURCC_DOS if no IOProc found.

reactos/lib/winmm
mci.c 1.2 -> 1.3
diff -u -r1.2 -r1.3
--- mci.c	25 Feb 2004 20:00:41 -0000	1.2
+++ mci.c	16 Apr 2004 09:04:04 -0000	1.3
@@ -1,5 +1,3 @@
-/* -*- tab-width: 8; c-basic-offset: 4 -*- */
-
 /*
  * MCI internal functions
  *
@@ -20,6 +18,21 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
+/* TODO:
+ * - implement WINMM (32bit) multitasking and use it in all MCI drivers
+ *   instead of the home grown one 
+ * - 16bit mmTaskXXX functions are currently broken because the 16
+ *   loader does not support binary command lines => provide Wine's
+ *   own mmtask.tsk not using binary command line.
+ * - correctly handle the MCI_ALL_DEVICE_ID in functions.
+ * - finish mapping 16 <=> 32 of MCI structures and commands
+ * - implement auto-open feature (ie, when a string command is issued
+ *   for a not yet opened device, MCI automatically opens it) 
+ * - use a default registry setting to replace the [mci] section in
+ *   configuration file (layout of info in registry should be compatible
+ *   with all Windows' version - which use different layouts of course)
+ */
+
 #include "config.h"
 #include "wine/port.h"
 
@@ -593,7 +606,7 @@
      * array look up
      */
     for (idx = 0; idx < S_MciCmdTable[uTbl].nVerbs; idx++) {
-	if (strcmp(S_MciCmdTable[uTbl].aVerbs[idx], verb) == 0)
+	if (strcasecmp(S_MciCmdTable[uTbl].aVerbs[idx], verb) == 0)
 	    return S_MciCmdTable[uTbl].aVerbs[idx];
     }
 
@@ -885,6 +898,7 @@
     if (!(verb = HeapAlloc(GetProcessHeap(), 0, strlen(lpstrCommand)+1)))
 	return MCIERR_OUT_OF_MEMORY;
     strcpy( verb, lpstrCommand );
+    CharLowerA(verb);
 
     memset(data, 0, sizeof(data));
 
@@ -898,7 +912,7 @@
     }
 
     /* case dev == 'new' has to be handled */
-    if (!strcasecmp(dev, "new")) {
+    if (!strcmp(dev, "new")) {
 	FIXME("'new': NIY as device name\n");
 	dwRet = MCIERR_MISSING_DEVICE_NAME;
 	goto errCleanUp;
@@ -956,6 +970,8 @@
 	}
 
 	dwRet = MCI_LoadMciDriver(devType, &wmd);
+	if (dwRet == MCIERR_DEVICE_NOT_INSTALLED)
+	    dwRet = MCIERR_INVALID_DEVICE_NAME;
 	HeapFree(GetProcessHeap(), 0, devType);
 	if (dwRet) {
 	    MCI_UnLoadMciDriver(wmd);
@@ -1518,6 +1534,26 @@
 }
 
 /**************************************************************************
+ * 			MCI_Sound				[internal]
+ */
+static	DWORD MCI_Sound(UINT wDevID, DWORD dwFlags, LPMCI_SOUND_PARMS lpParms)
+{
+    DWORD	dwRet = 0;
+
+    if (lpParms == NULL)	return MCIERR_NULL_PARAMETER_BLOCK;
+
+    if (dwFlags & MCI_SOUND_NAME)
+        dwRet = sndPlaySoundA(lpParms->lpstrSoundName, SND_SYNC) ? MMSYSERR_NOERROR : MMSYSERR_ERROR;
+    else
+        dwRet = MMSYSERR_ERROR; /* what should be done ??? */
+    if (dwFlags & MCI_NOTIFY)
+	mciDriverNotify((HWND)lpParms->dwCallback, wDevID,
+                        (dwRet == 0) ? MCI_NOTIFY_SUCCESSFUL : MCI_NOTIFY_FAILURE);
+
+    return dwRet;
+}
+
+/**************************************************************************
  * 			MCI_SendCommand				[internal]
  */
 DWORD	MCI_SendCommand(UINT wDevID, UINT16 wMsg, DWORD dwParam1,
@@ -1564,7 +1600,7 @@
 		dwRet = MCI_SysInfo(wDevID, dwParam1, (LPMCI_SYSINFO_PARMSA)dwParam2);
 		pFnMciUnMapMsg16To32A(0, wMsg, dwParam2);
 		break;
-	    default: break; /* so that gcc doesnot  bark */
+	    default: break; /* so that gcc does not bark */
 	    }
 	}
 	break;
@@ -1583,9 +1619,18 @@
 	}
 	break;
     case MCI_SOUND:
-	/* FIXME: it seems that MCI_SOUND needs the same handling as MCI_BREAK
-	 * but I couldn't get any doc on this MCI message
-	 */
+	if (bFrom32) {
+	    dwRet = MCI_Sound(wDevID, dwParam1, (LPMCI_SOUND_PARMS)dwParam2);
+	} else if (pFnMciMapMsg16To32A) {
+	    switch (pFnMciMapMsg16To32A(0, wMsg, &dwParam2)) {
+	    case WINMM_MAP_OK:
+	    case WINMM_MAP_OKMEM:
+		dwRet = MCI_Sound(wDevID, dwParam1, (LPMCI_SOUND_PARMS)dwParam2);
+		pFnMciUnMapMsg16To32A(0, wMsg, dwParam2);
+		break;
+	    default: break; /* so that gcc does not bark */
+	    }
+	}
 	break;
     default:
 	if (wDevID == MCI_ALL_DEVICE_ID) {

reactos/lib/winmm
message16.c 1.1 -> 1.2
diff -u -r1.1 -r1.2
--- message16.c	25 Feb 2004 20:00:42 -0000	1.1
+++ message16.c	16 Apr 2004 09:04:04 -0000	1.2
@@ -1995,6 +1995,20 @@
 	    *lParam = (DWORD)msip32a;
 	}
 	return WINMM_MAP_OKMEM;
+    case MCI_SOUND:
+	{
+            LPMCI_SOUND_PARMS		mbp32 = HeapAlloc(GetProcessHeap(), 0, sizeof(MCI_SOUND_PARMS));
+	    LPMCI_SOUND_PARMS16		mbp16 = MapSL(*lParam);
+
+	    if (mbp32) {
+		mbp32->dwCallback = mbp16->dwCallback;
+		mbp32->lpstrSoundName = MapSL(mbp16->lpstrSoundName);
+	    } else {
+		return WINMM_MAP_NOMEM;
+	    }
+	    *lParam = (DWORD)mbp32;
+	}
+	return WINMM_MAP_OKMEM;
     case DRV_LOAD:
     case DRV_ENABLE:
     case DRV_OPEN:
@@ -2065,6 +2079,7 @@
     case MCI_ESCAPE:
     case MCI_INFO:
     case MCI_SYSINFO:
+    case MCI_SOUND:
 	HeapFree(GetProcessHeap(), 0, (LPVOID)lParam);
 	return WINMM_MAP_OK;
     case MCI_OPEN:
@@ -2454,6 +2469,7 @@
 	break;
 	/* case MCI_SETTIMECODE:*/
 	/* case MCI_SIGNAL:*/
+        /* case MCI_SOUND:*/
     case MCI_SPIN:
 	size = sizeof(MCI_SET_PARMS);
 	break;
@@ -2653,6 +2669,7 @@
 	break;
 	/* case MCI_SETTIMECODE:*/
 	/* case MCI_SIGNAL:*/
+        /* case MCI_SOUND:*/
     case MCI_SPIN:
 	break;
     case MCI_STATUS:

reactos/lib/winmm
mmio.c 1.2 -> 1.3
diff -u -r1.2 -r1.3
--- mmio.c	12 Mar 2004 21:20:53 -0000	1.2
+++ mmio.c	16 Apr 2004 09:04:04 -0000	1.3
@@ -633,7 +633,12 @@
 	/* Handle any unhandled/error case. Assume DOS file */
 	if (wm->info.fccIOProc == 0)
 	    wm->info.fccIOProc = FOURCC_DOS;
-	if (!(wm->ioProc = MMIO_FindProcNode(wm->info.fccIOProc))) goto error2;
+	if (!(wm->ioProc = MMIO_FindProcNode(wm->info.fccIOProc))) {
+	    /* If not found, retry with FOURCC_DOS */
+	    wm->info.fccIOProc = FOURCC_DOS;
+	    if (!(wm->ioProc = MMIO_FindProcNode(wm->info.fccIOProc)))
+		goto error2;
+	}
 	wm->bTmpIOProc = FALSE;
     }
     /* if just the four character code is present, look up IO proc */

reactos/lib/winmm
winmm_res.rc 1.1 -> 1.2
diff -u -r1.1 -r1.2
--- winmm_res.rc	15 Dec 2003 20:20:34 -0000	1.1
+++ winmm_res.rc	16 Apr 2004 09:04:04 -0000	1.2
@@ -405,7 +405,7 @@
 
 CDAUDIO RCDATA
 BEGIN
-"atus\0", 0x00000814L, MCI_COMMAND_HEAD,
+"status\0", 0x00000814L, MCI_COMMAND_HEAD,
 "\0", 0x00000002L, MCI_RETURN,
 "notify\0", 0x00000001L, MCI_FLAG,
 "wait\0", 0x00000002L, MCI_FLAG,
@@ -456,7 +456,7 @@
 
 SEQUENCER RCDATA
 BEGIN
-"atus\0", 0x00000814L, MCI_COMMAND_HEAD,
+"status\0", 0x00000814L, MCI_COMMAND_HEAD,
 "\0", 0x00000002L, MCI_RETURN,
 "notify\0", 0x00000001L, MCI_FLAG,
 "wait\0", 0x00000002L, MCI_FLAG,
CVSspam 0.2.8