Commit 258d4298 authored by Eric Pouech's avatar Eric Pouech Committed by Alexandre Julliard

winmm: Only compute dwFileSize for MMIO objects with a DOS ioproc.

parent 0f234ce4
......@@ -667,7 +667,13 @@ static HMMIO MMIO_Open(LPSTR szFileName, MMIOINFO* refmminfo, DWORD dwOpenFlags,
(LPARAM)szFileName, 0, FALSE);
/* 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);
_llseek((HFILE)wm->info.adwInfo[0], pos, SEEK_SET);
......
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