winmm: Correctly calculate dwFileSize for apps installing their own IOproc.
This commit is contained in:
parent
c5e88a3a69
commit
d650316661
|
@ -667,16 +667,11 @@ static HMMIO MMIO_Open(LPSTR szFileName, MMIOINFO* refmminfo, DWORD dwOpenFlags,
|
||||||
(LPARAM)szFileName, 0, FALSE);
|
(LPARAM)szFileName, 0, FALSE);
|
||||||
|
|
||||||
/* grab file size, when possible */
|
/* grab file size, when possible */
|
||||||
/* FIXME: the code around dwFileSize is:
|
if (wm->info.fccIOProc != FOURCC_MEM && (send_message(wm->ioProc, &wm->info, MMIOM_SEEK, 0, SEEK_CUR, FALSE)) != -1) {
|
||||||
* - probably broken
|
pos = wm->info.lDiskOffset;
|
||||||
* - needs to be tested when the app installs its own IOproc
|
send_message(wm->ioProc, &wm->info, MMIOM_SEEK, 0, SEEK_END, FALSE);
|
||||||
* - likely to be removed
|
wm->dwFileSize = wm->info.lDiskOffset;
|
||||||
* So, restrict dwFileSize usage to DOS ioprocs
|
send_message(wm->ioProc, &wm->info, MMIOM_SEEK, pos, SEEK_SET, FALSE);
|
||||||
*/
|
|
||||||
if (wm->info.fccIOProc == FOURCC_DOS && (pos = _llseek((HFILE)wm->info.adwInfo[0], 0, SEEK_CUR)) != -1)
|
|
||||||
{
|
|
||||||
wm->dwFileSize = _llseek((HFILE)wm->info.adwInfo[0], 0, SEEK_END);
|
|
||||||
_llseek((HFILE)wm->info.adwInfo[0], pos, SEEK_SET);
|
|
||||||
}
|
}
|
||||||
else wm->dwFileSize = 0;
|
else wm->dwFileSize = 0;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue