Never tryed something related but what about...
(LPDIRECT3DTEXTURE9*)bmap.d3dtex?