winmm: MMIO_ALLOCBUF is ignored if mmioOpen gets a valid buffer.
authorDmitry Timoshkov <dmitry@codeweavers.com>
Tue, 21 Oct 2008 10:27:16 +0000 (19:27 +0900)
committerAlexandre Julliard <julliard@winehq.org>
Tue, 21 Oct 2008 11:22:51 +0000 (13:22 +0200)
Existing tests show that MMIO_ALLOCBUF flag is dropped if a valid buffer
is being passed to mmioOpen, that means the buffer is valid in that case.

dlls/winmm/mmio.c

index 60b6d0f..a750bf2 100644 (file)
@@ -667,10 +667,11 @@ HMMIO MMIO_Open(LPSTR szFileName, MMIOINFO* refmminfo, DWORD dwOpenFlags,
         refmminfo->wErrorRet = MMIO_SetBuffer(wm, refmminfo->pchBuffer, refmminfo->cchBuffer, 0);
        if (refmminfo->wErrorRet != MMSYSERR_NOERROR)
            goto error1;
-       if (wm->info.fccIOProc == FOURCC_MEM)
-           wm->bBufferLoaded = TRUE;
     }
 
+    if (wm->info.fccIOProc == FOURCC_MEM && !(wm->info.dwFlags & MMIO_ALLOCBUF))
+        wm->bBufferLoaded = TRUE;
+
     /* see mmioDosIOProc for that one */
     wm->info.adwInfo[0] = refmminfo->adwInfo[0];