[4/4] ddraw: Size handling fixes for IDirect3DDevice::GetDesc

Henri Verbeet hverbeet at gmail.com
Tue Nov 15 08:19:30 CST 2011


On 15 November 2011 00:13, Stefan Dösinger <stefan at codeweavers.com> wrote:
> +    if (!HWDesc)
> +    {
> +        WARN("HWDesc is NULL, returning DDERR_INVALIDPARAMS.\n");
> +        return DDERR_INVALIDPARAMS;
> +    }
> +    else if(!check_d3ddevicedesc_size(HWDesc->dwSize))
> +    {
> +        WARN("HWDesc->dwSize is %u, returning DDERR_INVALIDPARAMS.\n", HWDesc->dwSize);
> +        return DDERR_INVALIDPARAMS;
> +    }
> +    else if (!HelDesc)
> +    {
> +        WARN("HelDesc is NULL, returning DDERR_INVALIDPARAMS.\n");
> +        return DDERR_INVALIDPARAMS;
> +    }
> +    else if(!check_d3ddevicedesc_size(HelDesc->dwSize))
> +    {
> +        WARN("HelDesc->dwSize is %u, returning DDERR_INVALIDPARAMS.\n", HelDesc->dwSize);
> +        return DDERR_INVALIDPARAMS;
> +    }
The "else" is redundant here. Please use consistent formatting.

> +    hw_caps.dwSize = sizeof(hel_caps) + 1;
Strictly speaking that should be "sizeof(hw_caps) + 1".

> +            case 172: /* DirectX 3, IDirect3DDevice1 */
> +                ok(hw_caps.dwMaxTextureRepeat == 0xfefefefe, "dwMaxTextureRepeat was modified: %#x.\n",
> +                        hw_caps.dwMaxTextureRepeat);
> +                ok(hel_caps.dwMaxTextureRepeat == 0xfefefefe, "dwMaxTextureRepeat was modified: %#x.\n",
> +                        hel_caps.dwMaxTextureRepeat);
> +                /* drop through */
> +            case 204:   /* DirectX 5, IDirect3DDevice2 */
> +                ok(hw_caps.dwMaxTextureRepeat == 0xfefefefe, "dwMaxTextureRepeat was modified: %#x.\n",
> +                        hw_caps.dwMaxTextureRepeat);
> +                ok(hel_caps.dwMaxTextureRepeat == 0xfefefefe, "dwMaxTextureRepeat was modified: %#x.\n",
> +                        hel_caps.dwMaxTextureRepeat);
This doesn't make a lot of sense, both cases are the same.



More information about the wine-devel mailing list