(try2)[PATCH 3/4] d3d10: Implement ID3DEffectVariable::GetInputSignatureElementDesc().

Henri Verbeet hverbeet at gmail.com
Wed Apr 7 14:50:53 CDT 2010


2010/4/7 Rico Schüller <kgbricola at web.de>:
> +    /* Check desc for NULL, this crashes on W7/DX10 */
> +    if (!desc)
> +    {
> +        WARN("This should crash on W7/DX10!\n");
> +        return E_FAIL;
> +    }
It's perfectly fine to require a parameter to be non-NULL, and just
crash if it isn't. You'll get a nice backtrace, or at least an
exception, which helps debugging as well.

> +    /* Check shader_index, this crashes on W7/DX10 */
> +    if (shader_index >= This->effect->used_shader_count)
> +    {
> +        WARN("This should crash on W7/DX10!\n");
> +        return E_FAIL;
> +    }
Similar as above. In general if Windows doesn't check something, we
don't either. However, it's worth noting that if we'd be writing to
that index we sometimes do check those, because there's the potential
for memory corruption in those cases.



More information about the wine-devel mailing list