[PATCH] user32: Add tests showing that MapWindowPoints, ClientToScreen and ScreenToClient never fail.

Daniel Santos danielfsantos at att.net
Thu Oct 18 14:05:07 CDT 2012


On 10/16/2012 01:12 PM, Christian Costa wrote:
> +    /* Choose point inside the client area */
> +    point.x = rect.right / 2 - 50;
> +    point.y = rect.bottom / 2 - 50;
> +    ret = ScreenToClient(wnd, &point);
> +    ok(ret, "ScreenToClient failed with %#x\n", GetLastError());
> +    ret = MapWindowPoints(NULL, wnd, &point, 1);
> +    ok(ret, "MapWindowPoints failed with %#x\n", GetLastError());
> +
> +    /* Choose point outside the client area */
> +    point.x = rect.right / 2 + 50;
> +    point.y = rect.bottom / 2 + 50;
> +    ret = ScreenToClient(wnd, &point);
> +    ok(ret, "ScreenToClient failed with %#x\n", GetLastError());
> +    ret = MapWindowPoints(NULL, wnd, &point, 1);
> +    ok(ret, "MapWindowPoints failed with %#x\n", GetLastError());
When I do these tests, I like throwing every stupid thing I can possibly
come up with (and I'm gifted and coming up with stupid things) but
always get shot down because I can't produce an example of a real-world
app doing it.  So here's one from LoTRO:

8.385:0009:Call user32.ScreenToClient(00000000,0033fd68) ret=006d4d87

And if you don't return zero when it does this, the game crashes
resulting in my in-box filling up from desperate game addicts posting to
appdb.

So if you can please include the below in your patch, I can omit it from
mine (see http://bugs.winehq.org/show_bug.cgi?id=31979) and thank you!

+    /* LoTRO will do this and crash if we don't return zero, precious indeed! */
+    ret = ScreenToClient( NULL, &point );
+    ok(!ret, "ScreenToClient didn't fail as expected (got %d)\n", ret);

Daniel



More information about the wine-patches mailing list