[PATCH] user32: Fix error handling in MapWindowPoints, ClientToScreen and ScreenToClient and add tests for them. (try 3)

Dmitry Timoshkov dmitry at baikal.ru
Tue Oct 23 21:54:52 CDT 2012


Christian Costa <titan.costa at gmail.com> wrote:

>  BOOL WINAPI ClientToScreen( HWND hwnd, LPPOINT lppnt )
>  {
> +    DWORD error = GetLastError();
> +
> +    if (!hwnd)
> +    {
> +        SetLastError( ERROR_INVALID_WINDOW_HANDLE );
> +        return FALSE;
> +    }
> +
> +    SetLastError( 0xdeadbeef );
>      MapWindowPoints( hwnd, 0, lppnt, 1 );
> +
> +    if (GetLastError() != 0xdeadbeef)
> +        return FALSE;
> +
> +    SetLastError(error);
>      return TRUE;
>  }

As been said before these games with saving/restoring last error value
are broken.

-- 
Dmitry.



More information about the wine-devel mailing list