Commit 5d24cb45 authored by Dmitry Timoshkov's avatar Dmitry Timoshkov Committed by Alexandre Julliard

winmm: The buffer provided by an application is valid only in the mmioOpen(FOURCC_MEM) case.

parent fec569cf
...@@ -570,11 +570,8 @@ static MMRESULT MMIO_SetBuffer(WINE_MMIO* wm, void* pchBuffer, LONG cchBuffer, ...@@ -570,11 +570,8 @@ static MMRESULT MMIO_SetBuffer(WINE_MMIO* wm, void* pchBuffer, LONG cchBuffer,
wm->info.dwFlags &= ~MMIO_ALLOCBUF; wm->info.dwFlags &= ~MMIO_ALLOCBUF;
} }
wm->bBufferLoaded = FALSE;
if (pchBuffer) { if (pchBuffer) {
wm->info.pchBuffer = pchBuffer; wm->info.pchBuffer = pchBuffer;
wm->bBufferLoaded = TRUE;
} else if (cchBuffer) { } else if (cchBuffer) {
if (!(wm->info.pchBuffer = HeapAlloc(GetProcessHeap(), 0, cchBuffer))) if (!(wm->info.pchBuffer = HeapAlloc(GetProcessHeap(), 0, cchBuffer)))
return MMIOERR_OUTOFMEMORY; return MMIOERR_OUTOFMEMORY;
...@@ -588,6 +585,7 @@ static MMRESULT MMIO_SetBuffer(WINE_MMIO* wm, void* pchBuffer, LONG cchBuffer, ...@@ -588,6 +585,7 @@ static MMRESULT MMIO_SetBuffer(WINE_MMIO* wm, void* pchBuffer, LONG cchBuffer,
wm->info.pchEndRead = wm->info.pchBuffer; wm->info.pchEndRead = wm->info.pchBuffer;
wm->info.pchEndWrite = wm->info.pchBuffer + cchBuffer; wm->info.pchEndWrite = wm->info.pchBuffer + cchBuffer;
wm->info.lBufOffset = wm->info.lDiskOffset; wm->info.lBufOffset = wm->info.lDiskOffset;
wm->bBufferLoaded = FALSE;
return MMSYSERR_NOERROR; return MMSYSERR_NOERROR;
} }
...@@ -669,6 +667,8 @@ HMMIO MMIO_Open(LPSTR szFileName, MMIOINFO* refmminfo, DWORD dwOpenFlags, ...@@ -669,6 +667,8 @@ HMMIO MMIO_Open(LPSTR szFileName, MMIOINFO* refmminfo, DWORD dwOpenFlags,
refmminfo->wErrorRet = MMIO_SetBuffer(wm, refmminfo->pchBuffer, refmminfo->cchBuffer, 0); refmminfo->wErrorRet = MMIO_SetBuffer(wm, refmminfo->pchBuffer, refmminfo->cchBuffer, 0);
if (refmminfo->wErrorRet != MMSYSERR_NOERROR) if (refmminfo->wErrorRet != MMSYSERR_NOERROR)
goto error1; goto error1;
if (wm->info.fccIOProc == FOURCC_MEM)
wm->bBufferLoaded = TRUE;
} }
/* see mmioDosIOProc for that one */ /* see mmioDosIOProc for that one */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment