winmm: Memory file buffer is available even if we just allocate memory.

This commit is contained in:
Akihiro Sagawa 2014-06-16 22:48:23 +09:00 committed by Alexandre Julliard
parent 09a1f81cb4
commit c4629e5af5
2 changed files with 5 additions and 20 deletions

View File

@ -574,7 +574,7 @@ static MMRESULT MMIO_SetBuffer(WINE_MMIO* wm, void* pchBuffer, LONG cchBuffer,
wm->info.pchEndRead = wm->info.pchBuffer;
wm->info.pchEndWrite = wm->info.pchBuffer + cchBuffer;
wm->info.lBufOffset = wm->info.lDiskOffset;
wm->bBufferLoaded = FALSE;
wm->bBufferLoaded = (wm->info.fccIOProc == FOURCC_MEM);
return MMSYSERR_NOERROR;
}
@ -660,9 +660,6 @@ static HMMIO MMIO_Open(LPSTR szFileName, MMIOINFO* refmminfo, DWORD dwOpenFlags,
goto error1;
}
if (wm->info.fccIOProc == FOURCC_MEM && !(wm->info.dwFlags & MMIO_ALLOCBUF))
wm->bBufferLoaded = TRUE;
/* see mmioDosIOProc for that one */
memcpy( wm->info.adwInfo, refmminfo->adwInfo, sizeof(wm->info.adwInfo) );

View File

@ -347,10 +347,7 @@ static void test_mmioOpen(char *fname)
ok(mmio.lDiskOffset == 0, "expected 0, got %d\n", mmio.lDiskOffset);
ret = mmioSeek(hmmio, 0, SEEK_CUR);
if (fname)
ok(ret == 0, "expected 0, got %d\n", ret);
else
todo_wine ok(ret == 0, "expected 0, got %d\n", ret);
ok(ret == 0, "expected 0, got %d\n", ret);
mmioClose(hmmio, 0);
@ -408,10 +405,7 @@ static void test_mmioOpen(char *fname)
ok(mmio.lDiskOffset == 0, "expected 0, got %d\n", mmio.lDiskOffset);
ret = mmioSeek(hmmio, 0, SEEK_CUR);
if (fname)
ok(ret == 0, "expected 0, got %d\n", ret);
else
todo_wine ok(ret == 0, "expected 0, got %d\n", ret);
ok(ret == 0, "expected 0, got %d\n", ret);
mmioClose(hmmio, 0);
@ -440,10 +434,7 @@ static void test_mmioOpen(char *fname)
ok(mmio.lDiskOffset == 0, "expected 0, got %d\n", mmio.lDiskOffset);
ret = mmioSeek(hmmio, 0, SEEK_CUR);
if (fname)
ok(ret == 0, "expected 0, got %d\n", ret);
else
todo_wine ok(ret == 0, "expected 0, got %d\n", ret);
ok(ret == 0, "expected 0, got %d\n", ret);
mmioClose(hmmio, 0);
@ -607,10 +598,7 @@ static void test_mmioSetBuffer(char *fname)
ok(mmio.lDiskOffset == 0, "expected 0, got %d\n", mmio.lDiskOffset);
ret = mmioSeek(hmmio, 0, SEEK_CUR);
if (fname)
ok(ret == 0, "expected 0, got %d\n", ret);
else
todo_wine ok(ret == 0, "expected 0, got %d\n", ret);
ok(ret == 0, "expected 0, got %d\n", ret);
mmioClose(hmmio, 0);
}