Commit 2d3f3204 authored by Akihiro Sagawa's avatar Akihiro Sagawa Committed by Alexandre Julliard

winmm: Fix SEEK_END direction of mmio files without buffering.

parent 10c7f585
...@@ -127,7 +127,10 @@ static LRESULT CALLBACK mmioDosIOProc(LPMMIOINFO lpmmioinfo, UINT uMessage, ...@@ -127,7 +127,10 @@ static LRESULT CALLBACK mmioDosIOProc(LPMMIOINFO lpmmioinfo, UINT uMessage,
* lParam2 = from whence to seek (SEEK_SET, SEEK_CUR, SEEK_END) * lParam2 = from whence to seek (SEEK_SET, SEEK_CUR, SEEK_END)
* Returns: new file position, -1 on error * Returns: new file position, -1 on error
*/ */
ret = _llseek((HFILE)lpmmioinfo->adwInfo[0], (LONG)lParam1, (LONG)lParam2); if (lParam2 == SEEK_END)
ret = _llseek((HFILE)lpmmioinfo->adwInfo[0], -(LONG)lParam1, (LONG)lParam2);
else
ret = _llseek((HFILE)lpmmioinfo->adwInfo[0], (LONG)lParam1, (LONG)lParam2);
if (ret != -1) if (ret != -1)
lpmmioinfo->lDiskOffset = ret; lpmmioinfo->lDiskOffset = ret;
return ret; return ret;
......
...@@ -750,7 +750,7 @@ static void test_mmioSeek(void) ...@@ -750,7 +750,7 @@ static void test_mmioSeek(void)
/* seek backward from the end */ /* seek backward from the end */
pos = mmioSeek(hmmio, offset, SEEK_END); pos = mmioSeek(hmmio, offset, SEEK_END);
todo_wine ok(pos == size-offset, "expected %d, got %d\n", size-offset, pos); ok(pos == size-offset, "expected %d, got %d\n", size-offset, pos);
mmioClose(hmmio, 0); mmioClose(hmmio, 0);
} }
......
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