[PATCH 2/3] winmm: Fix logic errors and omissions (incl. patch)

Joerg-Cyril.Hoehle at t-systems.com Joerg-Cyril.Hoehle at t-systems.com
Wed Aug 3 07:42:41 CDT 2011


Hi,

here are tiny fixes to the recently introduced big 100KB winmm patch.
Each one restores behaviour that was found in the old winmm, so I
don't expect regressions here, so IMHO there's little reason to split.
Of course, no submitter ever expects regressions, doesn't s/he? :-)

- Don't bypass DriverCallback, like I recently noticed in wine-devel
  The result is similar to my patches from March.

- boolean logic error involving negation ! && ||

- if(wait == 1 - WAIT_OBJECT_0) should be WAIT_OBJECT_0 + 1 (same by chance)
  Same with if(wait == g_devhandle_count - WAIT_OBJECT_0)
Note that my patch still assumes WAIT_OBJECT_0==0, otherwise an additional check
&& wait >= WAIT_OBJECT_0 would be needed, which gcc would complain about.

- The caller of WINMM_BeginPlaying supplying the device argument will
  have locked it already, thus Enter/LeaveCS therein is superfluous.
  Generally, functions that take a WINMM_Device* parameter should
  receive it locked by the caller.

- WINMM_CheckCallback had been lost in wave*Open!

- WINMM_StartDevicesThread does not return a hr and was redundant.
  The correct call is a few lines above.

Regards,
 Jörg Höhle
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-winmm-Fix-logic-errors-and-omissions.patch
Type: application/octet-stream
Size: 7551 bytes
Desc: 0003-winmm-Fix-logic-errors-and-omissions.patch
URL: <http://www.winehq.org/pipermail/wine-patches/attachments/20110803/898f2065/attachment.obj>


More information about the wine-patches mailing list