Commit f7ddc1eb authored by Akihiro Sagawa's avatar Akihiro Sagawa Committed by Alexandre Julliard

winmm: Avoid direct seeking for memory files.

parent c4629e5a
......@@ -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) {
......
......@@ -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);
......
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