Sounds like you're not clearing (setting all values to a clip-far value) your shadow map before rendering.
Finally I found it. The problem was Zbuffer.It couldn't clear the Zbuffer.
IDirect3DDevice9::Clear will fail if you:
1-Try to clear either the depth buffer or the stencil buffer of a render target that does not have an attached depth buffer.
2-Try to clear the stencil buffer when the depth buffer does not contain stencil data.
Mine was case 2.