Commit 71b8a56c authored by Akihiro Sagawa's avatar Akihiro Sagawa Committed by Alexandre Julliard

winmm: Update lBufOffset after seeking file directly.

parent f7ddc1eb
......@@ -871,8 +871,12 @@ LONG WINAPI mmioSeek(HMMIO hmmio, LONG lOffset, INT iOrigin)
return MMSYSERR_INVALHANDLE;
/* not buffered, direct seek on file */
if (!wm->info.pchBuffer && wm->info.fccIOProc != FOURCC_MEM)
return send_message(wm->ioProc, &wm->info, MMIOM_SEEK, lOffset, iOrigin, FALSE);
if (!wm->info.pchBuffer && wm->info.fccIOProc != FOURCC_MEM) {
LRESULT ret = send_message(wm->ioProc, &wm->info, MMIOM_SEEK, lOffset, iOrigin, FALSE);
if (ret != -1)
wm->info.lBufOffset = wm->info.lDiskOffset;
return ret;
}
switch (iOrigin) {
case SEEK_SET:
......
......@@ -725,7 +725,7 @@ static void test_mmioSeek(void)
ok(mmio.pchNext == mmio.pchBuffer, "expected %p, got %p\n", mmio.pchBuffer, mmio.pchNext);
ok(mmio.pchEndRead == mmio.pchBuffer, "expected %p, got %p\n", mmio.pchBuffer, mmio.pchEndRead);
ok(mmio.pchEndWrite == mmio.pchBuffer + mmio.cchBuffer, "expected %p + %d, got %p\n", mmio.pchBuffer, mmio.cchBuffer, mmio.pchEndWrite);
todo_wine ok(mmio.lBufOffset == size, "expected %d, got %d\n", size, mmio.lBufOffset);
ok(mmio.lBufOffset == size, "expected %d, got %d\n", size, mmio.lBufOffset);
ok(mmio.lDiskOffset == size, "expected %d, got %d\n", size, mmio.lDiskOffset);
/* seek backward from the end */
......
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