I ran all of the d3d9 tests and did not get any errors with my patch applied. I did get an error when I ran your modified visual.c test, but I get the same errors with and without my patch.
Test before patch:
fixme:d3d:IWineD3DDeviceImpl_GetAvailableTextureMem (0x167ec8) : stub, simulating 64MB for now, returning 64MB leftTest after patch:
visual.c:191: Test failed: IDirect3DDevice9_ColorFill failed with 88760096
visual.c:212: Test failed: IDirect3DDevice9_SetCursorProperties failed with 8876086c
visual: 26 tests executed (0 marked as todo, 2 failures), 0 skipped.
fixme:d3d:IWineD3DDeviceImpl_GetAvailableTextureMem (0x167ec8) : stub, simulating 64MB for now, returning 64MB left
visual.c:191: Test failed: IDirect3DDevice9_ColorFill failed with 88760096
visual.c:212: Test failed: IDirect3DDevice9_SetCursorProperties failed with 8876086c
visual: 26 tests executed (0 marked as todo, 2 failures), 0 skipped.
> The API documentation doesn't say anything about an application releasing
> the d3d surface,
There is a test for that somewhere in dlls/d3d9/tests/device.c (or some other
test file in there).
> but the documentation in the code seems to indicate that
> the gl texture needs to remain when the surface is deleted - I did nothing
> to change this.
But IWineD3DSurfaceImpl_Release will destroy the gl texture of a surface when
the surface is destroyed.
Also, if the gl surface still knows the texture, the following could cause an
issue:
SetCursorProperties(cursorSurface, ...);
<render some stuff>
LockRect(cursorSurface, ...);
<write some thing into the surface>
UnlockRect(cursorSurface);
PreLoad(cursorSurface);
The PreLoad will then change the cursor without SetCursorProperties beeing
called. This should not happen. I tested that with some hacky test.
Unfortunately this cannot be automated in the visual tests because cursors do
not show up in screenshots.
This is my hacky cursor test app:
http://stud4.tuwien.ac.at/~e0526822/visual.c
The successor of that file without the cursor tests is now in
dlls/d3d9/tests/visual.c. I think this visual.c version is not the version I
used for checking later surface changes.