Hi Stefan sorry for the duplicate email. I forgot to also send it to wine-devel.
On Fri, Jun 17, 2011 at 12:02 AM, Stefan Dösinger
<stefandoesinger(a)gmx.at> wrote:
> On Thursday 16 June 2011 10:49:19 Michael Mc Donnell wrote:
>> I've added the test you outlined. It shows you're correct that
>> GetDeclaration only writes up to D3DDECL_END(). I've changed the
>> implementation so that it caches the number of elements and only
>> writes up to D3DDECL_END().
> Looks good to me.
Great!
>> You're right it could potentially read undefined memory depending on
>> the compiler semantics. I think the safest thing is just to read up to
>> D3DDECL_END() in the passed in declaration, then it will never read
>> undefined memory (except if the programmer makes a mistake).
> Looks good, but please write a WARN message in every case where you return an
> error to the application. We believe that we handled the error condition
> correctly, so there's no need for a FIXME, but the broken app behavior may
> have been triggered by some other problem in Wine, so the message is more
> important than a simple TRACE.
Ok I've added WARN message for every case where it returns an error to
the application. I've also reworded the WARN where it uses an invalid
declaration but still must return D3D_OK.