winmm: Avoid direct seeking for memory files.

This commit is contained in:
Akihiro Sagawa 2014-06-16 22:48:24 +09:00 committed by Alexandre Julliard
parent c4629e5af5
commit f7ddc1eb95
2 changed files with 4 additions and 13 deletions

View File

@ -871,7 +871,7 @@ LONG WINAPI mmioSeek(HMMIO hmmio, LONG lOffset, INT iOrigin)
return MMSYSERR_INVALHANDLE;
/* not buffered, direct seek on file */
if (!wm->info.pchBuffer)
if (!wm->info.pchBuffer && wm->info.fccIOProc != FOURCC_MEM)
return send_message(wm->ioProc, &wm->info, MMIOM_SEEK, lOffset, iOrigin, FALSE);
switch (iOrigin) {

View File

@ -315,10 +315,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);
@ -531,10 +528,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);
ret = mmioSetBuffer(hmmio, NULL, 0, MMIO_ALLOCBUF);
ok(ret == MMSYSERR_NOERROR, "mmioSetBuffer error %u\n", ret);
@ -554,10 +548,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);
ret = mmioSetBuffer(hmmio, buf, 0, MMIO_ALLOCBUF);
ok(ret == MMSYSERR_NOERROR, "mmioSetBuffer error %u\n", ret);