diff --git a/dlls/winmm/mmio.c b/dlls/winmm/mmio.c index ec282c2dad..c61c99c4d2 100644 --- a/dlls/winmm/mmio.c +++ b/dlls/winmm/mmio.c @@ -896,7 +896,7 @@ LONG WINAPI mmioSeek(HMMIO hmmio, LONG lOffset, INT iOrigin) /* some memory mapped buffers are defined with -1 as a size */ if ((wm->info.cchBuffer > 0) && ((offset < wm->info.lBufOffset) || - (offset >= wm->info.lBufOffset + wm->info.cchBuffer) || + (offset > wm->info.lBufOffset + wm->info.cchBuffer) || (offset > wm->dwFileSize && wm->info.fccIOProc != FOURCC_MEM) || !wm->bBufferLoaded)) { diff --git a/dlls/winmm/tests/mmio.c b/dlls/winmm/tests/mmio.c index be91b414fb..5e440b8890 100644 --- a/dlls/winmm/tests/mmio.c +++ b/dlls/winmm/tests/mmio.c @@ -695,7 +695,16 @@ static void test_mmioSeek(void) if (hmmio != NULL) { /* seek to the end */ end = mmioSeek(hmmio, 0, SEEK_END); - todo_wine ok(end == size, "expected %d, got %d\n", size, end); + ok(end == size, "expected %d, got %d\n", size, end); + + /* test MMIOINFO values */ + res = mmioGetInfo(hmmio, &mmio, 0); + ok(res == MMSYSERR_NOERROR, "expected 0, got %d\n", res); + ok(mmio.pchNext == mmio.pchBuffer + mmio.cchBuffer, "expected %p + %d, got %p\n", mmio.pchBuffer, mmio.cchBuffer, mmio.pchNext); + ok(mmio.pchEndRead == mmio.pchBuffer + mmio.cchBuffer, "expected %p + %d, got %p\n", mmio.pchBuffer, mmio.cchBuffer, mmio.pchEndRead); + ok(mmio.pchEndWrite == mmio.pchBuffer + mmio.cchBuffer, "expected %p + %d, got %p\n", mmio.pchBuffer, mmio.cchBuffer, mmio.pchEndWrite); + ok(mmio.lBufOffset == 0, "expected %d, got %d\n", 0, mmio.lBufOffset); + ok(mmio.lDiskOffset == 0, "expected %d, got %d\n", 0, mmio.lDiskOffset); /* seek backward from the end */ pos = mmioSeek(hmmio, offset, SEEK_END);