[PATCH 2/3] winmm: Fix logic errors and omissions.

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


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.

 Jörg Höhle

More information about the wine-patches mailing list