user32: fix return value in DialogBoxParamA if no resource can befound + simple test

Dmitry Timoshkov dmitry at codeweavers.com
Sun Dec 24 01:54:30 CST 2006


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

> --- a/dlls/user32/dialog.c
> +++ b/dlls/user32/dialog.c
> @@ -800,7 +800,12 @@ INT_PTR WINAPI DialogBoxParamA( HINSTANC
>      HRSRC hrsrc;
>      LPCDLGTEMPLATEA ptr;
>  
> -    if (!(hrsrc = FindResourceA( hInst, name, (LPSTR)RT_DIALOG ))) return 0;
> +    if (!(hrsrc = FindResourceA( hInst, name, (LPSTR)RT_DIALOG )))
> +    {
> +        SetLastError(ERROR_RESOURCE_NAME_NOT_FOUND);
> +        ERR("FindResource %s failed, returning -1\n",debugstr_a(name));
> +        return -1;
> +    }

Most likely the last error should be set by FindResource itself, not a
more high level DialogBoxParam call. If that's not the case it should be
fixed there.

-- 
Dmitry.



More information about the wine-devel mailing list