Mouse-buttons swapped after winetest

Saulius Krasuckas saulius2 at ar.fi.lt
Fri Jun 24 10:44:16 CDT 2005


* On Tue, 21 Jun 2005, Paul Vriens wrote:
> * On Tue, 2005-06-21 at 21:45, Paul Vriens wrote:
> > 
> > with the latest winetest
> > http://www.astro.gla.ac.uk/users/paulm/WRT/CrossBuilt/winetest-200506211000-paul-mingw.exe
> > 
> > my mouse-buttons (left and right) are swapped after the test.
  ...
> sysparams.c:1005:testing SPI_{GET,SET}MOUSEBUTTONSWAP
> sysparams.c:171:SPI_{GET,SET}MOUSEBUTTONSWAP not supported on this platform. Skipping test

IMHO the bug is caused by a patch of Vitaly Lipatov [1], which by itself 
showed up a bug, caused by a combined patch from you, Paul, and Justin 
Chevrier [2].

Following [1]:

| @@ -1010,7 +1010,7 @@ static void test_SPI_SETMOUSEBUTTONSWAP(
|          SetLastError(0xdeadbeef);
|          rc=SystemParametersInfoA( SPI_SETMOUSEBUTTONSWAP, vals[i], 0,
|                                    SPIF_UPDATEINIFILE | SPIF_SENDCHANGE );
| -        if (!test_error_msg(rc,"SPI_{GET,SET}MOUSEBUTTONSWAP"))
| +        if (!test_error_msg(rc!=vals[i],"SPI_{GET,SET}MOUSEBUTTONSWAP"))
|              return;
  ...
| @@ -1023,7 +1023,7 @@ static void test_SPI_SETMOUSEBUTTONSWAP(
|  
|      rc=SystemParametersInfoA( SPI_SETMOUSEBUTTONSWAP, old_b, 0,
|                                SPIF_UPDATEINIFILE );
| -    ok(rc!=0,"***warning*** failed to restore the original value: rc=%d err=%ld\n",rc,GetLastError());
| +    ok(!rc,"***warning*** failed to restore the original value: rc=%d err=%ld\n",rc,GetLastError());
 
Such checks doesn't work on winME.  I have reverted them and tests is 
doing fine.  Further, following [2]:

| @@ -955,9 +1007,12 @@ static void test_SPI_SETMOUSEBUTTONSWAP(
|  
|      for (i=0;i<sizeof(vals)/sizeof(*vals);i++)
|      {
| +        SetLastError(0xdeadbeef);
|          rc=SystemParametersInfoA( SPI_SETMOUSEBUTTONSWAP, vals[i], 0,
|                                    SPIF_UPDATEINIFILE | SPIF_SENDCHANGE );
| -        ok(rc!=0,"%d: rc=%d err=%ld\n",i,rc,GetLastError());
| +        if (!test_error_msg(rc,"SPI_{GET,SET}MOUSEBUTTONSWAP"))
| +            return;

This wrong, IMHO, as the "return" statement eliminates a possibility to 
restore SM_SWAPBUTTON metrics after the for-loop ends.  I would use 
"break" or "continue" here.

Then would be nice to print "err" in following format "err=%0x%08lx" or 
such after a restoration.  Any more ideas?


[1] http://www.winehq.org/hypermail/wine-cvs/2005/06/0474.html
    http://cvs.winehq.org/cvsweb/wine/dlls/user/tests/sysparams.c.diff?r1=1.37&r2=1.38
[2] http://www.winehq.org/hypermail/wine-cvs/2005/03/0110.html
    http://cvs.winehq.org/cvsweb/wine/dlls/user/tests/sysparams.c.diff?r1=1.34&r2=1.35



More information about the wine-devel mailing list