winmm: Only compute dwFileSize for MMIO objects with a DOS ioproc.
This commit is contained in:
parent
0f234ce461
commit
258d42982c
|
@ -667,7 +667,13 @@ 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 */
|
||||||
if ((pos = _llseek((HFILE)wm->info.adwInfo[0], 0, SEEK_CUR)) != -1)
|
/* FIXME: the code around dwFileSize is:
|
||||||
|
* - probably broken
|
||||||
|
* - needs to be tested when the app installs its own IOproc
|
||||||
|
* - likely to be removed
|
||||||
|
* So, restrict dwFileSize usage to DOS ioprocs
|
||||||
|
*/
|
||||||
|
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);
|
wm->dwFileSize = _llseek((HFILE)wm->info.adwInfo[0], 0, SEEK_END);
|
||||||
_llseek((HFILE)wm->info.adwInfo[0], pos, SEEK_SET);
|
_llseek((HFILE)wm->info.adwInfo[0], pos, SEEK_SET);
|
||||||
|
|
Loading…
Reference in New Issue