https://bugs.winehq.org/show_bug.cgi?id=46513
Bug ID: 46513 Summary: MCI_Open handling of filenames passed with MCI_OPEN_TYPE is insufficient (3D Pinball Space Cadet) Product: Wine Version: 4.0-rc7 Hardware: x86 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: winmm&mci Assignee: wine-bugs@winehq.org Reporter: wenger.quentin@bluewin.ch Distribution: ---
Created attachment 63364 --> https://bugs.winehq.org/attachment.cgi?id=63364 Patch checking for a dot in lpstrDeviceType and switching to MCI_OPEN_ELEMENT accordingly.
I stumbled upon the error
fixme:mci:MCI_LoadMciDriver Couldn't load driver for type L"PINBALL.MID"
(as reported in the "Additional Comments" on https://appdb.winehq.org/objectManager.php?sClass=version&iId=1673&i...) while playing with 3D Pinball Space Cadet. This error prevents the MIDI background music of the game from playing.
For reference, aplaymidi and the testing mcishell (wintest.exe) both play the file without problems.
I tracked down this error to the function MCI_Open receiving MCI_OPEN_TYPE and the string "pinball.mid" as lpstrDeviceType, instead of MCI_OPEN_ELEMENT and the string in lpstrElementName.
While this may seem like a bug in Pinball, the function MCI_Open actually already applies some check for this situation (see the comment in lines 1763-1766 of mci.c). However, the check is based on some '!' character present in the string, which does not cover Pinball's case.
I did create a patch for my own needs, see attachment.
Please note that I provide no guarantee about the scope accuracy of this patch - it does solve the problem, but maybe checking for the presence of a dot in the string is too broad and creates bug with other programs...
Assuming that the logic of the patch is good, it may also be wanted to merge/simplify/rewrite the checks somewhat, eg. merging the ERR(...), etc.
https://bugs.winehq.org/show_bug.cgi?id=46513
--- Comment #1 from Quentin Wenger wenger.quentin@bluewin.ch --- Note: I can't explain the "everything working" on https://appdb.winehq.org/objectManager.php?sClass=version&iId=1673&i... from "llde" (Arch Linux x86_64, Wine 2.21-staging).
For reference, I'm using the same distro.
Maybe a small change in Pinball itself? That game has been shipped in several versions of Windows...
Or a change in Wine's WinMM from 2.21, but I couldn't find evidence for such a change (and earlier versions were mentioned not to work)...
https://bugs.winehq.org/show_bug.cgi?id=46513
Alistair Leslie-Hughes leslie_alistair@hotmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |patch
https://bugs.winehq.org/show_bug.cgi?id=46513
Parker parker.l.reed@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |parker.l.reed@gmail.com
--- Comment #2 from Parker parker.l.reed@gmail.com --- I can confirm the patch still works (and is needed) on current wine release and master.
Only change needed was to match the same chr type as the function above it
} else { ptr = wcschr(strDevTyp, '.');
https://bugs.winehq.org/show_bug.cgi?id=46513
Alistair Leslie-Hughes leslie_alistair@hotmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |leslie_alistair@hotmail.com