winmm: Fix SEEK_END direction of mmio files without buffering.

This commit is contained in:
Akihiro Sagawa 2012-11-13 00:26:45 +09:00 committed by Alexandre Julliard
parent 10c7f5859c
commit 2d3f320463
2 changed files with 5 additions and 2 deletions

View File

@ -127,7 +127,10 @@ static LRESULT CALLBACK mmioDosIOProc(LPMMIOINFO lpmmioinfo, UINT uMessage,
* lParam2 = from whence to seek (SEEK_SET, SEEK_CUR, SEEK_END)
* 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)
lpmmioinfo->lDiskOffset = ret;
return ret;

View File

@ -750,7 +750,7 @@ static void test_mmioSeek(void)
/* seek backward from the 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);
}