[Bug 60529] New: winmm: waveOutGetVolume fails with MMSYSERR_INVALHANDLE when given a device ID (MTGO plays no sound)
http://bugs.winehq.org/show_bug.cgi?id=60529 Bug ID: 60529 Summary: winmm: waveOutGetVolume fails with MMSYSERR_INVALHANDLE when given a device ID (MTGO plays no sound) Product: Wine Version: unspecified Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: winmm&mci Assignee: wine-bugs@list.winehq.org Reporter: silinarii@gmail.com Target Milestone: --- Distribution: --- Version: 11.19 (also current master) On Windows, the first parameter of waveOutGetVolume() may be either an open HWAVEOUT or a device identifier ("hwo: Handle to an open waveform-audio output device. This parameter can also be a device identifier." per MSDN). Calling waveOutGetVolume(0, &vol) therefore returns MMSYSERR_NOERROR and the volume of device 0. In Wine, dlls/winmm/waveform.c only accepts handles: WINMM_GetDeviceFromHWAVE() fails for a device ID, so the call returns MMSYSERR_INVALHANDLE and leaves the output untouched. Impact: Magic: The Gathering Online reads the "Windows volume" with waveOutGetVolume(IntPtr.Zero, out vol), ignores the return code and treats the untouched value as 0, so it skips every sound before playing it. Any program using this common idiom gets no volume (or, if it uses the value, silence). waveOutSetVolume() very likely has the same problem with device IDs. Steps to reproduce: 1. Call waveOutGetVolume((HWAVEOUT)0, &vol) without opening a device. 2. Windows: returns 0 (MMSYSERR_NOERROR) with the device volume. Wine: returns 5 (MMSYSERR_INVALHANDLE). Observed with WINEDEBUG=+relay on MTGO: Call winmm.waveOutGetVolume(00000000,...) Ret winmm.waveOutGetVolume() retval=00000005 Expected: device IDs below waveOutGetNumDevs() are accepted (Wine's own HWAVE values have high bits set, so they don't collide). Note: this was found while debugging MTGO with the help of an AI assistant. No code is attached; the description above is the whole report. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
participants (1)
-
WineHQ Bugzilla