The function updates the input mesh's vertex buffer with the new data. You need to have the tangent, normal and bitangent allocated in the mesh data in advance, even though they would initially be garbage.
To re-allocate a mesh with vertex elements of your choice, you can use ID3DXBaseMesh::CloneMesh .

Find content
Not Telling