http://bugs.winehq.org/show_bug.cgi?id=9551
--- Comment #6 from Stefan Dösinger stefandoesinger@gmx.at 2007-09-03 04:14:24 --- The problem is that Microsoft violates its own COM rules in Direct3D. The application creates a vertex buffer, sets it(SetStreamSource), then releases it. The SetStreamSource does not increase the reference count visible to the app, so the release() is supposed to destroy the buffer. Then the stateblock contains a pointer to a destroyed buffer and the device crashes when trying to render from it.
However, as a test prooves, the buffer is not destroyed, although its reference count is 0. A buffer that is set in a stateblock is prevented from beeing destroyed as long as it's set in the stateblock and the stateblock is valid. We increate/decrease the WineD3D reference count to achieve that. The app does not see the wined3d refcount because it only talks to d3d9.dll, which in turn uses wined3d, so we have exactly the behavior windows has.