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

Christian Costa titan.costa at gmail.com
Mon Oct 22 13:58:31 CDT 2012


Le 22/10/2012 20:35, Alexandre Julliard a écrit :
> Christian Costa <titan.costa at gmail.com> writes:
>
>> @@ -236,20 +236,32 @@ BOOL WINAPI GetClientRect( HWND hwnd, LPRECT rect )
>>   
>>   
>>   /*******************************************************************
>> - *		ClientToScreen (USER32.@)
>> + *             ClientToScreen (USER32.@)
>>    */
>>   BOOL WINAPI ClientToScreen( HWND hwnd, LPPOINT lppnt )
>>   {
>> +    if (!IsWindow( hwnd ))
>> +    {
>> +        SetLastError( ERROR_INVALID_WINDOW_HANDLE );
>> +        return FALSE;
>> +    }
>> +
> You should never use IsWindow(). Handles should be checked at the point
> where they are used.
>
So I have to rely on GetLastError() as I did in my revious patch. Correct?
Same for MapWindowPoints. Should I modify WINPOS_GetWinOffset instead?



More information about the wine-devel mailing list