[2/4] winmm: Use only the default I/O procedure, if a custom procedure for a given FOURCC is not found. (try 2)

Alexander Puzankov alxpnv at gmail.com
Tue Nov 30 12:08:45 CST 2010


-------------- next part --------------
From 7900ab6e836f1cbb9dd9e3ac00358715d79d4cd0 Mon Sep 17 00:00:00 2001
From: Alexander Puzankov <alxpnv at gmail.com>
Date: Mon, 29 Nov 2010 21:47:26 +0300
Subject: winmm: Use only the default I/O procedure, if a custom procedure for a given FOURCC is not found.

mmioInstallIOProc can install I/O procedure with the same FOURCC, as the
default (FOURCC_DOS). But the custom procedure should be used only when
FOURCC is clearly specified.
---
 dlls/winmm/mmio.c |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/dlls/winmm/mmio.c b/dlls/winmm/mmio.c
index 0ebebf1..b090b3f 100644
--- a/dlls/winmm/mmio.c
+++ b/dlls/winmm/mmio.c
@@ -617,13 +617,13 @@ static HMMIO MMIO_Open(LPSTR szFileName, MMIOINFO* refmminfo, DWORD dwOpenFlags,
     if (refmminfo->fccIOProc == 0 && refmminfo->pIOProc == NULL) {
 	wm->info.fccIOProc = MMIO_ParseExtA(szFileName);
 	/* Handle any unhandled/error case. Assume DOS file */
-	if (wm->info.fccIOProc == 0)
+	if (wm->info.fccIOProc == 0) {
 	    wm->info.fccIOProc = FOURCC_DOS;
-	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->ioProc = &defaultProcs[0];
+	}
+	else if (!(wm->ioProc = MMIO_FindProcNode(wm->info.fccIOProc))) {
+	    /* If not found, assume DOS file */
+	    wm->ioProc = &defaultProcs[0];
 	}
 	wm->bTmpIOProc = FALSE;
     }
@@ -1315,7 +1315,7 @@ MMRESULT WINAPI mmioRenameA(LPCSTR szFileName, LPCSTR szNewFileName,
 
     /* Handle any unhandled/error case from above. Assume DOS file */
     if (!lpmmioinfo || (lpmmioinfo->fccIOProc == 0 && lpmmioinfo->pIOProc == NULL && ioProc == NULL))
-	ioProc = MMIO_FindProcNode(FOURCC_DOS);
+	ioProc = &defaultProcs[0];
     /* if just the four character code is present, look up IO proc */
     else if (lpmmioinfo->pIOProc == NULL)
         ioProc = MMIO_FindProcNode(lpmmioinfo->fccIOProc);
-- 
1.7.1


More information about the wine-patches mailing list