When IWineD3DDevice_GetDepthStencilSurface returns WINED3DERR_NOTFOUND it was setting ppZStencilSurface to null. This was the cause of rendering issues with the 3d models in spore.
Can you write a test for this? I think we have some depth stencil tests in dlls/d3d9/tests/device.c which you could use to test this.
I think you are right with this patch - I vaguely remember writing a test for a different getter function, but it is better to be sure