mmio fix

Andreas Mohr amohr at codeweavers.com
Mon Feb 5 05:18:21 CST 2001


Hi all,

make MMIO_Open work with NULL filename again.

Needed for Adobe PageMill 3.0 (but it still crashes after that :-\).

Andreas Mohr
-------------- next part --------------
Determining best CVS host...
Using CVSROOT :pserver:cvs at wine.codeweavers.com:/home/cvs/wine
Index: mmio.c
===================================================================
RCS file: /home/cvs/wine/wine/dlls/winmm/mmio.c,v
retrieving revision 1.18
diff -u -r1.18 mmio.c
--- mmio.c	2000/12/22 01:09:26	1.18
+++ mmio.c	2001/02/05 21:06:10
@@ -509,6 +509,8 @@
     
     TRACE("(%s)\n",debugstr_a(szFileName));
     
+    if (!szFileName)
+	return ret;
     extEnd = strrchr(szFileName,'+');
     if (extEnd) {
 	/* Need to parse to find the extension */
@@ -719,7 +721,7 @@
     LPWINE_MMIO		wm;
 
     TRACE("('%s', %p, %08lX, %d);\n", szFileName, refmminfo, dwOpenFlags, type);
-    
+
     if (dwOpenFlags & (MMIO_PARSE|MMIO_EXIST)) {
 	char	buffer[MAX_PATH];
 	
@@ -734,7 +736,7 @@
     if ((wm = MMIO_Create()) == NULL)
 	return 0;
 
-    /* If both params are NULL, then parse the file name */
+    /* If both params are NULL, then parse the file name if available */
     if (refmminfo->fccIOProc == 0 && refmminfo->pIOProc == NULL) {
 	wm->info.fccIOProc = MMIO_ParseExt(szFileName);
 	/* Handle any unhandled/error case. Assume DOS file */
@@ -785,7 +787,7 @@
     
     /* call IO proc to actually open file */
     refmminfo->wErrorRet = MMIO_SendMessage(wm, MMIOM_OPEN, (LPARAM)szFileName, 
-					    type == MMIO_PROC_16, MMIO_PROC_32A);
+					type == MMIO_PROC_16, MMIO_PROC_32A);
 
     if (refmminfo->wErrorRet == 0)
 	return wm->info.hmmio;


More information about the wine-patches mailing list