user32: fix error setting in FindWindow

Dmitry Timoshkov dmitry at codeweavers.com
Wed Aug 20 22:34:37 CDT 2008


"Louis. Lenders" <xerox_xerox2000 at yahoo.co.uk> wrote:

> @@ -1613,6 +1613,7 @@ HWND WINAPI FindWindowExW( HWND parent, HWND child, LPCWSTR className, LPCWSTR t
>   done:
>      HeapFree( GetProcessHeap(), 0, list );
>      HeapFree( GetProcessHeap(), 0, buffer );
> +    if(!retvalue) SetLastError(ERROR_FILE_NOT_FOUND);
>      return retvalue;
>  }

The prevailing indentation style in this file is to have a space after 'if',
i.e. use 'if (!retvalue)'.
 
>  HWND WINAPI FindWindowA( LPCSTR className, LPCSTR title )
>  {
>      HWND ret = FindWindowExA( 0, 0, className, title );
> -    if (!ret) SetLastError (ERROR_CANNOT_FIND_WND_CLASS);
>      return ret;
>  }

Changing the whole block to just

return FindWindowExA( 0, 0, className, title );

would be more logical.

-- 
Dmitry.



More information about the wine-devel mailing list