winmm: fix WOD_Open() WAVE_MAPPER no-device case.

Fabrice Bauzac libnoon at gmail.com
Mon Aug 19 22:57:34 CDT 2013


Hello,

This patch intends to fix the bug:
http://bugs.winehq.org/show_bug.cgi?id=34305

The bug: basically, when there is no sound device and the user tries
to WOD_Open() the WAVE_MAPPER pseudodevice, the code calls read_map()
with device index 0 without first checking whether the number of
devices is greater than 0.

The patch checks the number of devices and if there is none, returns
MMSYSERR_BADDEVICEID.

I'm not sure whether this is the most appropriate errorcode.  According to
http://msdn.microsoft.com/en-us/library/windows/desktop/dd743866(v=vs.85).aspx
the MMSYSERR_NODRIVER errorcode could also be appropriate.

I have checked the patch on the bugging application and it fixes the crash.

Thanks!

Best regards
Fabrice
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-winmm-fix-WOD_Open-WAVE_MAPPER-no-device-case.patch
Type: application/octet-stream
Size: 945 bytes
Desc: not available
URL: <http://www.winehq.org/pipermail/wine-patches/attachments/20130820/13f1095e/attachment.obj>


More information about the wine-patches mailing list