You need to call Map() on the texture to get access to the texture data. Don't forget to call Unmap() afterwards. You will have had to create the texture with the proper flags to be able to write to the texture.
wait will this work on directx 9?
edit:IDirect3DTexture9 has LockRect() method,but I'm not sure exactly how to use it,could someone explain it's arguments:
[in] UINT Level, [out] D3DLOCKED_RECT *pLockedRect, [in] const RECT *pRect, [in] DWORD Flags